Metatrader known bugs ... - page 11

test
1232
test  
mladen:
Yes, but with caution. Those are simulated ticks and that is why it can never be exactly the same as runtime, but at least now they are much closer to reality than it used to be before

That is a good news

Mladen Rakic
154020
Mladen Rakic  
checkin:
That is a good news

Yes

Within reasonable limitations this is the best thing I have seen in all the changes of metatarder. Indicators attached to a visual back test charts still do not "see" these simulated prices, but whatever indicator you call from the EA does

BigBe
228
BigBe  

mladen,

Regarding MTF working better in strategy tester -

That's terrific!

In the real world, MTF indicators are not doing well in the Strategy tester:

I would like to get some ZigZag based MTFs working in the strategy tester. I decided to get basic in my tests.

These are from post 1 of https://www.mql5.com/en/forum/173574

MTF RSI does not work right.

MTF MA when set to higher Timeframe shows nothing and basically hangs up the strategy tester.

They work fine on regular charts.

Big Be

Mladen Rakic
154020
Mladen Rakic  
Big Be:
mladen,

Regarding MTF working better in strategy tester -

That's terrific!

In the real world, MTF indicators are not doing well in the Strategy tester:

I would like to get some ZigZag based MTFs working in the strategy tester. I decided to get basic in my tests.

These are from post 1 of https://www.mql5.com/en/forum/173574

MTF RSI does not work right.

MTF MA when set to higher Timeframe shows nothing and basically hangs up the strategy tester.

They work fine on regular charts.

Big Be

That happens when it is assumed that the number of changed bars of a current time frame is the same as the number of changed bars of the target time frame. That is why I write mtfs that are "asking" the target time frame how many bars have been changed in the target time frame and then calculate all the necessary bars. Also, in my experience, iBarShift() should be always used to find out which i the bar number of the higher time frame

________________

PS: those indicators (from the first post of the mtf thread) should be disregarded. You know that saying : first kittens are thrown to the water. Only later did keris2112 clean and clarify all necessary for a mtf to work properly

Mladen Rakic
154020
Mladen Rakic  

Seems that since some of the last updates something went wrong and multi time frame indicators can not be tested normally in visual backtesting. Some time frames will work, some not. I have tried testing and as a kind of a rule of thumb, on a 1 minute chart I could not use 5,15 and 30 minute time frames and could use higher time frames. Why is it happening - no idea. Why it can work on some time frames and does not work on some other time frames can be explained only as yet another bug

MrPip
546
MrPip  

It could be due to missing data for the backtester to use on various timeframes. Even though there is data for the charts does not always mean the data is available to the backtester. Try running a non-mtf EA on all timeframes to see if there is data. That should populate the timeframes for use by the strategy tester. I went through this problem years ago and that was the solution then.

Mladen Rakic
154020
Mladen Rakic  
MrPip:
It could be due to missing data for the backtester to use on various timeframes. Even though there is data for the charts does not always mean the data is available to the backtester. Try running a non-mtf EA on all timeframes to see if there is data. That should populate the timeframes for use by the strategy tester. I went through this problem years ago and that was the solution then.

Thought about that too, but it was not the case (enough data was downloaded for all time frames prior to tests). Found what was the problem

The problem was caused by the max bars on chart - I had it set to 5000 and in that case multi time framing for those lower time frames did not work if the starting time of the test was outside those 5000 bars of the higher time frame. So, the problem is that we can not keep max bars on chart on low values if we wish to visually back test indicators in mtf mode. Even when you have enough data, you have to broaden the max bars on chart or else it will not work OK

Mladen Rakic
154020
Mladen Rakic  

One more additional test made just to make sure : if the indicator is called from tested EA, that problem does not exist (then it disregards the max bars on chart setting and work correctly). The problem exists only if you wish to visually test the multi time frame indicator. EAs are not affected with this problem (no need to change anything in existing EAs)

__________________

PS: as mentioned in one of the previous posts, multi time framing from an EA works as in real time now (simulated ticks used though)

PPS: as far as I remember this problem with "max bars on chart" setting did not exist on older builds of metatrader 4

Mladen Rakic
154020
Mladen Rakic  

When IndicatorCounted() is called from offline charts, it always return 0 as a result. It is happening regardless of the way how ticks are simulated and is causing indicators to recalculate all the bars all the time. It is happening in the new metatrader 4 as well as in metatrader 4 build 509

Mladen Rakic
154020
Mladen Rakic  

Build 604 : FileFlush() is slowing down the process of writing data to a history file terribly )to the point that it seems as if the terminal is frozen). Do not call FileFlush() from within a loop. Try to call it only once per changes made on ticks - that way you will avoid that terrible slowdown (file flush functions are in general very fast in these days - with limitless cache - so this is a simple bug, not something that should work as it is working now)