Forex
Google

Go Back   Forex Trading > Downloads > Tools and utilities
Forex Forum FAQ Members List Calendar 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

 
 
LinkBack (4) Thread Tools
 
Old 04-26-2008, 02:40 PM
Carlo Carlo is offline
Junior Member
 
Join Date: Apr 2006
Posts: 24
Carlo is on a distinguished road
Quote:
Originally Posted by Linuxser View Post
Don磘 you mind to attach the EA to see the code and if we can reproduce the error.

If you can磘 attach the code look for some quote in the code like the following and post it.

or some line ending with DLL like abcd.dll

Have you checked the name of the dll inside the indicator it`s exactly the same as the dll name?
How could I see the source code of the EA ? thanks
Carlo
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 05-15-2008, 08:59 AM
ingvar_e ingvar_e is offline
Junior Member
 
Join Date: Dec 2007
Location: Outside Stockholm
Posts: 19
ingvar_e is on a distinguished road
File replacement

I want to test an EA that makes use of external signals in the Strategy Tester and the thread states that the native filehandling does not work in the strategy tester. So I have tried to use the dll supplied in this thread. The input I want to process is in a file looking like this:

2007-01-02;EURUSD;2.InstPipDown;;Yes
2007-01-02;USDJPY;1.InstPipUp;;Yes
2007-01-02;USDCHF;1.InstPipUp;;Yes
2007-01-03;EURUSD;2.InstPipDown;;Yes
2007-01-03;EURUSD;4.PipMax1Down;;Yes
2007-01-03;GBPUSD;4.PipMax1Down;;Yes
2007-01-04;USDJPY;8.PipRevBear;;Yes
2007-01-05;EURUSD;5.PipMax2Up;;Yes
2007-01-05;USDJPY;1.InstPipUp;;Yes

I do create the file myself so I can use other types of delimiters.

How do I use the dll to get one "record" at the time? I can do the parsing for the individual fields.
How do I know when I have reached EOF?

I have tried a few variations but I get inconsistent results and sometimes garbage. Writing data as in the example works fine but I want to read data.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 05-15-2008, 04:51 PM
ingvar_e ingvar_e is offline
Junior Member
 
Join Date: Dec 2007
Location: Outside Stockholm
Posts: 19
ingvar_e is on a distinguished road
Well, perserverance rules!

After several hours I found out this:

The file handler refuses to open a file I have created with another program. Open returns -1. If I use the file that was created by the demo (mt4.log) and copies my content into it open works. Cant figure out why. Strange

I made my "records" fixed length and read the length of the "record" plus 2 to accomodate for "CRLF" at the end of each record. I got the length of the file, divided by the record length and looped to get all my records into an array:

Here is the code:

int init()
{

string inArr[500];
int file;
int filesize;
int records;
int i;

file = gFileOpen("c:\mt4.log",READ);
// Print(file);
filesize = gFileSize(file);
// Print(filesize);
records = filesize/25;
// Print(records);

for(i=1;i<=records;i++)
{
inArr[i-1] = gFileRead(file,25);
}

gFileClose(file);

Print(inArr[filesize-1]); //Check the last one

return(0);
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 05-17-2008, 05:08 PM
PriNova PriNova is offline
Member
 
Join Date: Jan 2008
Posts: 40
PriNova is on a distinguished road
indicator with fileoutput

hello traders and programmers.

i need help with a codesegemnt for a new indicator.

the indicator should be able to write a file with relevant information, but it should only write after open a new candle. not every tick.

how could this be done? what i try to do is, on every new candle write OHCL of the last 1000 bars to train a PNN. this should be done outside with RAPID-I.
and with some other informations to learn what the probability the close of a candle could be.

please help. would be a great project, but so simple things i'm to stupid (or lazy) to do :-)

PriNova
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 05-17-2008, 05:27 PM
elitecamper's Avatar
elitecamper elitecamper is offline
Senior Member
 
Join Date: May 2007
Posts: 132
elitecamper is on a distinguished road
datetime timeprev=0; before init()

and

if(timeprev==Time[0])
return(0);
timeprev=Time[0]; right underneath start()

and thats it.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 05-17-2008, 05:32 PM
PriNova PriNova is offline
Member
 
Join Date: Jan 2008
Posts: 40
PriNova is on a distinguished road
nice this was very fast reply.

thank you elitecamper
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old Today, 07:19 AM
johnmcglaughlin johnmcglaughlin is offline
Junior Member
 
Join Date: Dec 2006
Posts: 2
johnmcglaughlin is on a distinguished road
Why was the move function removed from the library

CodersGuru,

I can not tell you how valuable you are to me, You deserve much of the praise I receive from my clients, since without you I would not be able to do my job in support of them.

Is there a reason that the Move function was not implemented as is referenced in your tutorial.

Thanks Very Much Again four your service
John McGlaughlin
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 

Thread Tools

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

LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/tools-utilities/386-mt4-files-functions-replacement.html
Posted By For Type Date
File functions - Part 1 This thread Refback 03-05-2008 01:29 PM
MT4编程学习教程! - MT4系统交易 - 外汇牛人邦 飞狐免费外汇行情接收!飞狐外汇接口! - Powered by Discuz! This thread Refback 01-11-2008 05:45 PM
Mql - Metatrader Development Course This thread Refback 07-19-2007 02:50 AM
File functions - Part 1 | www.metatrader.info This thread Refback 06-21-2007 06:21 PM

Similar Threads
Thread Thread Starter Forum Replies Last Post
File Functions intelligent_14 Questions 6 07-11-2006 08:37 PM
Unusual Functions intelligent_14 Questions 3 06-23-2006 11:20 PM
Appendix 2 - Trading functions codersguru Lessons 8 12-26-2005 01:46 PM
Lesson 7 - Functions codersguru Lessons 2 11-02-2005 03:32 PM


All times are GMT. The time now is 10:37 AM.