I am having a really Headache with a bad entry. Here is my code:
Per1=20
if (Position.MarketPosition == MarketPosition.Flat && ADX(14)[0]<25){
if (High[0]>=APZ(2,per1).Upper[0]) EnterShortStop(APZ(2,per1).Upper[0],"Vende");
if (Low[0]<=APZ(2,per1).Lower[0]) EnterLongStop(APZ(2,per1).Lower[0],"Compra");
if (Position.MarketPosition != MarketPosition.Flat && BarsSinceEntry() == 4){
ExitLong();
ExitShort();
}
As you can see, Conditions fulfilled at the first red bar of the image, so an enterLongStop is sent to the next green bar. However, there is not such entry...
If I write "EnterLongStop(APZ(2,per1).Lower[0] + TickSize,"Compra");" or "EnterLongLimit(APZ(2,per1).Lower[0],"Compra");", then, the strategy enters Long.
Could somebody help my with this issue?
Thanks in advance!
Comment