Problem updating History File

 

Hi,

I've developed a script, that generates a history file, to open the chart offline (MT4 Version 4.00 Build 509).

When I change the parameters of the script, the new content is written to the history file, but when opening the chart offline,

the content is still the old one.

Only when I restart MT4 or when I compile an mql4 file and then open the offline chart again, the new content is shown.

It seems like MT4 is using some cache for the content of the history file.

Would be greatful for any ideas.

 

Thanx. 

 
mt4forum: I've developed a script, that generates a history file, to open the chart offline (MT4 Version 4.00 Build 509). the content is still the old one.
Did you send an update message to the offline chart, like the other generators do?
 

I haven't heard about that yet.

How do I send an update message? 

Do you have a link for me?

 
Search offline-generators, constant range bars, Renko charts.
 

William,

I've added the update message, with no success.

I'm facing 2 problems: it either doesn't reflect any changes in the offline chart or when opening the offline chart I get "Waiting for update" and it just hangs there.

Checking the "offline chart" box in the offline chart properties doesn't help.

I've stripped my program down to the minimum and attached it.

Hope, you can help me. I really appreciate your support. 

 
FileName =  SymbolName + Period() + ".hst";  

WinHandle = WindowHandle(Symbol(), Period());   if (PostMessageA(WinHandle,WM_COMMAND,CHART_CMD_UPDATE_DATA,

Usually you put the offline generator on the M1 chart and it generates an offline M2.

You are overwriting your own M1 history file and sending an update message to yourself.

https://www.forex-tsd.com/metatrader-4/12769-range-bar-chart-mt4-24.html#post343528

 

William,

yes, I was sending the update message to myself. 

The history filename was ok, because SymbolName = "Test" and not = Symbol(), so at least I didn't overwrite the own history file.

The reason, why the offline chart did not open at all was, that I used a template offline.tpl, with the offline chart box unchecked.

When opening an offline chart with such a template, MT4 of cause expects an update from the server.

In that case it's obviously too late to check the offline chart box in the charts properties.

So, eveything's fine now. 

Thank you very much for your great support!

Reason: