Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
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
2 registered members (degenerate_762, AndrewAMD), 877 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
Could I use Zorro to test as an EOD? #453956
08/21/15 03:08
08/21/15 03:08
Joined: Jul 2014
Posts: 2
J
jaime Offline OP
Guest
jaime  Offline OP
Guest
J

Joined: Jul 2014
Posts: 2
Hello:I was looking in the manual and I can not find how to test historical CVS data from yahoo or google for test ETF with long time frames such as weekly or monthly? So basically end of day. Thank you so much.

Re: Could I use Zorro to test as an EOD? [Re: jaime] #453957
08/21/15 06:37
08/21/15 06:37
Joined: Apr 2014
Posts: 482
Sydney, Australia
B
boatman Offline
Senior Member
boatman  Offline
Senior Member
B

Joined: Apr 2014
Posts: 482
Sydney, Australia
The basic steps to achieve what you want are:

1. Download the data in CSV format from the website of your choice
2. Convert the CSV files to BAR files.
3. Add the asset to Assets.dta in the History folder so that the asset appears in your scroll box
4. You can anlayse bar periods that are greater than or equal to the periodicity of the data you downloaded. For example, if you have daily data, you can analyse daily, weekly, monthly bars, but not hourly.

How to accomplish each step is detailed in the manual.

Hope that helps.

Re: Could I use Zorro to test as an EOD? [Re: boatman] #453958
08/21/15 08:22
08/21/15 08:22
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Here's a script for converting Yahoo data:

Code:
// generate data files from .csv

#define YAHOO

#ifdef YAHOO
string InName = "History\\table.csv";  // name of the CSV file
string OutName = "History\\Stock.bar";
#endif

typedef struct _SYSTEMTIME {
    WORD wYear;
    WORD wMonth;
    WORD wDayOfWeek;
    WORD wDay;
    WORD wHour;
    WORD wMinute;
    WORD wSecond;
    WORD wMilliseconds;
} SYSTEMTIME;

API(SystemTimeToVariantTime,oleaut32)
int _stdcall SystemTimeToVariantTime(SYSTEMTIME* lpSystemTime, double* pvtime);

DATE ConvertTime(int Year,int Month,int Day,int Hour,int Minute,int Second)
{
	SYSTEMTIME Time;
	memset(&Time,0,sizeof(SYSTEMTIME));
	if(Year < 50) Year += 2000;
	else if(Year < 100) year += 1900;
	Time.wYear = Year;
	Time.wMonth = Month;
	Time.wDay = Day;
	Time.wHour = Hour;
	Time.wMinute = Minute;
	Time.wSecond = Second;
	
	DATE vTime;
	SystemTimeToVariantTime(&Time,&vTime);	
	return vTime;
}

string readTick(string content,TICK* tick)
{
// tokenize a single line	
	char* line = strtok(content,"\n");
	if(!line) return 0;

	int Year, Month, Day, Hour, Minute, Second; 
#ifdef YAHOO // line format "2015-05-29,43.45,43.59,42.81,42.94,10901500,42.94"

	if(7 != sscanf(line,"%4d-%2d-%2d,%f,%f,%f,%f",
		&Year, &Month, &Day,
		&tick->fOpen, &tick->fHigh, &tick->fLow, &tick->fClose)) 
		return 0;
#endif


// store the time in DATE format
	tick->time = ConvertTime(Year,Month,Day,0,0,0);

// return pointer to next line
	return line+strlen(line)+1;
}

function main()
{
	if(!file_length(InName))
		quit("Data file not found!");
	string content = file_content(InName);
		
// allocate TICK array		
	int maxticks = 60*24*365; 
	TICK* ticks = malloc(maxticks*sizeof(TICK));

#ifdef YAHOO
// skip the header
	content = strstr(content,"\n")+1;
// already contains ticks in reverse order	
	TICK* tick = ticks; 
	while(content) {
		content = readTick(content,tick++);
	}
// store the ticks
	int size = (int)(tick-1)-(int)(ticks);
	file_write(OutName,ticks,size);
#endif	

	free(ticks);
	printf("\nRead %d ticks",size/sizeof(TICK));
}


Re: Could I use Zorro to test as an EOD? [Re: jcl] #453980
08/21/15 22:17
08/21/15 22:17
Joined: Jul 2014
Posts: 2
J
jaime Offline OP
Guest
jaime  Offline OP
Guest
J

Joined: Jul 2014
Posts: 2
Thank you guys for your help. I Really appreciate it. I'll try tonight.

Re: Could I use Zorro to test as an EOD? [Re: jaime] #462182
09/13/16 09:38
09/13/16 09:38
Joined: Aug 2016
Posts: 61
D
dr_panther Offline
Junior Member
dr_panther  Offline
Junior Member
D

Joined: Aug 2016
Posts: 61
How do I get reasonable parameters in AssetFix.csv for Stocks.

This is what I use for the AAPL - Stock
Price = 100
PIP= 0.01
PIPCost = 0.01
LotAmount = 100
Commission=0.0007
Slippage=0.02
Spread=0.02;



A typical trade looks like that:
[APPL::L7603] Sell 100@111.7550: +105$ at 21:00:00
Entr 110.6152 Exit 111.7550 Spr 0.0200 Slp -0.02$ Rol 0.00$ Com 7.00$

Is there a way to provide a fixed value for commissions?
Do my parameters make sense?

Re: Could I use Zorro to test as an EOD? [Re: dr_panther] #462183
09/13/16 09:45
09/13/16 09:45
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Yes, but margin and leverage are missing. Look in the AssetsIB.csv. It has some stocks already.

Re: Could I use Zorro to test as an EOD? [Re: jcl] #462186
09/13/16 10:34
09/13/16 10:34
Joined: Aug 2016
Posts: 61
D
dr_panther Offline
Junior Member
dr_panther  Offline
Junior Member
D

Joined: Aug 2016
Posts: 61
Please help me to understand, how you "control" the Commission,
from the AssetsIB.csv:
Code:
Name,Price,Spread,RollLong,RollShort,PIP,PIPCost,MarginCost,Leverage,LotAmount,Commission,Symbol
AAPL,118.44,0.01,0,0,0.01,0.009,0,4,1,0.02,



Doesn't that mean the Commission is 2 PIPs? But with Stocks the Commisisions should be a static value, not dependent on PIPs, or am I wrong?

Eg, what happens with that configuration, if I have a penny stock and trade 10.000 of them?

Re: Could I use Zorro to test as an EOD? [Re: dr_panther] #462188
09/13/16 10:49
09/13/16 10:49
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
The commission is in account currency per contract - in that case, 2 cents per contract. For stocks this is normally a approximation, since the real commission is often more complex, dependent on the country and with a maximum and minimum per order, such as 1$. You must check the commission on the broker's website and enter a value that best fits your backtests. All parameters in the asset list are described in the manual under "Import".

If you want to get the commission accurately, enter 0 here and calculate it individually prior to every order.

Re: Could I use Zorro to test as an EOD? [Re: jcl] #462198
09/13/16 15:23
09/13/16 15:23
Joined: Aug 2016
Posts: 13
J
jack83 Offline
Newbie
jack83  Offline
Newbie
J

Joined: Aug 2016
Posts: 13
JCL/Boatman, Can you please let me know whether i can test yahoo EOD equity assets using inbuilt Z1, Z8 systems if so i would open an account with IB to trade in aussie or other emerging market brazil assets.

currently i am using zorro free version and i believe only fxcm real is allowed . thanks


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1