Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 744 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 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