Forex
Google

Go Back   Forex Trading > Metatrader Training > Metatrader 4 mql 4 - Development course
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-09-2006, 05:16 AM
SteveBrown SteveBrown is offline
Member
 
Join Date: Nov 2006
Posts: 46
SteveBrown is on a distinguished road
Need help fixing this small EA

I need help getting my first Expert Advisor to work in Strategy Tester. The attached debugEA.mq4 is a short, simplified version which fails in the same manner. This version waits for a new hourly candle and the SMA8 crossing SMA24 to open and close trades. The problem is that when I run it in Strategy Tester, it opens the first trade at the appropriate time, but it does not close the trade nor open any new trades at subsequent MA crossovers. What am I doing wrong? I will be grateful to anyone who can find the problem and correct it.
Attached Files
File Type: mq4 debugEA.mq4 (1.8 KB, 19 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 11-09-2006, 06:11 AM
igorad's Avatar
igorad igorad is offline
Senior Member
 
Join Date: Oct 2005
Location: Ukraine
Posts: 788
igorad is on a distinguished road
Hi,
I've made some changes.
It works now.

Quote:
Originally Posted by SteveBrown
I need help getting my first Expert Advisor to work in Strategy Tester. The attached debugEA.mq4 is a short, simplified version which fails in the same manner. This version waits for a new hourly candle and the SMA8 crossing SMA24 to open and close trades. The problem is that when I run it in Strategy Tester, it opens the first trade at the appropriate time, but it does not close the trade nor open any new trades at subsequent MA crossovers. What am I doing wrong? I will be grateful to anyone who can find the problem and correct it.
Attached Files
File Type: mq4 debugEA_v1.mq4 (2.1 KB, 28 views)
__________________
Let's improve trade skills together
http://finance.groups.yahoo.com/group/TrendLaboratory
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 11-09-2006, 06:07 PM
SteveBrown SteveBrown is offline
Member
 
Join Date: Nov 2006
Posts: 46
SteveBrown is on a distinguished road
Thanks, igorad. God bless you.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 11-09-2006, 09:54 PM
SteveBrown SteveBrown is offline
Member
 
Join Date: Nov 2006
Posts: 46
SteveBrown is on a distinguished road
Incorporating igorad's changes, I revised the EA in order to implement the basic MA crossover strategy accurately. Although it is a losing trading strategy, this EA may serve as a good "bare bones" template on which to build Expert Advisors.
Attached Files
File Type: mq4 debugEA_v3.mq4 (1.8 KB, 19 views)

Last edited by SteveBrown : 11-11-2006 at 06:00 AM. Reason: The attached debugEA_v3.mq4 corrects a bug I found in debugEA_v2.mq4.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 12-07-2006, 10:11 PM
ivanyiag ivanyiag is offline
Junior Member
 
Join Date: Nov 2006
Posts: 1
ivanyiag is on a distinguished road
This EA also works fine with 5M timeframes as well

Probably also would work with any other timeframes, too.
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
Small EA Component help Archimedes Suggestions for Trading Systems 1 06-20-2007 10:17 AM
Fixing REIMT4 Ind. spiketrader Indicators - Metatrader 4 0 12-13-2006 04:24 AM
help fixing EA hexadecimal General Discussion 1 11-03-2006 03:00 PM


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