What is wrong with Bollinger's buffer values

 

Hi all,

Please look at the picture below.

The red lines are drawn by the value which is provided with iBands function.

What is wrong with them?

Why they are not matched with Bollingers end points?

(The upper band value is normalized just to see if there was difference (but not))


here is the code

   double Bollinger_UpperBand_Buffer[];
   double Bollinger_LowerBand_Buffer[];
   double Bollinger_MidleBand_Buffer[];

   ArraySetAsSeries(Bollinger_UpperBand_Buffer, true);
   ArraySetAsSeries(Bollinger_LowerBand_Buffer, true);
   ArraySetAsSeries(Bollinger_MidleBand_Buffer, true);



   int BollingerHandle=iBands(Sembol,Periyot,20,0,2,MODE_CLOSE);

   CopyBuffer(BollingerHandle,1,0,3,Bollinger_UpperBand_Buffer);
   CopyBuffer(BollingerHandle,2,0,3,Bollinger_LowerBand_Buffer);
   CopyBuffer(BollingerHandle,0,0,3,Bollinger_MidleBand_Buffer);

   double MyUpperBandValue=NormalizeDouble(Bollinger_UpperBand_Buffer[1],6);
   double MyMiddleBandValue=Bollinger_MidleBand_Buffer[1];
   double MyLowerBandValue=Bollinger_LowerBand_Buffer[1];

   ObjectMove(ChartID(),"BollingerUP",0,0,MyUpperBandValue);
   ObjectMove(ChartID(),"BollingerDown",0,0,MyLowerBandValue);
   ObjectMove(ChartID(),"BollingerMid",0,0,MyMiddleBandValue);


 
Perhaps you should read the manual, especially the examples. They all (including iCustom) return a handle (an int.) You get that in OnInit. In OnTick you use the handle, shift and count to get the data.
          Technical Indicators - Reference on algorithmic/automated trading language for MetaTrader 5
          Timeseries and Indicators Access / CopyBuffer - Reference on algorithmic/automated trading language for MetaTrader 5
          How to start with MQL5 - General - MQL5 programming forum - Page 3 #22 2020.03.08
          How to call indicators in MQL5 - MQL5 Articles 12 March 2010
 
William Roeder:
Perhaps you should read the manual, especially the examples. They all (including iCustom) return a handle (an int.) You get that in OnInit. In OnTick you use the handle, shift and count to get the data.
          Technical Indicators - Reference on algorithmic/automated trading language for MetaTrader 5
          Timeseries and Indicators Access / CopyBuffer - Reference on algorithmic/automated trading language for MetaTrader 5
          How to start with MQL5 - General - MQL5 programming forum - Page 3 #22 2020.03.08
          How to call indicators in MQL5 - MQL5 Articles 12 March 2010

thanks a lot. (btw I also did it it provide nothing in that occasion. I ll revise it.

 
William Roeder:
Perhaps you should read the manual, especially the examples. They all (including iCustom) return a handle (an int.) You get that in OnInit. In OnTick you use the handle, shift and count to get the data.
          Technical Indicators - Reference on algorithmic/automated trading language for MetaTrader 5
          Timeseries and Indicators Access / CopyBuffer - Reference on algorithmic/automated trading language for MetaTrader 5
          How to start with MQL5 - General - MQL5 programming forum - Page 3 #22 2020.03.08
          How to call indicators in MQL5 - MQL5 Articles 12 March 2010

I don't think that is the problem. Because answer didn't solve it.

I think there is really a bug or something with it.

Reason: