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 Mon Apr 29, 2024 4:51 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Shift paramater
PostPosted: Sat Jul 21, 2012 8:30 am 
Offline

Joined: Sat Jul 21, 2012 7:04 am
Posts: 3
HI
I would once and for all like to clarify the shift functions.
shift-Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).

what does this mean in lay mans terms?
I am using it in context of bbands. If I want the trade to open on the close of the current bar as it closes below the lower bollinger.

There is also a bbands shift paramater, this is all a bit confusing today.

http://www.molanis.com/support/metatrad ... ence-guide:
double iBands( string symbol, int timeframe, int period, int deviation, int bands_shift, int applied_price, int mode, int shift)
Calculates the Bollinger bands indicator and returns its value.
Parameters:
symbol - Symbol the data of which should be used to calculate the indicator. NULL means the current symbol.
timeframe - Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.
period - Averaging period to calculate the main line.
deviation - Deviation from the main line.
bands_shift - The indicator shift relative to the chart.
applied_price - Applied price. It can be any of Applied price enumeration values.
mode - Indicator line index. It can be any of the Indicators line identifiers enumeration value.
shift - Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
Sample:
if(iBands(NULL,0,20,2,0,PRICE_LOW,MODE_LOWER,0)>Low[0]) return(0);


Top
 Profile  
 
 Post subject: Re: Shift paramater
PostPosted: Sat Jul 28, 2012 9:54 am 
Offline
Site Admin

Joined: Fri Oct 16, 2009 3:40 pm
Posts: 451
The shift of the indicator is used to select the bar to be used to get the indicator's value: shift 0 uses the current bar, shift 1 is the previous bar, etc
Some indicator have an extra shift, this is to move the indicator chart to the right or to the left. To get the concept add the indicator to chart and change bands_shift and see how the whole charts moves. This creates challenges if you use both shifts since people get confused. shift=0 and bands_shift=1 have a different signal than shift=0 and bands_shift=0. In my eas I never use the bands_shift to avoid confusion.


Top
 Profile  
 
 Post subject: Re: Shift paramater
PostPosted: Tue Jul 31, 2012 11:10 am 
Offline

Joined: Sat Jul 21, 2012 7:04 am
Posts: 3
Thanks got it . One thing; I don't think it had the capability to do a shift -1 only positive shift.


Top
 Profile  
 
 Post subject: Re: Shift paramater
PostPosted: Thu Aug 02, 2012 10:12 am 
Offline

Joined: Sun Jun 19, 2011 9:38 pm
Posts: 270
silverman wrote:
I don't think it had the capability to do a shift -1 only positive shift.


http://www.molanis.com/forum/viewtopic.php?p=5050#p5050

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


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