Download MetaTrader 5
To add comments, please log in or register
Publish your articles and improve your rating!
Ari Gold
15
Ari Gold 2014.10.14 04:25 

Graphically, I am able to apply Bands (Bollinger) to another indicator (say RSI).  However, if I would like to call this value in an EA using iBands, it looks like it may only be done with Hi/Lo or Close, not with another input value, like RSI.

Do I need to modify the Bands indicator to run on an input other than price?  If so, how do I do this?  Thanks in advance for the help.

Keith Watford
Moderator
7887
Keith Watford 2014.10.14 06:28  
Store the values for the RSI or whatever in a buffer, then use iBandsOnArray
Ari Gold
15
Ari Gold 2014.10.14 13:56  
GumRai:
Store the values for the RSI or whatever in a buffer, then use iBandsOnArray
Sweet!  Thank you!
Ari Gold
15
Ari Gold 2014.10.16 01:45  

Got it working for an index of 0, current bar.  However, when I want to look back at the previous value of iBandsOnArray, i.e. index=1, it returns 0.

SHi=iBandsOnArray(SClone,CPeriod,CPeriod,XDev,0,1,0); //Works Fine
SLo=iBandsOnArray(SClone,CPeriod,CPeriod,XDev,0,2,0); //Works Fine

SHi1=iBandsOnArray(SClone,CPeriod,CPeriod,XDev,0,1,1); //Returns 0
SLo1=iBandsOnArray(SClone,CPeriod,CPeriod,XDev,0,2,1); //Returns 0

Any ideas?

Carl Schreiber
5937
Carl Schreiber 2014.10.16 06:25  

1) Try with 0,Period instead of Period ,Period.

2) What is the ArraySize of SClone?

Ari Gold
15
Ari Gold 2014.10.16 16:24  

Thanks for the suggestions, unfortunately:

1. Tried with 0 - no difference

2. Tried changing size of array - anything from 25-1000, no joy...

/
To add comments, please log in or register