Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (SBGuy, Petra, flink, AndrewAMD, 1 invisible), 687 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 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: 58
N
NorbertSz Offline OP
Junior Member
NorbertSz  Offline OP
Junior Member
N

Joined: Jan 2022
Posts: 58
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: 586
Austria
Petra Online
Support
Petra  Online
Support

Joined: Apr 2008
Posts: 586
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