Forex Forums | ForexLasers.com


Go Back   Forex Lasers Forum > METATRADER FORUM > Expert Advisors / Robots


Help To Fix an Expert Advisor

Expert Advisors / Robots


Reply
 
LinkBack Thread Tools Search this Thread
  #1  
Old 07-04-2009, 23:16
Level II Lasers Member
 
Join Date: Mar 2009
Posts: 31
Default Help To Fix an Expert Advisor

I have an Expert Advisor that I feel has potential but can't get it to close a trade on a signal in the opposite direction. I was in on a sell when a buy was suppose to execute and didn't. A buy should have opened and close the sell on the next candle. Could someone please look.

Thanks in advance.
cwave:mad:
Reply With Quote
  #2  
Old 08-04-2009, 07:13
Level II Lasers Member
 
Join Date: Feb 2009
Posts: 27
Default

Quote:
Originally Posted by cwave View Post
I have an Expert Advisor that I feel has potential but can't get it to close a trade on a signal in the opposite direction. I was in on a sell when a buy was suppose to execute and didn't. A buy should have opened and close the sell on the next candle. Could someone please look.

Thanks in advance.
cwave:mad:
You'll need to either attach the EA or paste the code if you want somebody to look at it.

I've heard that Telepathic Debugging will be a major feature of MT5, but MetaQuotes haven't got a release date yet. :)
Reply With Quote
  #3  
Old 08-04-2009, 09:50
Level II Lasers Member
 
Join Date: Mar 2009
Posts: 31
Default

Quote:
Originally Posted by jezzer1961 View Post
You'll need to either attach the EA or paste the code if you want somebody to look at it.

I've heard that Telepathic Debugging will be a major feature of MT5, but MetaQuotes haven't got a release date yet. :)

Here it is, I saw something on the AshFX Version II Expert Advisor that had a setting on the inputs for "Close on Opposite Signal" that you could set to True or False. My feeling if I could get that installed I would be okay. Thanks for the help.

cwave:)
Attached Files
File Type: mq4 SimplyAwesome_EA.mq4 (33.3 KB)
File Type: ex4 SimplyAwesome_EA.ex4 (40.1 KB)
Reply With Quote
  #4  
Old 08-04-2009, 10:35
Level II Lasers Member
 
Join Date: Feb 2009
Posts: 27
Default

Quote:
Originally Posted by cwave View Post
Here it is, I saw something on the AshFX Version II Expert Advisor that had a setting on the inputs for "Close on Opposite Signal" that you could set to True or False. My feeling if I could get that installed I would be okay. Thanks for the help.

cwave:)
Is this what you want? I haven't tested it, but if you open the source file in the editor and search cwave, you'll be able to see the modifications that I've made.

Enjoy!
Attached Files
File Type: mq4 SimplyAwesome_EA.mq4 (34.3 KB)
Reply With Quote
  #5  
Old 08-04-2009, 17:36
Level II Lasers Member
 
Join Date: Mar 2009
Posts: 31
Default

Quote:
Originally Posted by jezzer1961 View Post
Is this what you want? I haven't tested it, but if you open the source file in the editor and search cwave, you'll be able to see the modifications that I've made.

Enjoy!
Help To Fix an Expert Advisor-first.gif

Here's the problem I'm having if you look at the white arrow it should have opened a sell on the open of that candle. I was in on a long position and it didn't do anything when it should have opened a sell and closed my buy. On the previous candle it closed below the 20 SMA and the AO Oscillator has to be red whether it's high or low just as long as it's red. Even though the previous candle is green it should still generate the trade becuase it just needs to close below the 20SMA.

I suspect the coding is set-up where that previous candle needs to be red in order for the trade to generate. If you could please look at that I would appreciate it so much.

Thank you for your help and I hope it makes sense what I just wrote.

Thank again,
cwave
Reply With Quote
  #6  
Old 09-04-2009, 11:54
Level II Lasers Member
 
Join Date: Feb 2009
Posts: 27
Default

Hi,

The problem I have is in finding the time to look at more complex issues.

When I first looked at it, I thought it was simply a case that you wanted it to close existing trades at the same time as it opened new trades. That was just a simple couple of minutes work and I was happy to help.

I'll have a look at the other problem, but it might be a few days before I even get round to looking at it for you unfortunately.
Reply With Quote
  #7  
Old 09-04-2009, 15:04
Level II Lasers Member
 
Join Date: Feb 2009
Posts: 27
Default

Quickly looking at the code, the basic rules are that it will go long at the start of a new bar if the previous bar

1) Closed above the ma
2) Had a low below the ma
3) The AO is rising

The opposite applies to shorts.

So with your trade that wasn't taken, it appears to be because the high of the bar wasn't above the ma.

You can easily adjust this yourself in lines 129 and 134 of the code if you feel it will improve things. I suggest you type // before the && Low and hit a return between the ma_cur and the ). This will mean that you can quickly reinstate things by removing the 2 slashes if the idea doesn't work in testing as intended.

If you alse look at line 75 there is a option for entering on bar close only which is set to true. If you type extern in front of bool, you will be able to experiment with entering on the current price bar.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Forex expert advisor xingxu Forex Discussion 10 09-03-2012 11:13
Forex expert advisor satyaranjan Forex Discussion 1 24-02-2011 10:39
Excellent Expert Advisor kimber Software / Signals / Services 6 13-02-2011 19:17
Expert Advisor doraja Software / Signals / Services 8 12-07-2010 10:56
Testing Results of New MT4 Expert Advisor oleg2009 Software / Signals / Services 1 24-02-2009 12:56


All times are GMT. The time now is 17:35.


Powered by vBulletin® Version 3.8.10
Copyright ©2000 - 2019, vBulletin Solutions, Inc.