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
1 registered members (degenerate_762), 1,098 guests, and 2 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
Variable Spread Backtesting with .bar data and Zorro free #461891
08/27/16 17:15
08/27/16 17:15
Joined: Aug 2016
Posts: 95
Wien
T
trenki2 Offline OP
Junior Member
trenki2  Offline OP
Junior Member
T

Joined: Aug 2016
Posts: 95
Wien
I was successfully able to do variable spread backtesting in the Zorro free version and I would like to share my approach here for anyone who might want to do the same.

I used my C# DukascopyTickDownloader code from my github repository at https://github.com/trenki2/DukascopyTickDownloader to download the free Dukascopy tick data and convert it to the format that Zorro needs.

The tick downloader can store the data in .t1 and also .bar data and additionally it creates a pseudo asset e.g. EUR/USDs which contains the spread data.

When backtesting one has to read the spread data from the corresponding pseudo asset, set the Spread variable and then do the actual trading.

Here is the code that worked for me:

Code:
while (loop("AUD/USD", "EUR/USD", "GBP/USD", "NZD/USD", "USD/CAD",  "USD/CHF", "USD/JPY"))
{
	string realAsset = Loop1;
	char spreadAsset[10];
	sprintf(spreadAsset, "%ss", realAsset);
	
	Detrend = NOPRICE;
	asset(spreadAsset);
	var spread = priceClose(0);
	
	Detrend = 0;
	asset(realAsset);
	Spread = spread;
	
	Trade();
}


Re: Variable Spread Backtesting with .bar data and Zorro free [Re: trenki2] #461896
08/28/16 08:30
08/28/16 08:30
Joined: Aug 2016
Posts: 11
C
Calli Offline
Newbie
Calli  Offline
Newbie
C

Joined: Aug 2016
Posts: 11
Do you know this and Strat.Quant?

Last edited by Calli; 08/28/16 09:35.
Re: Variable Spread Backtesting with .bar data and Zorro free [Re: Calli] #461898
08/28/16 10:04
08/28/16 10:04
Joined: Aug 2016
Posts: 95
Wien
T
trenki2 Offline OP
Junior Member
trenki2  Offline OP
Junior Member
T

Joined: Aug 2016
Posts: 95
Wien
I started development of my C# code before I knew about those posts.

Also the procedure in the first post that describes how to get the data into the Zorro format is rather involved. It talks about stratquant, cygwin, python and some other conversion scipts. According to the documentation the T1 data with variable spread can also only be used with Zorro S.

The C# code does all in one go without the need for additional tools and the generated .bar data with variable spread can also be used with Zorro Free. This is the improvement someone might be interested in.

Re: Variable Spread Backtesting with .bar data and Zorro free [Re: trenki2] #461900
08/28/16 11:42
08/28/16 11:42
Joined: Aug 2016
Posts: 11
C
Calli Offline
Newbie
Calli  Offline
Newbie
C

Joined: Aug 2016
Posts: 11
Hmm?
1) StrategyQuant manages a lot more Symbols (Indeces, Futures, ..)
2) I manage with it about 400GB dld. Tickdata from Dukascopy on an external USB-drive
3) Zorro uses a rather strange format with most recent quotes at the beginning and the oldest at the end of the file, which to me is a bit questionable if you are dealing with files that has to be upadted - or do you want to to reload everything again and again?
4) Tickdata files are quite large, e.g. way toooo large to load them in Notepad++ or another editor at once and he uses python only to turn around the line sequence due to Zorro's time sequence formate. With normal Windows tools (like powershell) you only can either load everything at once (4GB) or (which will take a very long time from a usb-drive) read and save line by line??
5) I prefer using specialists for the tasks and not one thing that does everything. The specialists are better and provide more and the various tasks of several specialists are better to handle than one thing for all. E.g. compare the editors of mt4 or Zorro with Notepad++.
6) Why reinvent the wheel instead of focussing e.g. only on a better connection?

Last edited by Calli; 08/28/16 11:46.

Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1