gooly:
What was the Spread for each run ? do you use any Objects in your code and use them to determine when to place or exit trades ?
Hi
I am backtesting my EA in 15min timeframe and I get different results just because I backtest once in visual mode and once in non visual modes?
I am backtesting my EA in 15min timeframe and I get different results just because I backtest once in visual mode and once in non visual modes?
Everything(!) stays the same only the “Visual mode” of the Strategy Tester is either enabled or disabled?
RaptorUK:
What was the Spread for each run ? do you use any Objects in your code and use them to determine when to place or exit trades ?
What was the Spread for each run ? do you use any Objects in your code and use them to determine when to place or exit trades ?
Spread is about 0.5 pip, no objects.
I think that may be this indicator https://www.mql5.com/en/code/7157 (i-FractalsEx) may caused this as this determines whether to trade short or long.
my code to get its values:
double qFrac[3]; #define OP_DIR 2 ... int setFrac( int i=0 ) { while(i<100) { double hi = iCustom(Symbol(), chartFrac, "i-FractalsEx", 6, 500, 0, i); // 6, 500 are its standard values double lo = iCustom(Symbol(), chartFrac, "i-FractalsEx", 6, 500, 1, i); if (hi > 0.0) { qFrac[OP_SELL] = hi; // OP_SELL = 1 qFrac[OP_DIR] = -1.0; // 0 if (qFrac[OP_BUY]> 0.0) return(OP_SELL); } else if (lo > 0.0) { qFrac[OP_BUY] = lo; // OP_BUY = 0 qFrac[OP_DIR] = 1.0; // 0 if (qFrac[OP_SELL] > 0.0) return(OP_BUY); } i++; } return(-1); } ... start() { if ( qFrac[OP_DIR] > 0.0 ) {// buy ..} if ( qFrac[OP_DIR] < 0.0 ) {// sell ..} .... }
Any ideas?
Gooly
gooly:
Spread is about 0.5 pip, no objects.
About ? but what was it in reality for each run ? disconnect from your Broker so the Spread stays the same and do the runs again, then if the results change you know it isn't related to the Spread.
Even if I use the the a little bit different version of i-FractalsEx from that link and changed a bit my function so:
int setFractal( int i=0 ) { bool set = false; qFrac[OP_SELL] = 0.0; qFrac[OP_BUY] = 0.0; while(i<100) { double hi = iCustom(SYM, chartFrac, "i-FractalsEx", 6, 6, 0, 4, 500, 1, i); //default values double lo = iCustom(SYM, chartFrac, "i-FractalsEx", 6, 6, 0, 4, 500, 1, i); if (hi > 0.0) { qFrac[OP_SELL] = hi; // 0 if ( !set ) { qFrac[OP_DIR] = -1.0; // 0 set = true; } if (qFrac[OP_BUY]> 0.0) return(OP_SELL); } else if (lo > 0.0) { qFrac[OP_BUY] = lo; // 0 if ( !set ) { qFrac[OP_DIR] = 1.0; // 0 set = true; } if (qFrac[OP_SELL] > 0.0) return(OP_BUY); } i++; } return(-1); }
- Spread changed between runs, most likely the difference.
- There is no slippage in the tester.
- Objects are irrelevant, They aren't really drawn, but testing of them should be is fine.
- CI should be fine, unless it looks a Bid, not Close[i], uses Hour(), not TimeHour(Time[i]) things like that.
- There is no mind readers here, you need to post ALL the code.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I am backtesting my EA in 15min timeframe and I get different results just because I backtest once in visual mode and once in non visual modes?
Everything(!) stays the same only the “Visual mode” of the Strategy Tester is either enabled or disabled?
The Stops and Targets of the 19 to 20 trades are between 50 and 80 pips so it cannot be an issue of slippage.
The results are reproducible for me.
non Visual mode:
Visual mode:Visual mode: 20 Trades 9 short, 11 long
Non-Visual mode: 19 Trades 19 short, 0 long.
Any ideas about the reason and how to get the same results?
Thanks in advance
Gooly