molanis.com/forum - Tools for MetaTrader : The place to ask about the best expert advisor builder, expert advisor downloads, and expert advisor programming

AFTER YOU REGISTER SEND US AN EMAIL TO ACTIVATE YOUR ACCOUNT - Before posting:-1- Please read the user guide -2- Try the examples -3- Search in the forum
It is currently Sun May 12, 2024 7:19 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: MACD Zero Line Cross EA.
PostPosted: Tue Oct 09, 2012 11:17 am 
Offline

Joined: Sun Mar 11, 2012 8:28 am
Posts: 11
Hi everyone,

I have tried to build a simple EA that sells when MACD (not the signal line but the MACD itself) crosses from above the zero line to below it and buys when crosses from below the zero line, to above it.

It happens that, while it correctly took one trade (circled) it didn't take the other one highlighted.
Please find attached the .mol file for the short trades and a screenshot.

Could you please tell me how to fix it?

Thank you,

John.


Attachments:
MACD_ZeroLine.jpg
MACD_ZeroLine.jpg [ 260.81 KiB | Viewed 3730 times ]
Macd_ZeroLine.mol [6.65 KiB]
Downloaded 407 times
Top
 Profile  
 
 Post subject: Re: MACD Zero Line Cross EA.
PostPosted: Tue Oct 09, 2012 9:10 pm 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
In the strategy file you only have a logic to go short, you need to create the logic to go long. Your logic seems fine to me, make sure your indicator uses the same parameters as in the strategy


Top
 Profile  
 
 Post subject: Re: MACD Zero Line Cross EA.
PostPosted: Wed Oct 10, 2012 2:34 am 
Offline

Joined: Sun Mar 11, 2012 8:28 am
Posts: 11
molanisfx wrote:
In the strategy file you only have a logic to go short, you need to create the logic to go long. Your logic seems fine to me, make sure your indicator uses the same parameters as in the strategy


Hi,
the posted example was only for the short logic (obviously).
The logic seems ok also to me, but, as you may notice, the second trade is not taken.

Any in depth comment would be appreciated,

thank you,

John.


Top
 Profile  
 
 Post subject: Re: MACD Zero Line Cross EA.
PostPosted: Wed Oct 10, 2012 9:50 am 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
First recheck the chart, Make sure it has the same parameters as the ea.
Then look at the logs, under the expert tab the ea prints everything. It will show why the trade was not taken if it was due to an error in the server. You can see that on backtesting or on a demo account.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by Molanis © 2009