I am trying to place a strategy order above the price of an entry signal for a short and below the entry signal for a long.
IF Condition1 OR Condition2 then EPl =(Low [1]);
If Condition3 or Condition4 then EPS =(High[1]);
Entryprice = (EPS +4* minmove);
Entryprice1 = (EPl -4* minmove);
If Golong = true then begin
buy("GoLong") next bar entryprice1 limit;
end;
If GoShort = True then begin
sellshort ("GoShort") next bar entryprice limit;
end;
The above does not work
“next bar market”will generate an order as will a negative minmove for a short entry
Any help would be most appreciated
Thanks
ax
Guidance with entry code
- Marina Pashkova
- Posts: 2758
- Joined: 27 Jul 2007
Hi Marina
Thank you for your interest and thank you for all the value you bring to this forum.
I will try to explain better what I am trying to bring about:
In any given bar that a condition turns from false to = true
I want to place buy limit order for the next bar at – 4*minmove of the price scale, below the “low” of the bar in which the related condition turned true,
and similar + 4*minmove above the “high” of the bar for a short entry.
Also I would like the added option to place an order +/- x#* minmove from the close of the relevant bar.
(The condition for a long entry requires an opposite value to the short entry and they cannot exist in the same bar)
I would want any order to remain in place until a separate and disparte condition turns true and cancels.
I hope I have been clear enough.
ax
Thank you for your interest and thank you for all the value you bring to this forum.
I will try to explain better what I am trying to bring about:
In any given bar that a condition turns from false to = true
I want to place buy limit order for the next bar at – 4*minmove of the price scale, below the “low” of the bar in which the related condition turned true,
and similar + 4*minmove above the “high” of the bar for a short entry.
Also I would like the added option to place an order +/- x#* minmove from the close of the relevant bar.
(The condition for a long entry requires an opposite value to the short entry and they cannot exist in the same bar)
I would want any order to remain in place until a separate and disparte condition turns true and cancels.
I hope I have been clear enough.
ax
IF Condition1 OR Condition2 then EPl =(Low [1]);
If Condition3 or Condition4 then EPS =(High[1]);
Entryprice = (EPS +4* minmove);
Entryprice1 = (EPl -4* minmove);
If MarketPosition<>1 and Golong = true then begin
buy("GoLong") next bar entryprice1 limit;
end;
If MarketPosition<>-1 and GoShort = True then begin
sellshort ("GoShort") next bar entryprice limit;
end;
I would add marketposition check in your code and maybe it will do the trick for you.
If Condition3 or Condition4 then EPS =(High[1]);
Entryprice = (EPS +4* minmove);
Entryprice1 = (EPl -4* minmove);
If MarketPosition<>1 and Golong = true then begin
buy("GoLong") next bar entryprice1 limit;
end;
If MarketPosition<>-1 and GoShort = True then begin
sellshort ("GoShort") next bar entryprice limit;
end;
I would add marketposition check in your code and maybe it will do the trick for you.