- How can i tell iBands to work with a different value?
- What's the problem with my code?
- Measuring the price difference between a line and a bar
Read the documentation for iBands
-
Why did you post your MT4 question in the MT5 General section instead of the MQL4 section, (bottom of the Root page)?
General rules and best pratices of the Forum. - General - MQL5 programming forum?
Next time, post in the correct place. The moderators will likely move this thread there soon. Your code Documentation iBands( _Symbol, PERIOD_M5, 20, 3, 0, Ask, MODE_UPPER, 0 )
double iBands( string symbol, // symbol int timeframe, // timeframe int period, // averaging period double deviation, // standard deviations int bands_shift, // bands shift int applied_price, // applied price int mode, // line index int shift // shift );
What applied_price are you using?
Thanks, will post there in future.
I've used Ask as the applied price. I think that's correct is it not? I've tried PRICE_HIGH, Bid, Open[0], Close[0]...
They all give me a different value to what the chart is saying.
-
Why did you post your MT4 question in the MT5 General section instead of the MQL4 section, (bottom of the Root page)?
General rules and best pratices of the Forum. - General - MQL5 programming forum?
Next time, post in the correct place. The moderators will likely move this thread there soon. Your code Documentation What applied_price are you using?
I set the back-test to pause as the price moves above the 3rd deviation.
if (Ask > iBands(_Symbol,thisPeriod, 20,3,0,Ask, MODE_UPPER,0)) {
PauseTest();
}
So, iBands gives 1.1558, while the chart reads 1.15594, and my program is pausing before a true crossing and the price is still actually under the 3rd deviation.
I don’t think it matters the timeframe… price is price… all I can see is that it is about 3 min difference between your Print and your cross on the chart… maybe that is way
It looks like some kind of rounding error, that's what I figure anyways.
2 things, as one of the forum gods has tried to hint to you is that you can not use Ask or Bid, AND if i remember correctly, the buffers for UPPER and Lower bands is different on the indicator. So you have 2 issues.
but yes there is a rounding issue, but you can fix this by using and modifying the indicator to suite your needs.- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use