| 
 PureBytes Links 
Trading Reference Links 
 | 
At 3:34 AM -0400 5/28/99, John Niem Jr wrote:
>Example: buy close of today - 10 limit;
>
>The above signal would only be valid for the next bar.  How can I make it so
>that the "limit buy" order would be a "good til cancelled" order that
>doesn't expire if it doesn't hit on the next bar?
The way I usually do this is to set some True/False variable on the buy
condition and then keep the condition active for some number of bars. The
code below illustrates the technique.
Bob Fulks
------
Input: MaxCount(5);
Vars: BuyOK(FALSE);
Count = Count + 1;
if Count > MaxCount then BuyOK = FALSE;
if <buy_condition> then begin
   BuyPt = Close -10;
   BuyOK = TRUE;
   Count = 0;
end;
if BuyOK then Buy next bar at BuyPt limit;
 
 |