Forex
Google

Go Back   Forex Trading > Metatrader Training > Metatrader 4 mql 4 - Development course > Questions
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 Thread Tools
 
Old 11-11-2005, 12:06 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
Cool Writing stratergy tester results to file

Hi

I want to record my stratergy tester to a file. I want to record all its bids and asks and how it sees my indicators. Then I want to read that into an C# (from sharp development http://www.icsharpcode.net/OpenSource/SD/) program and really debug my EA. I am suffering with the first step - writing the file. I am trying the following to no avail.
Any suggestions?
Attached Files
File Type: mq4 pricecheck1.mq4 (4.0 KB, 50 views)

Last edited by cardio : 11-11-2005 at 12:10 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 11-11-2005, 02:20 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
Thumbs up Good Idea!

Quote:
Originally Posted by cardio
Hi

I want to record my stratergy tester to a file. I want to record all its bids and asks and how it sees my indicators. Then I want to read that into an C# (from sharp development http://www.icsharpcode.net/OpenSource/SD/) program and really debug my EA. I am suffering with the first step - writing the file. I am trying the following to no avail.
Any suggestions?
Hi cardio,

It's a good idea.
Let me check the code and return to you with my comment(s).
__________________
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!
 
Old 11-11-2005, 03:46 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
Post

Quote:
Originally Posted by cardio
Hi
I am trying the following to no avail.
Any suggestions?
Working good after adding this line of code before FileWrite function:

Quote:
int handle;
calculateIndicators();
handle=FileOpen("eurud_1min.csv", FILE_CSV|FILE_WRITE|FILE_READ, ";");
if(handle>0)
{
// write data
FileSeek(handle,0,SEEK_END);
FileWrite(handle, Bid, Ask, Point, isBuying, isSelling);
FileClose(handle);

}
What's your next step?
__________________
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!
 
Old 11-11-2005, 04:53 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
Thumbs up Next Step

Thanks a million
I will test it during lunch. Now I intend to write a C# program that has a modified version of the EA I am working on – the program will see the EA as a function that returns buy or sell and will write up anther array keeping track of trades. The program will first read the stratergy tester results into an array and then loop through the array, at each row sending the data to the function. Then I will be able to debug the EA and see where it is going wrong.

The EA of course is

http://www.forex-tsd.com/showthread.php?p=1698#post1698

But I intend to redo this procedure for many other EA – to get a method to successfully debug and test complex logic on them.

Last edited by cardio : 11-11-2005 at 06:42 PM. Reason: Won't create 2 arrays, only one
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 11-11-2005, 04:58 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
Thumbs up Keep going!

Quote:
Originally Posted by cardio
Thanks a million
I will test it during lunch. Now I intend to write a C# program that has a modified version of the EA I am working on – the program will see the EA as a function that returns buy or sell and will write up 2 other arrays one for buys and one for sells. Then I will be able to debug the EA and see where it is going wrong.

The EA of course is

http://www.forex-tsd.com/showthread.php?p=1698#post1698

But I intend to redo this procedure for many other EA – to get a method to successfully debug and test complex logic on them.
GREAT KEEP GOING and tell me your progress.
Don't hesitate for asking me for help.
__________________
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!
 
Old 11-12-2005, 10:37 AM
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
Cool Easier way to obtain history

Hi
The code did not work in the stratergy tester, but I found a great place to get history data
http://www.metaquotes.net/forum/1278/

The second article is particulary interesting. - Anyhow I have what I wanted to start - now on to the code.

Got the data for 2004 - though it is only the last 6 months of 2004.

Then got it into a c# array by following steps at
http://www.c-sharpcorner.com/databas...ctODBCText.asp

Actually the last link goes directly from csv file to datatable which is even better, works for ado.net,c#,vb.net.

Still programming

Cheers

Last edited by cardio : 11-13-2005 at 12:55 PM. Reason: wanted to highlight csv to datatable works for ado.net,c#,vb.net
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 11-12-2005, 01:37 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
Gona work on Monday!

Quote:
Originally Posted by cardio
Hi
The code did not work in the stratergy tester, but I found a great place to get history data
http://www.metaquotes.net/forum/1278/

The second article is particulary interesting. - Anyhow I have what I wanted to start - now on to the code.

Got the data for 2004 - though it is only the last 6 months of 2004.

Then got it into array by following steps at
http://www.c-sharpcorner.com/databas...ctODBCText.asp

Still programming

Cheers
Hi cardio,

Thanks!

The code worked for me Thursday.
The FileOpen function does not work Saturdays, did you forget?
FileOpen problem...
Attached Files
File Type: zip eurud_1min.zip (748 Bytes, 42 views)
__________________
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!
 
Old 11-12-2005, 02:36 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
That is what I need

Geez

You make it look to easy. Thanks for all the encouragement - man I need it. I unistalled IBFX as their file functions don't work on weekends - and installed stratergybuilderfx's MT4 - now the pricecheck1.mq4 runs in stratergy tester - but I don't get a file - in experts\files - if I create a blank file experts\files\eurud_1min.csv - it still doesn't touch the file.

Can stratergy tester write out files?
I beleve if you add the pricecheck to a chart and let it run - then it will get data. But can it data through the tester?

I must be missing something.

Please help

Last edited by cardio : 11-12-2005 at 02:45 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 11-13-2005, 07: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 Strategy tester writes out to files.

Quote:
Originally Posted by cardio
Geez
Can stratergy tester write out files?
I beleve if you add the pricecheck to a chart and let it run - then it will get data. But can it data through the tester?

I must be missing something.

Please help
cardio,

Yes, strategy tester writes out to files (the eurud_1min.csv file I sent produced in strategy tester).
But the File functions don't work in weekends for me (I'm using InterbankFX server)
__________________
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!
 
Old 11-13-2005, 01:00 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
Thanks again

Thanks -

I will try it on Monday, because the file functions must also not work on Stratergybuilderfx on the weekend.
Otherwise just getting things going in C# - this free IDE is very cool.

Cheers

Actually the IDE is not so cool, I uninstalled it and did the 400mb download of c# express. And will now try that.

I got another answere from metaquotes when I asked them if file functions work in startergy tester, they answered

'file functions work. but in case of testing all the processed files must be placed in the tester\files directory'

Cheers
Stephen

Last edited by cardio : 11-14-2005 at 11:53 AM. Reason: IDE not so cool
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Writing indicator value into external file pawelsz Indicators - Metatrader 4 5 02-09-2007 03:01 AM
Help with writing your own strategies hitman22 Metatrader 4 2 03-15-2006 10:22 AM


All times are GMT. The time now is 05:59 AM.