I have also attached the code as well.
- why do the orders get executed at the high when the command is for them to be executed at the next bar on open.
- and yet the exits are executed on the next bar at close when they are triggered.
Basically the aim was to enter on the next bar on the open after an entry trigger, and then to execute AS SOON as the exit is triggered. This will be when the low goes lower than a certain point.
thanks for any help.
......................
Code: Select all
[IntrabarOrderGeneration = True];
vars: LStop(0);
{CHECK STOPS}
if low<LStop then begin
sell("lx") this bar;
LStop=0;
end;
{ENTRIES}
condition1 = close[1]<close[5] and close>close[4];
if condition1 then
begin
buy("le") next bar on open;
LStop=low;
end ;
{trailstops}
LStop=maxlist(LStop,lowest(low,5));
messagelog(date,LStop, lowest(low,5));