PureBytes Links
Trading Reference Links
|
> if condition1=1 then buy at market;
> exitlong at entryprice(0) + 1 point limit;
Yup, the good old 1 bar delay. As written, your code will generate the
buy signal on bar 1. It will buy on the open of bar 2. On bar 3, the
entryprice function will know you have a new long and issue the limit
order. Bar 4 is the earliest your limit could be executed. Before bar 3,
the entryprice function is working from the *previous* order.
With intraday data, the close of bar 1 is about the same as the open of
bar 2 so if you say...
if condition1 then begin
buy on close;
ep = close;
end;
exitlong at ep + 1 point limit:
... it will do almost what you want. You will have more problems with
daily data.
--
Dennis
|