|
|||||||
| 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 |
|
|
|||
|
|||
|
Quote:
Carlo |
|
|
|||
|
|||
|
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. |
|
|
|||
|
|||
|
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); } |
|
|
|||
|
|||
|
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 |
|
|
|||
|
|||
|
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 |
| Thread Tools | |
|
|
|
|
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 |