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
2 registered members (SBGuy, Quad), 768 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
Export Script #442764
07/02/14 06:15
07/02/14 06:15
Joined: Jan 2014
Posts: 41
K
killerkhan Offline OP
Newbie
killerkhan  Offline OP
Newbie
K

Joined: Jan 2014
Posts: 41
Hello everyone, trying to see if anyone can help me with some coding. I am using the download script from the manual

http://www.zorro-trader.com/manual/en/export.htm

Code:
function run()
{
  BarPeriod = 1440;
  StartDate = 2008;
  EndDate = 2012;
  LookBack = 0;

  char line[100];
  sprintf(line,
    "%02i/%02i/%02i %02i:%02i, %.5f, %.5f, %.5f, %.5f\n",
    day(),month(),year()%100,hour(),minute(),
    priceOpen(),priceHigh(),priceLow(),priceClose());
  if(is(INITRUN))
    file_delete("Data\\export.csv");
  else
    file_append("Data\\export.csv",line);
}



this code exports the data as follows...

Date Time, Open, High, Low, Close

and saves the file as export.csv

here is what I want to do.
export the data so there is a comma between the Date and Time and also if possible to export the Volume as well. so end data will look like

Date, Time, Open, High, Low, Close, Volume

and want to save the file as the Symbol and BarPeriod used for export. For Example, if symbol is EUR/USD and BarPeriod is 60 I want the exported file to be called EURUSD_60.csv

is that possible? thanks in advance

KK

Re: Export Script [Re: killerkhan] #442766
07/02/14 06:44
07/02/14 06:44
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Forex has no volume. But for the comma, just replace the first blank in the format string with a comma.

The file name can be generated from the asset name and bar period in a very similar way, with sprintf, like this

sprintf(...,"%s_%i.csv",Asset,BarPeriod);

"%s" in a format string inserts a string.

Re: Export Script [Re: jcl] #444639
08/16/14 04:41
08/16/14 04:41
Joined: Jan 2014
Posts: 41
K
killerkhan Offline OP
Newbie
killerkhan  Offline OP
Newbie
K

Joined: Jan 2014
Posts: 41
jcl, how often do I have to update the Assets.dat and AssetsFix.dta files? once a day? once a week? once a month? thanks,

kk

Re: Export Script [Re: killerkhan] #444787
08/18/14 18:01
08/18/14 18:01
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
That is up to you - we do update them about every two months, on any new release.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1