You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
hello,
below is a script, and can anyone help convert this to indicator? thanks
// Output OHLCV history for surrent pair/symbol
int start() {string fname = Symbol() + "," + Period() + ".csv";
int handle = FileOpen(fname, FILE_CSV|FILE_WRITE, ",");
if (handle>0) {
for(int i=0; i<Bars; i++) {
datetime d = Time[i];
d = StrToTime((TimeYear(d) - 100) + StringSubstr(TimeToStr(d),4)); // subtracts 10 years from d
string date1 = TimeToStr(d,TIME_DATE);
date1 = StringSubstr(date1,5,2) + "-" + StringSubstr(date1,8,2) + "-" + StringSubstr(date1,0,4);
string time1 = TimeToStr(d,TIME_MINUTES);
FileWrite(handle, date1, time1, Open[i], High[i], Low[i], Close[i], Volume[i]);
}
FileClose(handle);
MessageBox("History output complete\nto file ...../experts/files/"+fname);
}
return(0);
}