Forex
Google

Go Back   Forex Trading > Metatrader Training > Metatrader 4 mql 4 - Development course > Questions
Forex Forum Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


Register in Forex TSD!
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time).
Click here to register and get more information

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-03-2005, 05:47 PM
twinsen twinsen is offline
Junior Member
 
Join Date: Oct 2005
Posts: 10
twinsen is on a distinguished road
FileOpen problem...

I testing a EA an i have in source FileOpen function.

Then this EA run in terminal it can write in file.

Then i run it in Startegy Tester, the EA don't write anything.

Can you help me ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 11-04-2005, 05:26 PM
codersguru's Avatar
codersguru codersguru is offline
Senior Member
 
Join Date: Oct 2005
Posts: 987
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
FileOpen doesn't work in Strategy tester!

Quote:
Originally Posted by twinsen
I testing a EA an i have in source FileOpen function.

Then this EA run in terminal it can write in file.

Then i run it in Startegy Tester, the EA don't write anything.

Can you help me ?
Hi twinsen,

I’ve tried the FileOpen function in both of Terminal client and in the strategy tester.
It seems not working in the strategy tester (there are some other functions -like Alert ()- don't work there too).

I'll try the Windows file-handling APIs and I'll tell you the result.
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 11-05-2005, 07:01 PM
cardio cardio is offline
Senior Member
 
Join Date: Sep 2005
Location: St Louis, MO, USA
Posts: 176
cardio is an unknown quantity at this point
FileOpen does not work on the weekend either

Hi

I was trying out file functions during the week and they worked fine - then I sat down Saturday to try some file functions - and nothing works. I figure it is because the 'int start()' function is only called on a new trade - so with no trading - there is nothing to kick of the program. Or am I totally confused?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 11-06-2005, 12:39 AM
codersguru's Avatar
codersguru codersguru is offline
Senior Member
 
Join Date: Oct 2005
Posts: 987
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Arrow int start works in Saturdays.

Quote:
Originally Posted by cardio
Hi

I was trying out file functions during the week and they worked fine - then I sat down Saturday to try some file functions - and nothing works. I figure it is because the 'int start()' function is only called on a new trade - so with no trading - there is nothing to kick of the program. Or am I totally confused?
Hi cardio,

int start() does not work only when receiving new quotations (which is disabled at Saturdays) but it works too when you attach your EA or CI to the chart, when you change the charts periodicity, when you refresh the chart and a lot of other cases.

To be sure of what am I saying, try this code where OpenFile and int start have worked with me in Saturday:

int start()
{

Alert("I'm working even in Saturdays!"); //are you working in Saturdays?

int handle;
handle=FileOpen("test.txt",FILE_BIN|FILE_WRITE);
if(handle<1) //there's an error opening the file
{
Alert(ErrorDescription( GetLastError()));
}
else
{
Alert("file has been opened");
FileWrite(handle,"hi");
FileClose(handle);
}
}

So I think there's something wrong with those functions.
Do you have any code to test?
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 11-06-2005, 12:10 PM
cardio cardio is offline
Senior Member
 
Join Date: Sep 2005
Location: St Louis, MO, USA
Posts: 176
cardio is an unknown quantity at this point
something must be wrong with interbankfx on the weekend

Hi - first off thanks for all the great lessons, I will post some comments on them now.

I tried your code, during the weekend and did not even get your first alert - saying "I'm working even in Saturdays!". So interbankfx must shut down their system over the weekend.

When I tried it when interbankfx market was open your code worked - so that proves it.

Last edited by cardio : 11-07-2005 at 01:20 AM. Reason: spelling and grammer
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 11-14-2005, 04:01 PM
codersguru's Avatar
codersguru codersguru is offline
Senior Member
 
Join Date: Oct 2005
Posts: 987
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Cool MetaTrader 4\tester\files

Quote:
Originally Posted by twinsen
I testing a EA an i have in source FileOpen function.

Then this EA run in terminal it can write in file.

Then i run it in Startegy Tester, the EA don't write anything.

Can you help me ?
Finally Metaquotes has revealed the secret , Please find the file in MetaTrader 4\tester\files Directory.
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 11-20-2005, 11:53 PM
codersguru's Avatar
codersguru codersguru is offline
Senior Member
 
Join Date: Oct 2005
Posts: 987
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Talking Files handling replacement DLL

I created a Files handling replacement DLL - built with Visual C++.

MT4 Files Functions Replacement.
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
MQL4 FileOpen function owkenobi Metatrader 4 9 03-18-2008 02:17 PM
programming problem...! gigiyoffee Metatrader 4 2 05-01-2007 06:36 PM
Problem with .ex4................. EFX General Discussion 4 10-21-2006 07:23 AM
My First EA problem demag Questions 4 02-10-2006 08:18 AM
I've a Problem here hellkas Metatrader 4 6 11-04-2005 12:30 AM


All times are GMT. The time now is 08:17 AM.