Download MetaTrader 5

Cannot see an offline chart

To add comments, please log in or register
Do you often publish source codes? Find out how to do that correctly!
Ling Wu Chung
215
Ling Wu Chung 2014.02.04 17:05 

I am running a EA to generate offline chart, EURUSD2.hst. However I can only see it on the OS (with modified time running) but cannot see it in "Open Offline Chart". How come?

Note: I've just changed to a new broker and setup this MT4 new. There is no such problem in my old MT4. Both of them are of version 600.


Many thanks!

Ubzen
5394
Ubzen 2014.02.04 17:26  
lingwuchung: I am running a EA to generate offline chart, EURUSD2.hst. However I can only see it on the OS (with modified time running) but cannot see it in "Open Offline Chart". How come? Note: I've just changed to a new broker and setup this MT4 new. There is no such problem in my old MT4. Both of them are of version 600.

I cannot see your attached codes?
Ling Wu Chung
215
Ling Wu Chung 2014.02.05 00:47  
Here is the EA, which I've used for more than a year. Thanks!
Slawa
Moderator
6841
Slawa 2014.02.05 09:34  
                HstHandle = FileOpenHistory(SymbolName + RenkoTimeFrame + ".hst", FILE_BIN|FILE_WRITE);

FILE_BIN|FILE_WRITE|FILE_SHARE_READ|FILE_SHARE_WRITE

Did you read our article?

Simon Gniadkowski
Moderator
18001
Simon Gniadkowski 2014.02.05 09:42  
stringo:

FILE_BIN|FILE_WRITE|FILE_SHARE_READ|FILE_SHARE_WRITE

Did you read our article?

Can you get the Documentation for FileOpenHistory() updated please . . .

mode

[in] File open mode. Can be one or combination of values: FILE_BIN, FILE_CSV, FILE_READ, FILE_WRITE.

. . there is no mention of the other flags.

Ling Wu Chung
215
Ling Wu Chung 2014.02.05 14:44  
stringo:

FILE_BIN|FILE_WRITE|FILE_SHARE_READ|FILE_SHARE_WRITE

Did you read our article?


Thanks Stringo! You're right I haven't read the article yet but the fact that one MT4 works and one doesn't with the same code make me thinkgs it's not due to coding issue. (oh, probably I was vague when I said "old MT4", which just meant a v600 which was installed a few days ago). After reading the article, I note the keyword "compile". After I compile the mq4 in my "old MT4", it got the same problem too! So it's fixed now. Thank you again!!!!

Then next problem is that I notice the offline chart is obviously lagging behind the online chart. I do the test with the PeriodConverter out of the box and notice the same. In the attached screen, you can see that all three pairs of currency are having different price in online and offline chart. This is not something that I can easily capture before I upgrade MT4. It doesn't help even if I reduce to one pair of online/offline chart only.

I've observed for a while and notice that it seems the offline chart will only got updated every 1 second, no matter how much ticks are there in the online chart within that second. Is this configurable? Another thing that I've missed?

Simon Gniadkowski
Moderator
18001
Simon Gniadkowski 2014.02.05 14:52  
lingwuchung:


Thanks Stringo! You're right I haven't read the article yet but the fact that one MT4 works and one doesn't with the same code make me thinkgs it's not due to coding issue. (oh, probably I was vague when I said "old MT4", which just meant a v600 which was installed a few days ago). After reading the article, I note the keyword "compile". After I compile the mq4 in my "old MT4", it got the same problem too! So it's fixed now. Thank you again!!!!

Then next problem is that I notice the offline chart is obviously lagging behind the online chart. I do the test with the PeriodConverter out of the box and notice the same. In the attached screen, you can see that all three pairs of currency are having different price in online and offline chart. This is not something that I can easily capture before I upgrade MT4. It doesn't help even if I reduce to one pair of online/offline chart only.

I've observed for a while and notice that it seems the offline chart will only got updated every 1 second, no matter how much ticks are there in the online chart within that second. Is this configurable? Another thing that I've missed?

Did you see this in the new period converter code ?

//--- refresh window not frequently than 1 time in 2 seconds
Ling Wu Chung
215
Ling Wu Chung 2014.02.05 15:13  
RaptorUK:

Did you see this in the new period converter code ?


Now I see it. :)

But there is no such checking in the Renko EA that I've been using but it's having similar symptom (that's why I try PeriodConverter) ........ Let me debug .......

But I've already encounter an even bigger problem - my mql4 cannot be compiled in v600 with syntax error!!! Just try to compile them in v503 which I've been using and it works and so it is sure there is compatibility issue in the compiler.... another headache.

Simon Gniadkowski
Moderator
18001
Simon Gniadkowski 2014.02.05 15:55  
lingwuchung:


Now I see it. :)

But there is no such checking in the Renko EA that I've been using but it's having similar symptom (that's why I try PeriodConverter) ........ Let me debug .......

But I've already encounter an even bigger problem - my mql4 cannot be compiled in v600 with syntax error!!! Just try to compile them in v503 which I've been using and it works and so it is sure there is compatibility issue in the compiler.... another headache.

Maybe you should read about the differences between the old mql4 and the new mql4 . . .
Ling Wu Chung
215
Ling Wu Chung 2014.02.05 16:17  
RaptorUK:
Maybe you should read about the differences between the old mql4 and the new mql4 . . .


Oh right. Reading.

Ling Wu Chung
215
Ling Wu Chung 2014.02.07 15:43  
RaptorUK:
Maybe you should read about the differences between the old mql4 and the new mql4 . . .


Hi,

I've resolved all the compilation errors but find the EA's OnTick (simplified to testOffline.mq4 as attached) cannot be triggered on offline chart (generating by PeriodConvertor). It doesn't have problem with normal M1 chart though. So I wonder what's wrong?

Files:
123456
To add comments, please log in or register