
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 wanted to publish this at that time, but looked horribly on the front page:
Hi guys and gals,
I ran into this issue too some time ago and we discussed it here: https://www.mql5.com/en/forum/1642
My EA has an open prices only strategy and I wanted to stick to that to save time during backtesting (obviously).
The solution I devised is as follows:
I will cut and paste the important sections of code from my EA below here. I hope this will be of any help to you!
Cheers!
Just came across this problem myself. You've guessed it, trying to port from JForex to MQL5! I'm beginning to wish I hadn't bothered, though I suppose the deadline extension helps :)
Looks like MetaQuotes still haven't fixed it.
MT5 forex doesn't appear to support DOM.
isNewBar won't help me.
Seems a ridiculous state of affairs.
Does anyone know if anything has changed inside MT5 regarding this issue?
Does anyone know of a solution that works for a multi-currency strategy that is expecting to be fed ticks?
Yours in frustration,
Jim
Just came across this problem myself. You've guessed it, trying to port from JForex to MQL5! I'm beginning to wish I hadn't bothered, though I suppose the deadline extension helps :)
Looks like MetaQuotes still haven't fixed it.
MT5 forex doesn't appear to support DOM.
isNewBar won't help me.
Seems a ridiculous state of affairs.
Does anyone know if anything has changed inside MT5 regarding this issue?
Does anyone know of a solution that works for a multi-currency strategy that is expecting to be fed ticks?
Yours in frustration,
Jim
Hi enivid,
Try using OnTimer() with 1 second timer instead of OnTick().
Thanks for the suggestion. Your solution works far better than any of the others I've tried, certainly for our requirements.
However running multi-currency backtests against different pairs still produces slightly different results.
Doesn't inspire huge amounts of confidence!
I'm off to burn a lot more midnight oil now!
Cheers,
Jim
Try using OnTimer() with 1 second timer instead of OnTick().
TradingGurus:
However running multi-currency backtests against different pairs still produces slightly different results.
Jim, I use the OnTimer solution with 1 second in my contest portfolio EA. If your strategy relies on every tick, then yes, you will get different results when using OnTimer vs OnTick on a single currency since more than one tick per second is possible. I found that it usually makes the most difference when the "missing" tick created a new bar high or low. You can check the previous bar high/low and current bar high/low for any changes and insert these as a "missing tick" when they occur, unless of course the current tick created the new bar high/low.
Also remember that the MetaTrader Strategy Tester only simulates tick data. Depending on how sensitive your strategy is with tick movement, this simulation may have a significant impact on back-testing vs forward testing.
- Patrick
If your strategy relies on every tick, then yes, you will get different results when using OnTimer vs OnTick on a single currency since more than one tick per second is possible.
- Patrick
That's not quite what I meant. Our (still only potential!) contest EA trades all 12 pairs. Using OnTimer() only, I get different backtest results if I select GBP/USD in strategy tester rather then EUR/USD for example.
I am all too familiar with the limitations of MT4 when backtesting using simulated ticks. Unfortunately it looks like MT5 isn't a whole lot better!
Jim
We were extremely keen to get this all going with ticks for historical reasons, but we've given up. Just can't get things consistent.
We've bitten the bullet, and are now working with 1 minute bars with the help of OnTimer() and isNewBar().
Things have begun to look vaguely sensible at long last, and what's more there's still 4 hours to go to the championship deadline :)
JimFinally submitted our EA with about 5 minutes to spare before the deadline.
One backtest under its belt, and no optimization.
Never having done this before, can anyone tell me if it still stands a chance of getting approved?
If so, will we be allowed to fiddle with the input settings over the next week, or not?
Jim
Finally submitted our EA with about 5 minutes to spare before the deadline.
One backtest under its belt, and no optimization.
Never having done this before, can anyone tell me if it still stands a chance of getting approved?
If so, will we be allowed to fiddle with the input settings over the next week, or not?
Jim
Good Luck Jim!
If your EA backtested correctly within 2010.01.01 up to 2010.08.01 without any errors (trade errors, etc.) and a profit, then you will likely get approved, as long as your personal info is also correct. However, you will not be able to change anything from this point forward, including settings (input parameters)
I hope to see your bot in action!
- Patrick