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 (PeroPero, 1 invisible), 854 guests, and 6 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
Price export #462110
09/10/16 13:01
09/10/16 13:01
Joined: Jul 2016
Posts: 64
G
gtell Offline OP
Junior Member
gtell  Offline OP
Junior Member
G

Joined: Jul 2016
Posts: 64
Dear JCL,

comsider the following two distinct strategies which has the objective to export prices to one CSV file:

Code:
function run() {
	
	BarPeriod = 1440;
	LookBack = 0;
	StartDate = 2008;
	EndDate = 2014;	
		
	vars Open = series(priceOpen());
	vars High = series(priceHigh());
	vars Low = series(priceLow());
	vars Close = series(priceClose());
			
				
	char line[200];
	sprintf(line,
		"%1.5f, %1.5f, %1.5f, %1.5f\n",   
		Open[0], High[0], Low[0], Close[0]);		
		
	if(is(INITRUN))
		file_delete("Data\\export_price2.csv");
	else
		file_append("Data\\export_price2.csv",line);
		
}



and

Code:
function run()
{

        BarPeriod = 1440;
	LookBack = 0;
	StartDate = 2008;
	EndDate = 2014;	

	set(RULES);   
	LifeTime = 1;
	Spread = RollLong = RollShort = Commission = Slippage = 0;
	
        vars Open = series(priceOpen());
	vars High = series(priceHigh());
	vars Low = series(priceLow());
	vars Close = series(priceClose());
	
        adviseLong(SIGNALS+BALANCED, Open[0], High[0], Low[0], Close[0]); 
}



apparently the second strategy produces one CSV where the Close prise is ALWAYS lower then the Open price. Which of course does not make sense.
The first startegy looks ok.
Do you see any error in the code above?
Thanks.
Cheers.

Re: Price export [Re: gtell] #462119
09/11/16 10:03
09/11/16 10:03
Joined: Jul 2016
Posts: 64
G
gtell Offline OP
Junior Member
gtell  Offline OP
Junior Member
G

Joined: Jul 2016
Posts: 64
I have tried also with:

Code:
adviseLong(SIGNALS+BALANCED, priceOpen(0), priceHigh(0), priceLow(0), priceClose(0));



same results.

Re: Price export [Re: gtell] #462129
09/11/16 13:34
09/11/16 13:34
Joined: Aug 2016
Posts: 13
J
jack83 Offline
Newbie
jack83  Offline
Newbie
J

Joined: Aug 2016
Posts: 13
what is the difference between export bar and export codes if the .bar contains daily data. It seems export bar works without any issue but export giving wrong data in open and close price for last EOD date. i thinks its bug in code. please check below

export bar code result:
8/9/2016 0:00 579.19757 596.33832 579.19757 593.09955

9/9/2016 0:00 593.04968 593.54791 576.00861 578.5

export result:

9/8/2016 1:00 579.2 596.3 579.2 593.1
9/9/2016 1:00 579.2 596.3 579.2 593.1

Re: Price export [Re: jack83] #462142
09/11/16 21:13
09/11/16 21:13
Joined: Jul 2016
Posts: 64
G
gtell Offline OP
Junior Member
gtell  Offline OP
Junior Member
G

Joined: Jul 2016
Posts: 64
It might be a bug or something wrong in the code.
I would prefer if JCL could add his comments.
Thanks.

Re: Price export [Re: gtell] #462146
09/12/16 06:30
09/12/16 06:30
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Your first code is ok, but the second not. adviseLong is not for exporting prices. Also, BALANCE is wrong here and the objective parameter is missing.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1