Hi, could anyone tell me if it's possible to export RSI data to a CSV file, just like exporting the historical price data? Many thanks in advance!
Export indicator objects or its calculations to a CSV file 2 replies
Export mt4 data to different columns of a .csv file 1 reply
Getting indicator data to .csv file 4 replies
Importing data from CSV file 0 replies
#property show_inputs
extern int RSI_Period = 10;
int start() {
// open file
int iFile = FileOpen("RSI_Dump.csv",FILE_WRITE|FILE_CSV,",");
if(iFile == -1) {
Print("Unable to create file.");
return(0);
}
// iterate bars
for(int i=Bars-RSI_Period-1;i>=0;i--) {
string sTime = TimeToStr(Time[i],TIME_DATE|TIME_SECONDS);
double dRsi = iRSI(NULL,0,RSI_Period,PRICE_CLOSE,i);
FileWrite(iFile,sTime,dRsi);
}
// close file
FileFlush(iFile);
FileClose(iFile);
Print("Done.");
}