I am trying to write test results to a file but cannot see error message and file is not created, the file gets created on my local machine but not on server and logs, alerts, etc do not show on either. I have full optimization logs checked.
- writing to file
- OnTester() not writing the output to file.
- Cannot write to file
laclance:
I am trying to write test results to a file but cannot see error message and file is not created, the file gets created on my local machine but not on server and logs, alerts, etc do not show on either. I have full optimization logs checked.
I am trying to write test results to a file but cannot see error message and file is not created, the file gets created on my local machine but not on server and logs, alerts, etc do not show on either. I have full optimization logs checked.
You need a FileClose() statement - try this:
FileWrite(handle, "profit", TesterStatistis(STAT_PROFIT)); FileClose(handle); return TesterStatistics(STAT_PROFIT);
laclance #:
thank you sorry but i do have a FileClose() statement already but is there no way to see the error? Print, Alert, Commment and MessageBox do not work in the OnTester function.
I don't use the OnTester function so cannot say - I suggest you write the code into a script (using OnTick or Onstart) and make it work in isolation, and then you can put it back into your main code base.
But equally why call the FileClose() in another place? Close the file immediately before the return()- re-open later if you need to.

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