lljustll / Publications
Forum
Modifies the SL and TP correctly in strategy tester but does not modify on live testing.
// open a sell double openPrice = iClose ( Symbol (), PERIOD_M1 , 0 ); double valueToRisk = acc_size * risk_perc / 100 ; double sl = iHigh ( Symbol (), PERIOD_D1 , 0 ) + pips_from_swing* _Point * 10 ; double tp;
Why would this work perfectly in strategy tester, but absolutely makes no sense in live?
So this code opens up a trade based on risk I set on EA options. Say I set the acc size to 1000 and risk to 1. That means the EA will risk 100$. SL should be at -100$. and TP is 1:1 so at +100$- lot size.will be calculated automatically. It works perfectly in Strategy tester . But on live the SL