Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Imhotep), 567 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Differences in Volume History and Result, why? #480632
06/21/20 22:22
06/21/20 22:22
Joined: Oct 2019
Posts: 27
Germany
TedMar Offline OP
Newbie
TedMar  Offline OP
Newbie

Joined: Oct 2019
Posts: 27
Germany
Hi, i try find out why my result of volume is different from history in same TF, maybe any one can help ?
Data history is SPY t6 in 1 min time frame include Vol per Bar.
in Zorro History Viewer are Vol prints Volume O.K.
SPY data History Download is available here.

Example code
Code
function run() 
{
		  set(LOGFILE+PLOTNOW);		 
		
		  Verbose = 3;
		  TickFix = 1;   
                  StartDate = 20200616;
                  EndDate = 20200617;
			  
		  BarPeriod = 1;  // same as History (RAW)
		
                  asset("SPY");

                       // vars Prices = series(priceClose()); 
		   
		vars Vol = series(marketVol());
		
                plot("MarketVol",Vol,BARS|NEW,BLUE);  
		
}




for Example result, check attachment, them display difference between History and Result.
Anyone know a way to resolve this problem?


Attached Files
Last edited by TedMar; 06/21/20 22:29.
Re: Differences in Volume History and Result, why? [Re: TedMar] #480658
06/24/20 06:53
06/24/20 06:53
Joined: Dec 2019
Posts: 53
ozgur Offline
Junior Member
ozgur  Offline
Junior Member

Joined: Dec 2019
Posts: 53
What does logfile say?

Re: Differences in Volume History and Result, why? [Re: ozgur] #480659
06/24/20 08:42
06/24/20 08:42
Joined: Oct 2019
Posts: 27
Germany
TedMar Offline OP
Newbie
TedMar  Offline OP
Newbie

Joined: Oct 2019
Posts: 27
Germany
Originally Posted by ozgur
What does logfile say?

If u remove TickFix, u get almost right Volume.
I connect already support , and he wrote me :

"if you do not see certain data in the log depending on the TickFix, then obviously two timestamps fall into the same bar. This can also happen without TickFix if the timestamps are irregular."

i mean this is a Bug, its bad when Volume disappear. TimeStamps in History data are clean and every 1 min regular.

without TickFix , Us Session open Price and Volatility at 9:30:00,000 are in previous Bar. I not understand why.. i manual "BarPeriod" i found this

Quote

In [Test] mode, bar generation is based on the UTC time stamps of ticks in the historical price data. All ticks that fall in the bar period contribute to the bar. For instance, a 10-minute bar ending at 12:00 contains all ticks with timestamps from 11:50:00.000 until 11:59:59.999. If the tick covers several prices, its time stamp should be from its close price. If historical time stamps are from the open or the middle price instead, you can use the TickFix variable for adjusting them. In [Trade] mode, bar generation is based on UTC time from the PC clock, not on the broker's server time for avoiding sync problems by connection interruptions and Internet lag.



in example ScreenShot i tryed count Volume from 1m History to 5min BarPeriod. Count function is from manual "marketVol()" Exampele
If i add 5x 1 Min Stamps i get different values to log. Maybe i count wrong..?

Attached Files
Re: Differences in Volume History and Result, why? [Re: TedMar] #480661
06/24/20 12:47
06/24/20 12:47
Joined: Feb 2017
Posts: 1,718
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,718
Chicago
Did you notice that all of your volume is multiples of five? Your last M1 tick is getting multiplied by five. That's because the other four volume data points are being thrown out. grin

Also, your volumeSum function is creating a five-minute lag.

Re: Differences in Volume History and Result, why? [Re: AndrewAMD] #480662
06/24/20 13:24
06/24/20 13:24
Joined: Oct 2019
Posts: 27
Germany
TedMar Offline OP
Newbie
TedMar  Offline OP
Newbie

Joined: Oct 2019
Posts: 27
Germany
aha Andrew thank u for info, but how is right code to get true result?

Re: Differences in Volume History and Result, why? [Re: TedMar] #480663
06/24/20 13:34
06/24/20 13:34
Joined: Feb 2017
Posts: 1,718
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,718
Chicago
In your first example, you plotted bars, but the second example printed numbers, which was far more useful.

Revise the first example to print volume numbers. This will give you some clues on what Zorro is doing behind the scenes.

Then play around with TickFix a bit more.

Re: Differences in Volume History and Result, why? [Re: TedMar] #480728
07/04/20 23:32
07/04/20 23:32
Joined: Oct 2019
Posts: 27
Germany
TedMar Offline OP
Newbie
TedMar  Offline OP
Newbie

Joined: Oct 2019
Posts: 27
Germany
notice, after many Mails with support ..https://manual.zorro-project.com/new.htm

Quote
Zorro 2.25 (current release) list of bugs
Under some circumstances the 1-minute volume by marketVol was not averaged, but taken from the most recent volume (fixed in 2.28.6).


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1