Hi all,
I'm trying to develop a backtest where I use technical indicators derived off the ratio between two securities. In the attached test, I'm using SPY & IWM.
I generated a variable "ratio" based off spy['price']/iwm['price'] and confirmed the reported values with ratio.tail(). However, I'm a bit unsure how to generate a MACD value for each day. I tried ta.MACD(ratio,12,26,9) and the results are unclear.
To add context, if I can get the MACD (or another indicator) to generate a numerical value by date, then I would like to implement this into a backtest within the Quantopian Algorithm to use as trading signals.
Any help is much appreciated!
Thanks,
Chris