Section 6 Unit 4: How does it automatically takes Closing price while calculating bollinger band?

Course Name: Python for Trading: Basic, Section No: 6, Unit No: 4, Unit type: Notebook

In [5] : While looking at the code i could not find a line which specifies that in calculation of bolling band of Nifty, closing price of Nifty is to be used, then how is taking it automatically?

Hi Mridul,



In the 'Bollinger_Bands' function in cell 4, we passed two parameters data and lookback period (n). While calculating the moving average and standard deviation, we passed the 'Close' column with the data. So, when you call the 'Bollinger_Bands' function, it will do the calculation using the 'Close' column of the dataframe.



Hope that helps.