Close Menu
    Facebook X (Twitter) Instagram
    Articles Stock
    • Home
    • Technology
    • AI
    • Pages
      • About ArticlesStock — AI & Technology Journalist
      • Contact us
      • Disclaimer For Articles Stock
      • Privacy Policy
      • Terms and Conditions
    Facebook X (Twitter) Instagram
    Articles Stock
    AI

    The right way to Construct Technical Evaluation and Backtesting Workflow with pandas-ta-classic, Technique Alerts, and Efficiency Metrics

    Naveed AhmadBy Naveed Ahmad12/05/2026Updated:12/05/2026No Comments1 Min Read
    blog11 8


    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, coloration="black", label="Shut")
    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, df[bbl], df[bbu], alpha=0.12, label="Bollinger 20,2")
    ax1.scatter(entries, df.loc[entries, "close"], marker="^", s=70,
               coloration="inexperienced", zorder=5, label="Entry")
    ax1.scatter(exits,   df.loc[exits,   "close"], marker="v", s=70,
               coloration="pink",   zorder=5, label="Exit")
    ax1.set_title(f"{TICKER} — worth, MAs, Bollinger, indicators")
    ax1.legend(loc="higher left"); ax1.grid(alpha=0.3)
    ax2.plot(df.index, df["RSI_14"], lw=0.9, label="RSI 14")
    ax2.axhline(70, coloration="pink",   ls="--", lw=0.6)
    ax2.axhline(30, coloration="inexperienced", ls="--", lw=0.6)
    ax2.set_title("RSI 14"); ax2.legend(loc="higher left"); ax2.grid(alpha=0.3)
    ax3.plot(df.index, (1 + df["ret"]).cumprod(),       lw=1.1, label="Purchase & Maintain")
    ax3.plot(df.index, (1 + df["strat_ret"]).cumprod(), lw=1.1, label="Technique")
    ax3.set_title("Fairness curves ($1 begin)")
    ax3.legend(loc="higher left"); ax3.grid(alpha=0.3)
    plt.tight_layout(); plt.present()
    print("nTweak TICKER, the Technique checklist, or the sweep grid to maintain exploring.")



    Source link

    Naveed Ahmad

    Naveed Ahmad is a technology journalist and AI writer at ArticlesStock, covering artificial intelligence, machine learning, and emerging tech policy. Read his latest articles.

    Related Posts

    Vercel Labs Introduces Zero, a Programs Programming Language Designed So AI Brokers Can Learn, Restore, and Ship Native Packages

    17/05/2026

    A Coding Information Implementing SHAP Explainability Workflows with Explainer Comparisons, Maskers, Interactions, Drift, and Black-Field Fashions

    17/05/2026

    Nous Analysis Proposes Lighthouse Consideration: A Coaching-Solely Choice-Primarily based Hierarchical Consideration That Delivers 1.4–1.7× Pretraining Speedup at Lengthy Context

    17/05/2026
    Leave A Reply Cancel Reply

    Categories
    • AI
    Recent Comments
      Facebook X (Twitter) Instagram Pinterest
      © 2026 ThemeSphere. Designed by ThemeSphere.

      Type above and press Enter to search. Press Esc to cancel.