[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Buy Stop



PureBytes Links

Trading Reference Links

At 4:25 PM -0400 10/12/99, Anshien, Joe wrote:

>How can I do this until a stop or reversing signal is hit?  Or maybe 2 or 3
>bars in the future instead of 1.


Something like the following should work. (Untested)

Bob Fulks

-----------

Vars: AO(0), BuyOK(FALSE), BuyPt(0), Count(0);

If (AO[1]<0) and (AO>0) then begin
    BuyOK = TRUE;                 {Set Buy Flag}
    BuyPt = High + 1;             {Set Buy Point}
    Count = 0;                    {Initialize Count}
end;

if BuyOK and Count <= 2 then     {Conditions to issue buy}
    Buy ("AO_X") next bar at BuyPt Stop;

if MarketPosition > 0 then BuyOK = FALSE;   {Cancel Buy Flag if filled}
 
Count = Count + 1;               {Increment Count of bars}

----------