Getting an EA to work / Merging Sunday and Monday candles

PZ
31
PZ  

Hi

Has anyone come by this EA and got it to work?

https://www.mql5.com/ru/code/10071 (English version also attached)

When I add the EA to the chart, the EA loads properly however there's no indication that the re-written chart with the merged bars has been generated.

Or if anyone has another solution to generate a chart with merged Sunday and Monday bars, it'd much appreciated.

Grateful for any help.

pz 

Files:
nousunday.mq4  12 kb
qjol
3201
qjol  
nothing supposed to happen on the chart you put the EA you should open an offline chart with the name begins "WS_XXXXXX"
PZ
31
PZ  

Yep that's the part that doesn't seem to happen in that the chart with the merged bars doesn't seem to be generated. In the Expert panel I get:

2012.11.01 09:03:49 No Sunday GBPUSD,Daily inputs: ChartList="EURUSD 1440,GBPUSD 1440"; SundayToMonday=true; RefreshLuft=1000; 

2012.11.01 09:03:46 No Sunday GBPUSD,Daily: loaded successfully

 

And that's it. There's no message about opening an offline chart beginning with "WS_" 


Simon Gniadkowski
17411
pzling:

Yep that's the part that doesn't seem to happen in that the chart with the merged bars doesn't seem to be generated. In the Expert panel I get:

2012.11.01 09:03:49 No Sunday GBPUSD,Daily inputs: ChartList="EURUSD 1440,GBPUSD 1440"; SundayToMonday=true; RefreshLuft=1000; 

2012.11.01 09:03:46 No Sunday GBPUSD,Daily: loaded successfully

 

And that's it. There's no message about opening an offline chart beginning with "WS_" 

Did you check to see if the offline chart has been created ?
PZ
31
PZ  

Yep and none existed.

 

But just found it! It seems that the init function was somehow confusing the computer. Removing init() so that the EA just runs directly from start() fixes it and everything runs fine now.

 

Thanks all for your help 

PZ
31
PZ  

Looks like I've run into another problem. The EA works with most pairs but one of the pairs (GBPAUD) has generated a chart with HistoryBase errors.

 

How do I correct a HistoryBase error? Or for that matter how do I delete an offline chart so I can try and regenerate the chart? 

Simon Gniadkowski
17411
pzling:

Looks like I've run into another problem. The EA works with most pairs but one of the pairs (GBPAUD) has generated a chart with HistoryBase errors.

 

How do I correct a HistoryBase error? Or for that matter how do I delete an offline chart so I can try and regenerate the chart? 

Close down MT4.  Go to your MT4 folder,  then into history,  then into the relevant server folder if you have more than one . . .   you will see several hst files,  look for the one that corresponds to the name of your offline history and delete it.

 

Not sure what a "HistoryBase" error is . . .   this hight help:  https://www.mql5.com/en/forum/124490

PZ
31
PZ  

hmmm .. funny thing is none of the hst files in my directory corresponds to my offline charts. I've deleted all hst files anyway to be sure.

 

If I go to File>Open Offline, are all these offline charts supposed to correspond the hst files in the History folder? How can I check if the offline charts generated by the EA are being stored somewhere else? 

 

Update: Finally found the required hst files. It's due to a Windows 7 feature that keeps application data in each user's Appdata folder rather than in the central folder on c:\.

However the EA still encounters the HistoryBase error with GBPAUD, so very open to any ideas as to why this is. 

Having read https://www.mql5.com/en/forum/124490  I'm still not clear as to what the underlying problem is. In this case, the HistoryBase error remains constant at 9 (rather than increasing in the linked example), which occurs every time the EA refreshes. 

2012.11.01 16:06:40 HistoryBase: 9 errors in 'WS_GBPAUD1440'

2012.11.01 16:06:39 HistoryBase: 9 errors in 'WS_GBPAUD1440'

2012.11.01 16:06:38 HistoryBase: 9 errors in 'WS_GBPAUD1440'

2012.11.01 16:06:37 HistoryBase: 9 errors in 'WS_GBPAUD1440'

2012.11.01 16:06:36 HistoryBase: 9 errors in 'WS_GBPAUD1440'

fxapie
14
fxapie  

I have a similar problem with HistoryBase errors in an offline chart. From possible error causes as mentioned by other posters, I have tested for the following potential errors in the data, none of which of course is present.

1. Every bar has unique time
2. Low <= Open and Low <= Close
3. High >= Open and High >= Close
4. The volume is greater or equal to the number of differences between O, H, L & C.
5. OHLC and Volume are valid numbers greater or equal to 1 (This is on EURUSD chart).

I could not think of any other possible errors to look for!

Can anyone please give any more information on which errors the history file filter would report?

I am sure the people at MetaQuotes should be able to give us some clues! 

PS: Another observation is that mostly only the first write to a new record is accepted by FileWrite, or ends up in the file. Subsequent updates to the same record is most often ignored although no error is returned by the FileWriteInteger or FileWriteDouble. According to the file position before and after the write, the data was written. Is this another problem or related to the observed errors in HistoryBase???

I am sure the solution is simple if one knows what to look for but I am stumped for now!! 

Simon Gniadkowski
17411
fxapie:


I am sure the people at MetaQuotes should be able to give us some clues! 

You could try asking . . .  logon to the MQL5 site and submit a Service Desk request from your Profile,  worth a try.
fxapie
14
fxapie  
RaptorUK:
You could try asking . . .  logon to the MQL5 site and submit a Service Desk request from your Profile,  worth a try.


Thanks, certainly worth a try!