Gamestudio Links
Zorro Links
Newest Posts
DirectX : 3d Hardware Reset Failure
by jumpman. 11/27/20 07:29
Sortino(vars Data, int TimePeriod): var
by danatrader. 11/26/20 20:45
Need code for Williams Sentiment Index
by danatrader. 11/26/20 20:42
Binance Futures Plugin
by Mio. 11/26/20 10:54
Optimizing global & local parameters
by dBc. 11/25/20 15:16
Enter FOK orders simultaneously
by jcl. 11/25/20 10:55
looking how basic functions are made
by jcl. 11/25/20 10:47
AUM Magazine
Latest Screens
Paradox Vector
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
Who's Online Now
5 registered members (3run, danatrader, jumpman, NnamueN, MatPed), 472 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
MMK, raed, liquidbread, Dmitry_Shesterin, ddczp
18543 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Error using 5 second time frame - what's wrong with my script? #481742
10/25/20 15:18
10/25/20 15:18
Joined: Dec 2018
Posts: 24
K
Kaga Offline OP
Newbie
Kaga  Offline OP
Newbie
K

Joined: Dec 2018
Posts: 24
Returning to Zorro after a long break.
I have a FB.t6 file in the history folder with 5 second candle data for the past 2 years (checked with ZHistoryEditor that the data is valid).
The file Assets5s.csv contains:
Code
Name,Price,Spread,RollLong,RollShort,PIP,PIPCost,MarginCost,Leverage,LotAmount,Commission,Symbol
FB,150,0.1,0,0,0.01,0.01,0,1,1,0.006,FB!YAHOO:FB

I attempt to run the following code, just to plot the price data for now
Code
function run()
{
	set(PRELOAD);
	BarPeriod = 5./60;	// 5 second bars
	TimeFrame = 1;
	LookBack = 12000;	// 200*5*12
	StartDate = 2019;
	EndDate = 2020;


	assetList("History\\Assets5s.csv"); // load asset list
	asset(Assets[0]);

	vars pr = series(price());
	
   //Plot results:	
	plot("Price",pr,NEW,BLUE);
	set(LOGFILE,PLOTNOW); 
}

Unfortunately, Zorro returns the error message `Error 055: No bars generated`.
What is wrong with my syntax? How should I be using 5 second candle data to make Zorro actually recognize the candles?

Last edited by Kaga; 10/25/20 16:35.
Re: Error using 5 second candles - what's wrong with my script? [Re: Kaga] #481744
10/25/20 16:30
10/25/20 16:30
Joined: Dec 2018
Posts: 24
K
Kaga Offline OP
Newbie
Kaga  Offline OP
Newbie
K

Joined: Dec 2018
Posts: 24
In the documentation it says that for time frames below 1 min, the data needs to be in tick format ".t1".
I now have FB_2018.t1, FB_2019.t1, FB_2020.t1 in my History folder (again checked with viewer that data has valid format).
And changed the script to:
Code
function run()
{
	set(TICKS,PRELOAD);
	History = ".t1";
	BarPeriod = 5./60;	// 5 second bars
	TimeFrame = 1;
	LookBack = 12000;	// 200*5*12
	StartDate = 2019;
	EndDate = 2020;


	assetList("History\\Assets5s.csv"); // load asset list
	asset(Assets[0]);

	vars pr = series(price());
	
   //Plot results:	
	plot("Price",pr,NEW,BLUE);
	set(LOGFILE,PLOTNOW); 
}

Zorro S still complains with error 55 and error 47.
What am I doing wrong?

Last edited by Kaga; 10/25/20 16:35.
Re: Error using 5 second candles - what's wrong with my script? [Re: Kaga] #481745
10/25/20 17:10
10/25/20 17:10
Joined: Dec 2018
Posts: 24
K
Kaga Offline OP
Newbie
Kaga  Offline OP
Newbie
K

Joined: Dec 2018
Posts: 24
Turns out, the whole problem was that the data was saved in reverse order. Reversing the data points in the .t6 fixed the issue.

It may be a good idea to include a dataSort(1); just before a dataSave by default in the CSVtoHistory script, to make sure to avoid such issues.

Last edited by Kaga; 10/25/20 18:26.
Re: Error using 5 second candles - what's wrong with my script? [Re: Kaga] #481746
10/25/20 19:12
10/25/20 19:12
Joined: Oct 2017
Posts: 36
Munich
K
kalmar Offline
Newbie
kalmar  Offline
Newbie
K

Joined: Oct 2017
Posts: 36
Munich
Thank you for the post, I forgot about dataSort()


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1