WHY does my trade exit at second bar from entry

Hi i am testing a simple code of EMA cross over . every time i get a buy or short signal . it exits a second bar from entry . long or short any trade . it dont wait until my target or stoploss is hit .

Sell = ApplyStop( stopTypeProfit, stopModePoint, amount2,ExitAtstop = 0,True,ValidFrom = 0, ValidTo = -1,ActivationFloor = 1) OR Cross( tn, endTime ) ;

What you do is incorrect. ApplyStop does not return result.

Also you should read here.

1 Like


Your user account isn't marked with License verified badge. Did you purchase AmiBroker license?

Only users with License verified badge are allowed to post on this forum.

So before posting, make sure you verify your license as explained here.