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
2 registered members (Quad, aliswee), 835 guests, and 5 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
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,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
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,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
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