Gamestudio Links
Zorro Links
Newest Posts
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
Release 2.68 replacement of the .par format
by Martin_HH. 09/23/25 20:48
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (TipmyPip, AndrewAMD), 16,415 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Flush the plotting queue #485851
04/28/22 13:00
04/28/22 13:00
Joined: Jan 2022
Posts: 70
Budapest
N
NorbertSz Offline OP
Junior Member
NorbertSz  Offline OP
Junior Member
N

Joined: Jan 2022
Posts: 70
Budapest
Dear all,

I have a script that analyzes an asset. It makes the lookback period, then

Code
if (!is(LOOKBACK)){
	draw some lines on chart
	save the drawing with plotChart()
	quit();
}


(It reads the candles from MT4 connector.)

Picture 1:
I selected an asset, run Trade, and this is the result.

Picture 2:
I did exactly the same again, other result.

Picture 3:
MT4 terminal, the realtime data itself, what I should see on the plotted png (except the last ongoing bar of course)

(For simplicity, I commented my drawing commands, so you not see my lines on the attached pictures.)

So as it looks like for me, Zorro did not finish drawing the candles in the first time, and also did not draw my lines. But in the second run it works flawlessly. However I can also be sure on the correct first run if I put some calculations on the main run() script, or just for example:

Code
int run_counter = 0;
function run(){
	run_counter++;
	printf("run %d", run_counter);
	..............
}


So in this way it writes all the running cycles correctly, and the plotted chart looks perfect.

I guess the main run() function is not waiting for the plotting mechanism, so the script ends sooner than Zorro prints the candles and the other drawings. Do you have any idea how can I enforce flushing the ongoing drawing queue with a command?

Thank you!

Attached Files 1.png2.png3.png
Last edited by NorbertSz; 04/28/22 13:05.
Re: Flush the plotting queue [Re: NorbertSz] #485852
04/28/22 14:45
04/28/22 14:45
Joined: Apr 2008
Posts: 594
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 594
Austria
That's no 'flush' but a known issue with MT4 servers. If they have insufficient history stored, they sometimes need a long time or a second start for delivering all the data. You will normally get a warning message in such a case when the lookback period is incomplete.

https://zorro-project.com/manual/en/mt4plugin.htm


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1