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

anchoring a limit order to the closing price of a specific bar



PureBytes Links

Trading Reference Links

I am trying anchor a limit order to the first bar that meeets the criteria
for the included system to go long/short.  For example: if the system
generates a short order after bar 5, I wish for the sytem to place a limit
order of: Sell at(closing price of bar 5 + 10 points)limit.  This criteia
may or may not be met by the next bar.  If not, I wish for the order to stay
open until the criteria based on bar 5 is met.  The system currently
references the current bar of the system which may or may not be the bar
that first met the criteria of the system.  Any help is appreciated.

Matt
-----------------------------
inputs:length(10);

Value1 = Average(Close,length);
Value2 = 5

Value3 = Value1 + (3 * Value2);

If Close > Value3 Then Buy next bar at close - 10 points limit;

If Close < Average(Close,length) then ExitLong next bar at market;

End;