Can we use FileWrite for backtest?

To add comments, please log in or register
Do Hung
149
Do Hung  

I have EA as follow that use FileWrite to record indicator information for BACKTEST.

This EA works in real-time trading but NOT for backtest.

I wander, does FileWrite works for backtest. If Yes, what am I wrong?


Thank your all,


//===================================================

void DataRecord()
{
int handle=FileOpen("MyData.csv", FILE_CSV|FILE_READ|FILE_WRITE, ';');

if(handle>0)
{
int ADX_1 = iADX(NULL,0,14,PRICE_CLOSE,MODE_MAIN,1);
int ADX_5 = iADX(NULL,0,14,PRICE_CLOSE,MODE_MAIN,5);
int ADX_15 = iADX(NULL,0,14,PRICE_CLOSE,MODE_MAIN,15);

int RSI_1 = iRSI(NULL, 0, 14, PRICE_CLOSE, 1);
int RSI_5 = iRSI(NULL, 0, 14, PRICE_CLOSE, 5);
int RSI_15 = iRSI(NULL, 0, 14, PRICE_CLOSE, 15);


FileSeek(handle, 0, SEEK_END);
FileWrite(handle, Symbol(),ADX_1,ADX_5,ADX_15,RSI_1,RSI_5,RSI_15);
FileClose(handle);
handle=0;
}
}

Brian Dee - Random Trader
1759
Brian Dee - Random Trader  

D

It does work, the only diference is the output file appears in the \tester\files\ folder instead of \expert\files\

Good Luck

-BB-

Do Hung
149
Do Hung  

OH MY GOD !!!!!


Thank you very much!!!!

douglas14
18
douglas14  
My tester folder does not have a files folder; where it might be? I have the same question of Do Hung
William Roeder
22403
William Roeder  
Either you didn't run your code in the tester, or you're not looking in the correct place.
          Data Structure in MetaTrader 4 Build 600 and Higher - MQL4 Articles 2014.02.03
To add comments, please log in or register