PureBytes Links
Trading Reference Links
|
At 2:37 PM -0400 7/17/98, Robert W Cummings wrote:
>This indicator will cross, and depending on which direction, will signal
>direction up or down for market direction. When the market gets into a
>choppy market or short narrow channel it will signal up and down within a
>few bars giving multiple signals in each direction. I'm want to get rid of
>the signals in the choppy times and short narrow channel times by not
>letting it give a signal unless at least say 5 bars have past since the
>last cross was signaled.
>If plot1 crosses over plot2 on a 2 minute bar chart at 9:00am its okay to
>give this signal but at 9:02am plot1 crosses under plot2 I do not want it
>to signal anything. Then at 9:06am if there is any kind of cross its okay
>to signal. There might have been a cross at 9:02am and 9:04am but I would
>not get a signal if it was doing what I wanted or trying to accomplish.
>
>input:length(9);
>Plot1(Slowd(LENGTH),"SLowd");
>PLot2(Slowk(LENGTH),"Slowk");
You don't say what happens if you get continuous signals more often than 5
bars but I assume you never want a new signal in that case. The following
code should do it.
It will plot a point only if the condition is now true and was last true 5
or more bars ago.
Set Plot1 and Plot2 to plot points of different colors with Scaling to
"Same as price data".
--------
Input: Length(9);
Condition1 = SlowK(Length) crosses over SlowD(Length);
Condition2 = SlowK(Length) crosses under SlowD(Length);
if Condition1 and MRO(Condition1, 5, 2) = -1 then begin
Plot1(Low,"Buy");
CheckAlert then Alert = TRUE;
end;
if Condition2 and MRO(Condition2, 5, 2) = -1 then begin
Plot2(High,"Sell");
CheckAlert then Alert = TRUE;
end;
|