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 May 11, 2024 1:44 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Creating EA with chronological conditions
PostPosted: Thu Jul 04, 2013 2:19 pm 
Offline

Joined: Tue Jul 24, 2012 2:15 am
Posts: 5
Hi,

This question seems really basic to me, but I cant seem to figure it out.
How do i specify that a condition needs to be checked before another. The AND and OR will not do it. The SHIFT option does not seem ideal.
For example, if I want to specify the following conditions:

1. Price closes above upper bollinger. Let's call this bar 'bar1'
2. subsequent bars must not close below the low of bar 1
3. A bar then closes above bar 1. We call this bar 'bar x'
4. Enter long on the close of bar x.

Now, it does not matter how many bars occur before condition 3 - as long as at least one bar does not close below bar 1. With the tools in Molanis, the only way I can see is to create an infinite number of conditions like:

SHIFT 30 does not close below bar 1 (I am starting at 30 for convenience)
SHIFT 29 does not close below bar 1
etc

A simpler example is:
1. Price closes above upper bollinger. Let's call this bar 'bar1'
2. Do not enter a trade for at least 3 bars after bar 1
3. Enter long when a bar closes above bar 1 (provided condition 1 and 2 have been met)

I hope the above makes sense.

Regards
Ose


Top
 Profile  
 
 Post subject: Re: Creating EA with chronological conditions
PostPosted: Thu Jul 04, 2013 7:22 pm 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
By default the TAs trigger trades if all conditions are true at the same time.
In your case you need to somehow keep the info of previous bars. I think it may be possible using variables and the mql icon. Try to put two of the conditions in TAs and connect them using an AND. Post the strategy file and I will try to add the code for you in the mql icon.


Top
 Profile  
 
 Post subject: Re: Creating EA with chronological conditions
PostPosted: Mon Jul 08, 2013 7:20 pm 
Offline

Joined: Tue Jul 24, 2012 2:15 am
Posts: 5
Thanks for your reply, molanisfx.

I thought it could be achieved somehow without coding knowledge. There are a few I would want to create. So I would not want to bother you with them.

I will try to find a workaround. If I cannot find any, I will create them and send over to you.

Thanks for your help

Ose


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