'Off-server' data files questions

 

.

All I want to do is drop a script on an offline chart and have it refresh. I have tried

WindowRedraw()

RefreshRates()

PostMessageA() From Period Converter opt and WithoutSunday

Even the windows keystroke code from 2004.

Everyway to Sunday and...

Nothing.

.

Wow, this problem is a tough one for me. I'm totally baffled. This can't be but a couple lines of code.

.

Any help would be greatly appreciated.

..

Hi All,

Hope everyone is having a pleasant holiday season.

.

A couple questions concerning 'off-server' data. I use MT4 for all my charting needs. I appreciate the software and the folks involved in the project. Last year I hacked a few scripts using snippets of code from around this site and help from Phy and others to create .hst and subsequent .csv files (w/MT4 indicator data for import into Excel) for the EOD futures data I use and they work just fine. I've just finished a script to merge my broker's daily Sunday and Monday data into one Monday bar and am pleased with the results.

.

No doubt I'm doing more than I need to with the code but how I worked it is:

Broker: EURUSDm1440.hst

Merged: EURUSD1440.hst

Script 1 dropped on chart of brokers data: brokers.hst -> merged.csv -> merged.hst

Script 2 dropped on manually refreshed offline chart of merged data: merged.hst -> excel.csv

.

1) How can I refresh the offline data from Script 1?

2) Really I would like to automate the entire process in an indicator and I'm hoping there may be more resources for accomplishing this than Period_Converter_Opt.

.

For now the refresh solution would be great and any other ideas for an indicator would get me making more coffee.

.

All The Best,

Yellowlion

 

Here are the pieces:

#include <WinUser32.mqh>

#define CHART_CMD_UPDATE_DATA 33324

int hwnd = WindowHandle(Symbol(), Period());
PostMessageA(hwnd, WM_COMMAND, CHART_CMD_UPDATE_DATA, 1);

 
phy wrote >>

Here are the pieces:

#include <WinUser32.mqh>

#define CHART_CMD_UPDATE_DATA 33324

int hwnd = WindowHandle(Symbol(), Period());
PostMessageA(hwnd, WM_COMMAND, CHART_CMD_UPDATE_DATA, 1);

Hi phy,

Happy Holidays.

.

Nothing new under the sun with the above directions. I got the pieces, but I'm obviously missing something.

.

What I'm trying now is opening the merged.csv and writing the merged.hst on the window I would like to refresh.

All code executes flawlessly until PostMessageA(,,,0) or PostMessageA(,,,1) then I get no refresh or execution alert.

.

I understand that WM_COMMAND is a Windows menu notification (thus WinUser32.mqh) and
guessing that 33324 is the directive to the refresh command.

.

I'm currently looking at komposter's "Free-of-Holes" script and although the means to the end is different, I just don't see what the solution is.

.

 

Is your history file any good?

The symbol name needs to be NOT a duplicate of a real name the Dealer uses.

If you can manually open the history on the chart, good.

If you can update the history file with whatever source you are using, good.

If the above is good, you should be able to update the history and send a refresh request to the chart window, whereupon it rewrites the chart.

The refresh needs to be a script, as there are no ticks to tickle an EA or Indicator to perform the code.

 
phy:

Is your history file any good?

The symbol name needs to be NOT a duplicate of a real name the Dealer uses.

If you can manually open the history on the chart, good.

If you can update the history file with whatever source you are using, good.

If the above is good, you should be able to update the history and send a refresh request to the chart window, whereupon it rewrites the chart.

The refresh needs to be a script, as there are no ticks to tickle an EA or Indicator to perform the code.

 

Greetings,

I have also used the MB Trading sdk to build tick files. First of all for my own app and now I am testing to put into MT4 as hst files.

I am building the files but I cannot get them to load. The chart screen open up with waiting for update.

The number of bars shown in the Open Offline dialog is correct as is the start date and end date.

Here are the screenshots of header and first record. Does is matter that the time includes seconds?

Files:
 

I have my MB to hst files working live. Also other MT4

terminal data feeding in for checking bad ticks.

I could not find a way to get the current profile name off the taskbar

no doubt it can be done. I just hardcoded it for now.

I read the order.wnd file in Profiles to get the chartnames and periods.

I loop through that file after opening it with WinFile.mqh that a nice

person posted. Then I use the snippet that Phy posted to update all

of my offline charts. Seems ok.

I am doing this in the init section of an ea.

I don't like scripts they seem to stop working at the drop of a hat.

I set the last arg of PostMessageA to 0 which is what was in the

Period Converter script.

All criticism most welcome.

Reason: