I am trying to adjust the script PeriodConverter that is included in MT4 samples, to use multiple timeframe periods in one conversion script.

The modified script works partially, but the modified part isn't updating on chart as original does.

With this script can be generated and used as regular charts, (even they are opened with File -> Open Offline), any custom periods of existing charts, M2, M3, H2, H5... even strange periods like M7 , M11 or H9.

I attach code (see SRC below) , I think it can be usefull for other users if can be made to work with multiple periods output, maybe 4-5 periods in a shot (first, let's make it work with 2 periods).

I found very interesting that when opening offline chart generated by original script, can be seen updated prices, add indicators, additional scripts, even activate "Show Ask line".

There is only a delay of about one second in updating chart (initially it was 2 seconds but I changed value of delay to 1).

In the modified part , the calculation is made OK as it seems, but only to history part and doesn't update Ask & Bid lines.

If I open in Offline mode the generated charts, the first chart is updating and works great, but the second isn't.

I'm new in programing MQL, can anyone help to correct this problem, and maybe to eliminate redundant / not necessary parameters that can be used only once in a run, to speed up script execution?

I can't see any comments in the code posted explaining what you changed and why . . . document your changes then it would be easier for someone else to help you, they would easily and quickly see what you have done.

RaptorUK: I can't see any comments in the code posted explaining what you changed and why . . . document your changes then it would be easier for someone else to help you, they would easily and quickly see what you have done.