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 Thu May 16, 2024 12:18 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: 2ma cross with specific distance
PostPosted: Tue Mar 22, 2011 4:36 pm 
Offline

Joined: Thu Sep 09, 2010 8:12 am
Posts: 48
Hi molanis. Will like you to assist me in creating two ma cross with specific distance i.e 30ma> 60ma but the distance shud not exist sth like 20 pips. Just tried to do it but i cant
Thanks


Top
 Profile  
 
 Post subject: Re: 2ma cross with specific distance
PostPosted: Wed Mar 23, 2011 9:17 am 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
First you need to define the cross over type and the buffer (Buffers help to reduce false signals and flickering.) There are many ways to identify ma crosses w/o buffer (you can create your own type):

Conditions for BUY (for SELL use the opposite condition) - select the condition that you feel more comfortable with

1. MA Fast bar 0 > MA Slow bar 0 AND MA Fast bar 1 < MA Slow bar 1 - create 2 TAs joined by AND
2. MA Fast bar 1 > MA Slow bar 1 AND MA Fast bar 2 < MA Slow bar 2
3. MA Fast bar 1 > MA Slow bar 1 AND MA Fast bar 2 < MA Slow bar 1

Let's convert type 1 into a buffer type ma cross:
MA Fast bar 0 > MA Slow bar 0 + buffer AND MA Fast bar 1 < MA Slow bar 1 - create 2 TAs joined by AND
which is equivalent to
MA Fast bar 0 - MA Slow bar 0 > buffer AND MA Fast bar 1 < MA Slow bar 1
Mind you, if the buffer is too big you could miss signals

If you want to use buffers you have two options:
Build and indicator that has a buffer signals and import that into the strategy builder or build the whole thing in strategy builder
For option 1:
In the indicator builder build a signal like:
MA Fast bar 0 - MA Slow bar 0
Import it to a TA and compare it to buffer (i.e. user defined number = 0.0030 for EUR/USD 30 pips) - use an AND to join another TA with MA Fast bar 1 < MA Slow bar 1 condition

For option 2
In strategy builder (3.15 beta), use the mql icon to create MA Fast bar 0 - MA Slow bar 0 > buffer; use an AND to join another TA with MA Fast bar 1 < MA Slow bar 1 condition


Top
 Profile  
 
 Post subject: Re: 2ma cross with specific distance
PostPosted: Wed Mar 23, 2011 2:53 pm 
Offline

Joined: Thu Sep 09, 2010 8:12 am
Posts: 48
molanisfx wrote:
First you need to define the cross over type and the buffer (Buffers help to reduce false signals and flickering.) There are many ways to identify ma crosses w/o buffer (you can create your own type):

Conditions for BUY (for SELL use the opposite condition) - select the condition that you feel more comfortable with

1. MA Fast bar 0 > MA Slow bar 0 AND MA Fast bar 1 < MA Slow bar 1 - create 2 TAs joined by AND
2. MA Fast bar 1 > MA Slow bar 1 AND MA Fast bar 2 < MA Slow bar 2
3. MA Fast bar 1 > MA Slow bar 1 AND MA Fast bar 2 < MA Slow bar 1

Let's convert type 1 into a buffer type ma cross:
MA Fast bar 0 > MA Slow bar 0 + buffer AND MA Fast bar 1 < MA Slow bar 1 - create 2 TAs joined by AND
which is equivalent to
MA Fast bar 0 - MA Slow bar 0 > buffer AND MA Fast bar 1 < MA Slow bar 1
Mind you, if the buffer is too big you could miss signals

If you want to use buffers you have two options:
Build and indicator that has a buffer signals and import that into the strategy builder or build the whole thing in strategy builder
For option 1:
In the indicator builder build a signal like:
MA Fast bar 0 - MA Slow bar 0
Import it to a TA and compare it to buffer (i.e. user defined number = 0.0030 for EUR/USD 30 pips) - use an AND to join another TA with MA Fast bar 1 < MA Slow bar 1 condition

For option 2
In strategy builder (3.15 beta), use the mql icon to create MA Fast bar 0 - MA Slow bar 0 > buffer; use an AND to join another TA with MA Fast bar 1 < MA Slow bar 1 condition



Ok. Will go through this and call again if i have any issue
Thanks.


Top
 Profile  
 
 Post subject: Re: 2ma cross with specific distance
PostPosted: Wed Mar 23, 2011 4:40 pm 
Offline

Joined: Thu Sep 09, 2010 8:12 am
Posts: 48
Ok. Will go through this and call again if i have any issue
Thanks.[/quote]

I have done some samples following ur explanation. This is what i did:

