The code translation between SQX and Multicharts of ExitAfter X Bars is 1 off. Trades in MultiCharts take 1 extra bar.
Current Code in MultiCharts powerlanguage:
// ExitAfterBars
if (18 > 0 and BarsSinceEntry(0) >= 18) then
Sell("LongExitAfterXBars") next bar at market;
Code that produces the same exits (note the comparison operator):
// ExitAfterBars
if (18 > 0 and BarsSinceEntry(0) > 18) then
Sell("LongExitAfterXBars") next bar at market;
There are 2 different resulting implementations in Multicharts for this condition:
- First one has raw number in it.
- Second one has a variable named ExitAfterBars
Please make sure both are corrected.
I've attached positions and code comparison snapshots.