Download MetaTrader 5

iBands apply to other indicator value, not price

To add comments, please log in or register
Ari Gold
15
Ari Gold  

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
10614
Keith Watford  
Store the values for the RSI or whatever in a buffer, then use iBandsOnArray
Ari Gold
15
Ari Gold  
GumRai:
Store the values for the RSI or whatever in a buffer, then use iBandsOnArray
Sweet!  Thank you!
Ari Gold
15
Ari Gold  

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
7364
Carl Schreiber  

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

2) What is the ArraySize of SClone?

Ari Gold
15
Ari Gold  

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