Back testing is positive but on live account is negative. WHY? - page 2

 
Marco vd Heijden:

Not really i guess they have their own engines that provide the historic data at a fast pace, i think that it should not be too hard to program something like that.

But i usually run it on a demo for a month or two and then it's clear for 99% of the algo's you put up for testing.

I run it on a demo several month. 
 
Yasir Kidil:

3. NO Is the third option important? I use the "open prices only", otherwise optimization test time is being very long.

By the way, my expert advisor works on M1, M5 and M15 charts and It opens a trade when the candle close. "Every tick" method is not for my expert advisor, I think.

  1. The market doesn't have "open prices only" Does your EA only operate at a new bar? Otherwise your test is useless.
  2. Do you update your multiple timeframes before processing them.
    On MT4: Unless the current chart is that specific pair/TF referenced, you must handle 4066/4073 errors.
              Download history in MQL4 EA - MQL4 and MetaTrader 4 - MQL4 programming forum
 
whroeder1:
  1. The market doesn't have "open prices only" Does your EA only operate at a new bar? Otherwise your test is useless.
  2. Do you update your multiple timeframes before processing them.
    On MT4: Unless the current chart is that specific pair/TF referenced, you must handle 4066/4073 errors.
              Download history in MQL4 EA - MQL4 and MetaTrader 4 - MQL4 programming forum
Yes, like you said, My ea operates at a new bar. Do I really have to test with "every tick method"?
 
Yasir Kidil Do I really have to test with "every tick method"?

No one said that.

 
whroeder1:

No one said that.

Thanks for your help :)
 
Yasir Kidil:
Thanks for your help :)

Every OHLC prices is a tick. Why won't you use the "every tick mode" ? it's better !

 
Icham Aidibe:

Every OHLC prices is a tick. Why won't you use the "every tick mode" ? it's better !

I explained before. Optimization test time is being very long.
 
Yasir Kidil:
Yes, like you said, My ea operates at a new bar. Do I really have to test with "every tick method"?

Your EA fails in live trading because you have over-optimized it on the historical data. The more you optimize it on historical data, lesser are the chances to survive in real trading.

I know it sounds counter-intuitive but its true. Your trading strategy should be robust enough so that it provides at least some positive result without any optimization. After finding such a strategy, you can fine tune and optimize it but again be very careful, because at each stage of optimization, the strategy will be suffered from data mining biased and curve fitting. 

To know more about the data mining biased, you should read the award-winning research paper published by Dave Walton in 2014 titled "Know Your System! – Turning Data Mining from Bias to Benefit Through System Parameter Permutation"

Cheers,
Nitin.

 
Yasir Kidil:
Yes, like you said, My ea operates at a new bar. Do I really have to test with "every tick method"?

You say that you use a trailing stop. I'm not sure how accurate this would be if not testing every tick.

 

The lowest resolution for new bar with trailingstop would resemble every 1 Minute bar as a tick or open price , most likely your algo is tuned to this mechanism and so you would have to actually adjust the code that it also acts on every new M1 bar to resemble the testing environment because all ticks in between on a live feed are (extra) M1 ticks to your algo that did not were present in testing environment.

If you have run the tests at a higher frame say for example H1 then you have 1 tick per hour at the opening of every H1 bar so you would have to adjust the code to H1 bars.

datetime time; //global scope variable

//---
OnTick()
{
 if(time!=iTime(_Symbol,PERIOD_M1,0))
  {
   // Your code here...

   time=iTime(_Symbol,PERIOD_M1,0);
  }
}
//---

It's easy to try you can do something like this.