Buy signal
MA10(1) - MA23(1)<= 30 pips. AND MA10(2)< MA23(2). I noticed in ur equation u wrote MA Fast bar 0 - MA Slow bar 0 > buffer
So i want to know if am still on track cos i dont want the distance of the ma cross to be more than a specific number/pips (it can be less since am using it with other signal). But ur equation stated the custum indicator to be grater than the pip for buy signal so pls let me know

2. I have MSB for mt4 and mt5 but i have been bussy working with the mt5 (and u guys did a great job). Just saw the upgrade information of the mt4 version but still cant upgrade after i followed ur instruction so pls how do i go about it
Thanks


Attachments:
sample custom buffer.mol [5.32 KiB]
Downloaded 1179 times
Top
 Profile  
 
 Post subject: Re: 2ma cross with specific distance
PostPosted: Thu Mar 24, 2011 8:39 am 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
so you are trying
MA Fast bar 1 > MA Slow bar 1 AND MA Fast bar 2 < MA Slow bar 2
This MA Fast bar 1 > MA Slow bar 1 is equal to this MA Fast bar 1 - MA Slow bar 1 > 0
With a buffer: MA Fast bar 1 - MA Slow bar 1 > buffer

Thus your trading condition should be:
MA10(1) - MA23(1) > 30 pips. AND MA10(2) < MA23(2)
30 pips is too big for a buffer - you may miss signals. Use 3-4 pips (0.0003)

To download the beta version, go to the download page http://www.molanis.com/products/molanis ... r-download, click on Free Download and click on "Click here to download Molanis Strategy Builder 3.15 Beta"


Top
 Profile  
 
 Post subject: Re: 2ma cross with specific distance
PostPosted: Fri Mar 25, 2011 2:03 pm 
Offline

Joined: Thu Sep 09, 2010 8:12 am
Posts: 48
molanisfx wrote:
so you are trying
MA Fast bar 1 > MA Slow bar 1 AND MA Fast bar 2 < MA Slow bar 2
This MA Fast bar 1 > MA Slow bar 1 is equal to this MA Fast bar 1 - MA Slow bar 1 > 0
With a buffer: MA Fast bar 1 - MA Slow bar 1 > buffer

Thus your trading condition should be:
MA10(1) - MA23(1) > 30 pips. AND MA10(2) < MA23(2)
30 pips is too big for a buffer - you may miss signals. Use 3-4 pips (0.0003)

To download the beta version, go to the download page http://www.molanis.com/products/molanis ... r-download, click on Free Download and click on "Click here to download Molanis Strategy Builder 3.15 Beta"

Ok i get the buffer thing now. I thought that its the specific distance that we want to achive is what we use (in my case not more than 30 pips). But if i use 3 pips as u suggested, then the condition is still ok.
But now what happens if the distance is like 45 pips which is still > the 3 pips i set but also > the 30 pips max which am trying to set my signal on

My MSB mt4 will expire in about 2 months now. What will happen after it does. Upgrade or pay for new one
Thanks.


Top
 Profile  
 
 Post subject: Re: 2ma cross with specific distance
PostPosted: Fri Mar 25, 2011 4:45 pm 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
Maybe we have a difference definition of "distance". The buffer is used to decrease the number of false signals and improve the ma cross a bit.
You get one year of free updates, so you might be eligible to get version 3.15


Top
 Profile  
 
 Post subject: Re: 2ma cross with specific distance
PostPosted: Sat Mar 26, 2011 3:53 pm 
Offline

Joined: Thu Sep 09, 2010 8:12 am
Posts: 48
molanisfx wrote:
Maybe we have a difference definition of "distance". The buffer is used to decrease the number of false signals and improve the ma cross a bit.
You get one year of free updates, so you might be eligible to get version 3.15


1. Ok, maybe we do have diferent defination of distance.You know as the trend increases the crosed MA's begins to widen apart which increases the pip distance btw them. Now what am trying to achive is when those MA just cross and the distance not up to 30pips and if it is going to be continuos and my other signal, say stochastic, is below 20 then i take a buy order. But if the trend is already on and distance between MAs is like 50 - 60 pips and stoch is below 20, then i dont want to take the buy signal. The simple reason is because of the way i set stop levels. Thats is what i thot the buffer is for and is it possible to achive.

2. Thanks for the MSB update i will get. Want to know if u are considering putting partial closing of trade (open 2 lots or more and close one or some percentage of it when trade is in money then let the remaining work out after adjusting stops) in the subsequent release. I will appreciate it if we can have that too
Thanks.


Top
 Profile  
 
 Post subject: Re: 2ma cross with specific distance
PostPosted: Sat Mar 26, 2011 7:22 pm 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
For your ea you need 2 trading conditions, one to check ma1>ma2 (or ma1>ma2 + small buffer) and a second one to check
ma1 - ma2 < your 60 pips buffer


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 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