Forex



Go Back   Forex Trading > Training > Metatrader > Metatrader 4 mql 4 - Development course
Forex Forum Register More recent Blogs 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-09-2006, 06:16 AM
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!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-09-2006, 07:11 AM
igorad's Avatar
Senior Member
 
Join Date: Oct 2005
Location: Ukraine
Posts: 963
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, 29 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!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-09-2006, 07:07 PM
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!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-09-2006, 10:54 PM
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, 20 views)

Last edited by SteveBrown; 11-11-2006 at 07: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!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 12-07-2006, 11:11 PM
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!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
Small EA Component help Archimedes Suggestions for Trading Systems 1 06-20-2007 11:17 AM
Fixing REIMT4 Ind. spiketrader Indicators - Metatrader 4 0 12-13-2006 05:24 AM
help fixing EA hexadecimal General Discussion 1 11-03-2006 04:00 PM


All times are GMT. The time now is 11:09 PM.



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