Forex



Go Back   Forex Trading > Training > Metatrader > Metatrader 4 mql 4 - Development course > Questions
Forex Forum Register More recent Calendar Advertising Others Help






Register
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.

From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.

Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
  • Elite Section
    Get access to private discussions, specialized support, indicators and trading systems reported every week.
  • Advanced Elite Section
    For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 11-11-2005, 01:06 PM
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, 51 views)

Last edited by cardio; 11-11-2005 at 01:10 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #2 (permalink)  
Old 11-11-2005, 03:20 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 994
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #3 (permalink)  
Old 11-11-2005, 04:46 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 994
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #4 (permalink)  
Old 11-11-2005, 05:53 PM
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/expert-advisors-metatrader-4/18-daytrading-2-a-post1698.html#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 07:42 PM. Reason: Won't create 2 arrays, only one
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #5 (permalink)  
Old 11-11-2005, 05:58 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 994
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #6 (permalink)  
Old 11-12-2005, 11:37 AM
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 01: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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #7 (permalink)  
Old 11-12-2005, 02:37 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 994
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?
http://www.forex-tsd.com/showpost.ph...38&postcount=3
Attached Files
File Type: zip eurud_1min.zip (748 Bytes, 43 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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #8 (permalink)  
Old 11-12-2005, 03:36 PM
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 03:45 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #9 (permalink)  
Old 11-13-2005, 08:39 AM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 994
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #10 (permalink)  
Old 11-13-2005, 02:00 PM
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 12:53 PM. Reason: IDE not so cool
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
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 04:01 AM
Help with writing your own strategies hitman22 Metatrader 4 2 03-15-2006 11:22 AM


All times are GMT. The time now is 05:49 PM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.