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 9:37 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Condition based on the size of the bar
PostPosted: Fri Oct 05, 2012 2:04 pm 
Offline

Joined: Wed May 02, 2012 1:09 pm
Posts: 10
I need to open a trade when my indicators met the specific conditions, but I need to add another condition concerning the size of the bar (shift 1).

The trade will be open if the indicators met the specific conditions and the size (open-close) of the bar (shift 1) is less/more than "x" pips (for example, 20 pips). How to do that with the tools of Molanis? :?

Thanks for your help.


Top
 Profile  
 
 Post subject: Re: Condition based on the size of the bar
PostPosted: Fri Oct 05, 2012 2:24 pm 
Offline

Joined: Sun Jun 19, 2011 9:38 pm
Posts: 270
2 ways I would do it:

1. In an MQL block in SB, use (iClose[i+1]-iOpen[i+1])>your desired price distance in 0.00000 format for non-JPY pairs if you have a 5 digit dealer and 0.000 for 3 digit JPY pairs, for example. Use < for opposite direction and entry.

2. Build an indi in TIB using iClose[i+1]-iOpen[i+1] and simply import it into SB. Here, the condition would be something like > User Defined Number 0.00200

_________________
I'm not a programmer, but I play one on TV.


Top
 Profile  
 
 Post subject: Re: Condition based on the size of the bar
PostPosted: Sun Oct 07, 2012 8:19 am 
Offline

Joined: Wed May 02, 2012 1:09 pm
Posts: 10
You rocks my frend!!!! :shock:

Thanks a lot.


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