Problem writing to a file

 
Good evening, I am trying to run my program to write to an "up" file as soon as my indicators show me an increase, but when I run the strategy tester nothing happens, do you know how I can fix this problem please?

Here is my program:

extern int i =0;

void OnTick()

 {

   int ExternalFile=FileOpen("Signal.txt",FILE_READ|FILE_WRITE|FILE_TXT,';');

      if (iMA(NULL,0,10,MODE_EMA,PRICE_OPEN,i)>iMA(NULL,0,11,MODE_EMA,PRICE_OPEN,i));

         {

             FileWrite(ExternalFile, "Up");

         }

 }


I thank you in advance for your answers!
 
Hugo Tram: Good evening, I am trying to run my program to write to an "up" file as soon as my indicators show me an increase, but when I run the strategy tester nothing happens, do you know how I can fix this problem please? Here is my program: I thank you in advance for your answers!
In the Strategy Tester, files are written to a different location under the "???\tester\files" directory and not the "???\MQL4\Files" directory.
 
Good evening, I apologise for my late reply... Yes, by looking in the right file, I can indeed find my file, thank you very much!
 
  1. Where do you close the file?
  2. Why do you open the file if you won't write to it?