MQL4 FileWrite not working on live chart

 

Hello!
I created a EA that sends values to a CSV file, everything worked well in the Strategy Test mode but won't do anything when applied to a live chart. Is there anyone that knows what I did wrong?

I appreciate any kind of help, thank you!
Source code inserted below:

void OnTick()
  {

static double LastHigh;
static double LastLow;

//if prces for candle 1 have changed
if ((LastHigh!=High[1]) && (LastLow!=Low[1]))
{
//create file name
string mySpreadsheetTUT="SpreadsheetTUT.csv";

//open the file for reading and writing, as CSV format
int mySpreadsheetHandleTUT= FileOpen(mySpreadsheetTUT,FILE_READ|FILE_WRITE|FILE_CSV|FILE_ANSI);

// go to the end of the file
FileSeek(mySpreadsheetHandleTUT, 0, SEEK_END);


//Append time, high and low to the file content
FileWrite(mySpreadsheetHandleTUT,"Time Stamp",Time[1],"High",High[1],"Low",Low[1]);
 
     
                                
                                
// Close the file
FileClose(mySpreadsheetHandleTUT);

// Assign the current value for the next time
LastHigh=High[1];

}

//Create chart Output
Comment (
"Last High: ", High[1]
);


  }
//+------------------------------------------------------------------+
 
  1. Streezey211: Is there anyone that knows what I did wrong?
    Why did you post your MT4 question in the MT5 General section instead of the MQL4 section, (bottom of the Root page)?
              General rules and best pratices of the Forum. - General - MQL5 programming forum? (2017)
    Next time, post in the correct place. The moderators will likely move this thread there soon.

  2. Streezey211: everything worked well in the Strategy Test mode but won't do anything when applied to a live chart. 
    Are you looking in the correct place? Live, the file is in «DataFolder»\MQL4\Files, not in «DataFolder»\MQL4\tester\Files.
              Data Structure in MetaTrader 4 Build 600 and Higher - MQL4 Articles (2014)

 
William Roeder #:
  1. Why did you post your MT4 question in the MT5 General section instead of the MQL4 section, (bottom of the Root page)?
              General rules and best pratices of the Forum. - General - MQL5 programming forum? (2017)
    Next time, post in the correct place. The moderators will likely move this thread there soon.

  2. Are you looking in the correct place? Live, the file is in «DataFolder»\MQL4\Files, not in «DataFolder»\MQL4\tester\Files.
              Data Structure in MetaTrader 4 Build 600 and Higher - MQL4 Articles (2014)



1. I just clicked on "Add new Topic" I will make sure to change that next time, thank you.
2. I have checked and seen that file now, and I am very grateful, thank you very much!
Reason: