Generation

generate functionSat, 28 Jan 2023

backtest the AAPL stock using the backtesting.py library with a stochastic oscillator

def backtest_aapl(window): b = backtesting.Backtest(aapl['Close'], aapl['Close'].rolling(window).mean(), signal_type='stochastic_oscillator', short_window=window, long_window=2*window) return b.signal

Questions about programming?Chat with your personal AI assistant