double Spread = MarketInfo(NULL,MODE_SPREAD) / 100000; double COpen = iOpen(NULL,240,0); double P2Low = iLow(NULL,240,2); double BuySL = P2Low - 0.0001; double BuySLDist = COpen + Spread - BuySL; double BuyTP = COpen + Spread + BuySLDist * 6;
Above snippet works fine in backtest, but first trade on live and BuyTP is short by exactly 6 * Spread + slippage. The shortage from slippage (if any) makes perfect sense, but any idea why Spread seems to have returned 0 in this instance? (Average spread at this broker is .4 pips and this was during Asia so really doubt spread was 0 when trade occurred).
Consensus seems to be use symbol() instead of NULL, but don’t think this is issue.
Can easily rectify with an order modify after trade entry and will do this to account for slippage, but would like to fix spread issue at source.
Any help would be much appreciated.