How to Build Technical Analysis and Backtesting Workflow with pandas-ta-classic, Strategy Signals, and Performance Metrics

entries = df.index[(df[“pos”].diff() == 1)] exits = df.index[(df[“pos”].diff() == -1)] fig, (ax1, ax2, ax3) = plt.subplots( 3, 1, figsize=(13, 10), sharex=True, gridspec_kw={“height_ratios”: [3, 1, 2]}, ) ax1.plot(df.index, df[“close”], lw=1.1, color=”black”, label=”Close”) ax1.plot(df.index, df[“SMA_20″], lw=0.9, label=”SMA 20”) ax1.plot(df.index, df[“SMA_50″], lw=0.9, label=”SMA 50”) bbu, bbl = “BBU_20_2.0”, “BBL_20_2.0” if bbu in df and bbl in df: ax1.fill_between(df.index,…

Read More