- I am new to Pandas and am trying to recreate some excel sheets I have created as an introduction to pandas.
- In excel I have the formula:
=IF(J99="","",IF(OR(AND(I98>J98,I99<J99),AND(I98<J98,I99>J99)),E99,""))
- I have currently created a MACD dataframe using:
import pandas_ta as ta
import yfinance as yf
#Inputs
ticker= "AAPL"
time = '5y'
Lower_MA= 12
Upper_MA= 26
Span = 9
df2= yf.Ticker(ticker).history(period= time)[['Close','Open','Volume']]
df2.ta.macd(close='Close', fast= Lower_MA,slow= Upper_MA, signal= Span, append=True)
- I now want to do something similar to the excel formula where column I= MACDs, J=MACDh, and E is the date. Is this possible, or am I biting off more than I can chew too early.