lqsa00: I've created a CiBands objec Why upBollinger, lowBollinger and baseBollinger has the same value?
|
|
whroeder1:
|
Sorry? I can't understand your answer. The code is the one that I publish. All together:
CiBands bollinger; int OnInit() { bollinger.Create(Symbol(), PERIOD_H1, 20, 2, 0, PRICE_CLOSE); } void OnTick() { bollinger.Refresh(OBJ_ALL_PERIODS); double upBollinger = bollinger.Upper(1); double lowBollinger = bollinger.Lower(1); double baseBollinger = bollinger.Base(1); }
The values could be viewed on debugger or in the data window. No matter the date, always the three values are the same.
:
lqsa00: Sorry? I can't understand your answer. The code is the one that I publish. All together:
CiBands bollinger; |
|
lqsa00:
Sorry? I can't understand your answer. The code is the one that I publish. All together:
The values could be viewed on debugger or in the data window. No matter the date, always the three values are the same.
:
Because you set your parameters incorrectly. Deviation is 0, so the 3 values are the same.
bollinger.Create(symbol, PERIOD_H1, 20, 2, 0, PRICE_CLOSE);
Documentation on MQL5: Standard Library / Indicators / Trend Indicators / CiBands / Create
- www.mql5.com
Standard Library / Indicators / Trend Indicators / CiBands / Create - Reference on algorithmic/automated trading language for MetaTrader 5
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello,
I've created a CiBands object:
private: CiBands bollinger;
On the constructor:
On another method:
Why upBollinger, lowBollinger and baseBollinger has the same value?