Problem regarding difference in MT4 - MT5 for accessing datetime in the future

Hi, I converted the Battleplan indicator (found in the network) from MT4 to MT5 successfully, but I still have a problem.

The diffulty I enconter is to do the indicator in MT5 to paint the battleplan for future time date. In MT4 the indicator paint the battleplan even for future data, in MT5 if I try to do the same I get array out of range.

I attach both the MT4 code and MT5 code.



I even tried to resize both array (time & Hurst) with an appropriate dimension but I get the same error

Here are the changes i tried in MT5 version but without success






for( i=limit+(int)cyclelength; i>=0; i--) {




My question is:

Is there any way to get the same behaviour in MT5 and MT4 version of the indicator?


battleplan.mq5 6 kb

battleplan_ciclo_4_tempi.mq4 4 kb

If you remove the flag condition, then it works

What you have to check are the values (which are obviously not correct)


test_mq5.png 89 kb

Sorry for confusion, but what I need is to translate in MT5 is this one:

Battleplan ciclo 3 tempi.mq4

As you can see in the picture the indicator in mt4 draw the battlepla also for future data (the battleplan is shifted in the future of “cyclelength” period ). How can I get the same in Mt5?



battleplan_ciclo_3_tempi.mq4 3 kb

battleplan.jpg 88 kb

I solved the problem with a workeround



battleplan_ciclo_normale.mq5 9 kb

a.jpg 72 kb

Hi Cristi Ruddiforth, I tried installing the battlepan indicator on my mt4 but it does not work. I see nothing, maybe something wrong. can you give me any advice? thank you

Check for errors in the logs.

Also you may want to add #property strict directive in front of the source code, recompile it, and try again - this can help to pinpoint possible problems.