• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 10:06pm
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 10:06pm
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

How can EA output results from strategy tester? (MQL4) 0 replies

Strategy Tester - multi-timeframe moving averages not working 3 replies

Simple Expert Adviser with filewrite operation 4 replies

2009.03.11 15:41:15Tester memory handler: tester stopped because not enough memory 19 replies

iADX not working in Strategy Tester 5 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
  • 1
Attachments: MQL4 - FileWrite not working in strategy tester
Exit Attachments

MQL4 - FileWrite not working in strategy tester

  • Post #1
  • Quote
  • First Post: Dec 11, 2015 5:37am Dec 11, 2015 5:37am
  •  Phil2015
  • | Joined Feb 2015 | Status: Worst Trader Ever! | 89 Posts
Hi.

Looking for a bit of help with some code.

Like the title says, I can't get FileWrite to work within strategy tester. The code works just fine in an EA attached to a chart and outputs as expected but run the same EA in a strategy test and.....nothing....no file even created in the MQL4\Files folder.

It is very basic code, simply open file, output and close file.

Inserted Code
 
int init()
{
int fh = FileOpen("file.txt", FILE_CSV|FILE_WRITE);
Print(fh); //(prints  "1" to journal indicating successful file open, but no file created in "MQL4\Files"
FileWrite(fh,"value1", "value2"); 
FileFlush(fh);
FileClose(fh);
return(fh);
}

Can anyone tell me what is wrong? Is the file created somewhere else?
  • Post #2
  • Quote
  • Dec 11, 2015 5:41am Dec 11, 2015 5:41am
  •  Gumrai
  • Joined Oct 2012 | Status: Member | 1,959 Posts
Look in the "Tester" folder
Please Do Not PM Me With Coding Enquiries
 
1
  • Post #3
  • Quote
  • Last Post: Dec 11, 2015 5:51am Dec 11, 2015 5:51am
  •  Phil2015
  • | Joined Feb 2015 | Status: Worst Trader Ever! | 89 Posts
Quote
Disliked
"Look in the "Tester" folder"

Oh obviously, in a completely different place!

Found it! Thanks for the tip, I can get on with what I was doing now.
Attached Image (click to enlarge)
Click to Enlarge

Name: angry-desk-flip.jpeg
Size: 81 KB
 
 
  • Platform Tech
  • /
  • MQL4 - FileWrite not working in strategy tester
  • Reply to Thread
0 traders viewing now
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2022