Forex



Go Back   Forex Trading > Programming > MetaTrader
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 07-18-2009, 11:59 PM
Sadly's Avatar
Senior Member
 
Join Date: Nov 2006
Posts: 288
Sadly is on a distinguished road
EA HELL - When it just doesn't work!

OK - I should know better than to get involved with programming what with the extremely limited knowledge I have of MQL but rather than constantly nag others to please do this or that to an EA I thought I'd give it a whirl myself. It's taken me over a month of weekends to get to grips with it and what I have to show for it I've attached to the post. The trouble with it is that it's not doing what I thought I'd told it to do and I'm now stuck banging my head against the wall.

The EA is a very basic MA cross over (big yawn, I know) that is supposed reverse position after a cross over and only when the bar has completed and has closed. Instead of this I'm seeing orders being made in random places! So what the heck am I doing wrong here?
Attached Files
File Type: mq4 DEA testing v0.1.mq4 (4.3 KB, 9 views)

Last edited by Sadly; 07-19-2009 at 02: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
  #2 (permalink)  
Old 07-19-2009, 12:55 AM
Junior Member
 
Join Date: Apr 2009
Posts: 9
papatrade is on a distinguished road
I just gave it a quick test and it looked ok on the EURUSD 1H time frame. Can you post a screenshot of what you are seeing.

I have attached my chart from 6th July - 10th July on 1H EURUSD, just as a little example of what I see.
Attached Images
File Type: jpg screenshot.JPG (90.0 KB, 106 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
  #3 (permalink)  
Old 07-19-2009, 01:14 AM
Sadly's Avatar
Senior Member
 
Join Date: Nov 2006
Posts: 288
Sadly is on a distinguished road
The close of the bar which triggered the long trade was 1.39802. I have a slippage variable currently set = 1. According to the journal, the order was priced at 1.39852. The following short order then appears to have been placed at 1.39734 yet the close of the bar was 1.39717. both long and short orders don't seem to be priced correctly as I would have thought that the long order would have been met at ask+slippage and the short order at bid-slippage.
Attached Images
File Type: png DEA random pos.png (16.0 KB, 107 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
  #4 (permalink)  
Old 07-19-2009, 02:23 PM
Sadly's Avatar
Senior Member
 
Join Date: Nov 2006
Posts: 288
Sadly is on a distinguished road
updated program code by removing extraneous variables

I've updated the MQL code in post #1 and added commentary. Primarily the idea of this EA is to practice MQL coding skills in order to move on from hacking the code of others. Throughout the code I've used separate functions that control the orders so that it's a simple matter of calling the routine when a order needs to be executed. The program code uses variable names which aptly reflect their use. When the code is fixed and working properly, I hope that it will provide a basic EA template for everyone to use, enjoy and hopefully understand.
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
Work with me. FXBabe Expert Advisors - Metatrader 4 32 05-16-2008 02:39 PM
What the HELL with jpy!!!!! Libram Non Related Discussions 0 08-16-2007 01:34 PM
Help me!!!! Why this EA doesn't work???? metastock Expert Advisors - Metatrader 4 3 02-17-2007 06:31 AM
What the hell is this elihayun Metatrader 4 10 08-22-2006 02:04 PM
How does this really work? Ayo Questions 0 12-19-2005 03:30 PM


All times are GMT. The time now is 02:58 AM.



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