Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Export selected asset history to CSV
- function run()
- {
- History=".t1";
- set(TICKS);
- BarPeriod = 0.1/60;
- LookBack = 0;
- StartDate = 20080101;
- EndDate = 20080201;
- asset("NZDUSDs");
- string Format = ifelse(assetType(Asset) == FOREX,
- "\n%04i-%02i-%02i %02i:%02i:%.3f, %.5f",
- "\n%04i-%02i-%02i %02i:%02i,%.3f %.1f");
- char FileName[40];
- sprintf(FileName,"History\\%s.csv",strx(Asset,"/","")); // remove slash from forex pairs
- if(is(INITRUN))
- file_write(FileName,"Date,Price",0);
- else
- file_append(FileName,strf(Format,
- year(),month(),day(),hour(),minute(),second(),
- price()));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement