0
RIL = yf.Ticker("RELIANCE.NS")
Period_20 = (RIL.history("20d"))
Period_50 = (RIL.history("50d"))
Period_100 = (RIL.history("100d"))
Period_200 = (RIL.history("200d"))


def MA_20_50_100_200():
    MA = (sum(Period_20.Close)/20,
          sum(Period_50.Close)/50,
          sum(Period_100.Close)/100,
          sum(Period_200.Close)/200)
    print(MA)


MA_20_50_100_200()

I checked the data in excel sheet where excel sheet SMA 200 value doesn't match with SMA 200 via code. All other averages are accurate i.e. 20,50,100 except 200. Please help.

0 Answers0