Chartopen() question

 

Chartopen() is not able to open offline charts. Is there a programmatic way to open offline charts ?

 

Thanks, but this doesn't work.

It opens the offline dialog box, but doesn't select the offline chart or open the chart. I think the function

OpenOfflineChartbyNum needs fixing but I don't know how. It has lots of windows programming elements.

 
maindoor:

Chartopen() is not able to open offline charts. Is there a programmatic way to open offline charts ?



 
DeepThought:

Sure, but the solution posted by honest_knave almost works, except for a few windows specific changes.

Like selecting an entry and clicking on it. So far I find sendmessage should be used instead of postmessage on win 7.

If there are any other changes in this code: https://forum.mql4.com/ru/25962/page3#382947 experts here can comment.

 
maindoor:

Sure, but the solution posted by honest_knave almost works, except for a few windows specific changes.

Like selecting an entry and clicking on it. So far I find sendmessage should be used instead of postmessage on win 7.

If there are any other changes in this code: https://forum.mql4.com/ru/25962/page3#382947 experts here can comment.


Well, it is not quite trivial. Just reading the file list n a folder is not enough. The chart list in the "Open offline" modal window skips files that are not valid hst files (it apparently analyses the content).

Additional issue may arise with sorting. You are not sure how sorting of the modal window corresponds to the sort you use for files. The users are from all over the word, with many different locales.

 For those reasons I would not use the down arrow press event. I would use keyboard sequence for the chart name. But... again, you have many keyboard layouts all over the world, so a bit advanced coding is necessary. 

 
DeepThought:

Well, it is not quite trivial. Just reading the file list n a folder is not enough. The chart list in the "Open offline" modal window skips files that are not valid hst files (it apparently analyses the content).

Additional issue may arise with sorting. You are not sure how sorting of the modal window corresponds to the sort you use for files. The users are from all over the word, with many different locales.

 For those reasons I would not use the down arrow press event. I would use keyboard sequence for the chart name. But... again, you have many keyboard layouts all over the world, so a bit advanced coding is necessary. 

 

:(
Reason: