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 Sat Apr 27, 2024 1:25 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: New to Molanis - need help with my basic EA
PostPosted: Tue May 13, 2014 3:36 am 
Offline

Joined: Sun May 11, 2014 11:56 am
Posts: 2
Hi

I am new to Molanis and need some help in understanding the fundamentals of how to create an EA that I am trying to create.

Attached is a screen grab from MT4 which shows what I am trying to create - basically when the 20 day MA crosses above the Blue line of a Slope Direction custom indicator, I would like to Buy. I want to then Sell when the Slope Direction turns red. And vice versa for when the market is in a down trend.

I have watched the MA cross tutorial and I think I have managed to get MT4 to buy at the right time but it doesn't sell when it should and there are errors in MT4 so, it would be great to have some experienced advise.

Many thanks

N

Attachment:
MA_Strategy.jpg
MA_Strategy.jpg [ 183.04 KiB | Viewed 8340 times ]


Top
 Profile  
 
 Post subject: Re: New to Molanis - need help with my basic EA
PostPosted: Thu May 15, 2014 7:23 am 
Offline
Site Admin

Joined: Fri Oct 16, 2009 3:40 pm
Posts: 451
You see one line that changes colors but in mt4 there are two signals that work like this:
-color 1 is on, color 2 is off
-color 2 is on, color 1 is off
So you need to detect 2 signals using mode 0 and 1 and include that in the strategy. Post the strategy and the indicator to get more help.


Top
 Profile  
 
 Post subject: Re: New to Molanis - need help with my basic EA
PostPosted: Thu May 15, 2014 9:17 am 
Offline

Joined: Sun May 11, 2014 11:56 am
Posts: 2
Hi

Thanks for your reply.

I have been trying to work with the modes so that the EA recognises the different colours but its not working.

I am not sure what the best logic is to use when buying - should it be when the 20MA is => the Blue line or = to the Blue line ? Both options have not worked properly when back tested in MT4. Also, when trying to get it to Sell when the Slope Direction Line turns Red, I have tired using logic so that when the Blue line (Mode 0) is different to the Red line (Mode 1) it doesn't sell.

Attached are screen grabs, the custom indicator and the mol file, if you could point me in the right direction that would be most appreciated.

Thanks

N


Attachments:
MA_Strategy_Query_001.jpg
MA_Strategy_Query_001.jpg [ 473.97 KiB | Viewed 8309 times ]
MA_STRATEGY_001.mol [7.86 KiB]
Downloaded 699 times
Slope_Direction_Line.mq4 [4.09 KiB]
Downloaded 568 times
Top
 Profile  
 
 Post subject: Re: New to Molanis - need help with my basic EA
PostPosted: Tue May 20, 2014 10:16 pm 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
Looking at the code and the naming convention mode 0 is for uptrend (light blue), mode 1 is for downtrend (red) (I did not test this but seems right)
As I mentioned before:
-color 1 is on, color 2 is off=empty value (a big number = mt4 standard for empty is a huge number)
-color 2 is on, color 1 is off=empty value
the line does not change colors, there are two lines using the logic above but for the eye it seems like one line

For blue:Uptrend is blue, with mode 0 and, the indicator show some pricing. When blue is not shown the indicator has a big number so you detect it with conditions like > big number; as in
custom indicator > 10000 (this means blue is not shown).

For red the same logic applies

You cannot do custom = custom - it does not make sense, it is like saying red=red
You do custom < 10000 to indicate the indicator has a value or show the line
custom > 10000 to indicate indicator does not show line


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:  
Powered by Molanis © 2009