PureBytes Links
Trading Reference Links
|
Try the following. I didn't have time to test it but it should be close.
You do not need the SwingLow function and it doesn't work for trading since it sees the low too late to be useful.
Bob Fulks
-----
Vars: Count(2), Stop1(0), Entry1(0);
{the middle bar must have the lowest low and lowest high}
Condition1 = Low[1] < Low and Low[1] < Low[2] and
High[1] < High and High[1] < High[2];
{the last bar must close above the high of the middle bar}
Condition2 = Close > High[1];
{The high of the last bar must be above the high of the other two bars}
Condition3 = High > High[1] and High > High[2];
{the volume of the last bar must be higher than the volume of the middle}
Condition4 = Volume > Volume[1];
{the middle-bar low must be at least a new 20 bar low}
Condition5 = Low[1] < Lowest(Low, 19)[2];
Condition6 = Condition1 and Condition2 and Condition3 and Condition4 and Condition5;
{A move above the high of the last red bar must occur within 2 bars. At that
point a long position would be initiated.}
Count = Count + 1;
if Condition6 then begin
{The low of the middle bar is the MM stop}
Stop1 = Low[1];
Entry1 = High;
Count = 1;
end;
if Count < 2 then
Buy next bar at Entry1 stop;
if MarketPosition > 0 then Sell next bar at Stop1 stop;
if BarsSinceEntry > 5 then Sell at close;
At 2:28 PM -0500 1/4/00, VBatla@xxxxxxx wrote:
>Hello and thanks for responding!
>
>I know that's kind of vague. I'm trying to code a island bottom reversal
>which is in the attached file.
>
>The rules are:
>
>Look for a three-bar configuration that looks like the letter V,
>the middle bar must have the lowest low and lowest high and the last bar must
>close above the high of the middle bar.
>The high of the last bar must be above the high of the other two bars.
>Also, the volume of the last bar must be higher than the volume of the middle
>bar and lastly, the middle-bar low must be at least a new 20 bar low.
>
>A move above the high of the last red bar must occur within 2 bars. At that
>point a long position would be initiated.
>
>The low of the middle bar is the MM stop.
>
>(the reverse for short entry.)
>
>
>What I have is:
>
>Condition1 = SwingLow(1, Low, 1, 2) <> -1;
>Condition2 = Close > High[1];
>Condition3 = High > High[1] AND High > High[2];
>Condition4 = Volume > Volume[1];
>Condition5 = Low[1] < Lowest(Low, 20)[2];
>If condition1 and condition2 and condition3 and condition4 and condition5 =
>true
> then buy (High) + .01 stop;
>
>Exitlong at Low[2] stop;
>
>I know that a couple of conditions are not quite right yet but I'm kinda
>stumped.
>
>
>
>In a message dated 1/4/00 12:11:48 PM Central Standard Time,
>bfulks@xxxxxxxxxxxx writes:
>
><< >Hello, I'm looking to buy condition3 + 1 tick within the next two bars.
>Any
> >help with the el code would be appreciated.
> >
> >Condition3 = High > High[1] AND High > High[2];
>
> It is not a very clear question.
>
> Condition3 is a TRUE/FALSE variable so cannot be used as a value. >>
>
>Attachment converted: Documents:v setup.jpg (JPEG/JVWR) (00022771)
|