Skip to content

Add institutional indicator stack (VWAP/TWAP/RVOL/MTF RSI/OBV/Advanced MACD) to Pine + Python strategy logic - #9

Draft
Netrade1 with Copilot wants to merge 4 commits into
mainfrom
copilot/add-institutional-grade-indicators
Draft

Add institutional indicator stack (VWAP/TWAP/RVOL/MTF RSI/OBV/Advanced MACD) to Pine + Python strategy logic#9
Netrade1 with Copilot wants to merge 4 commits into
mainfrom
copilot/add-institutional-grade-indicators

Conversation

Copilot AI commented Jun 20, 2026

Copy link
Copy Markdown

This PR upgrades the strategy from basic trend/volume confirmation to an institutional-style multi-signal framework across both TradingView and Python. It adds VWAP, TWAP, RVOL, multi-horizon RSI, OBV, and advanced MACD (with divergence proxies), and aligns enhanced entry/exit logic between implementations.

  • Pine strategy (strategies/aapl_daily_ema_rsi_strategy.pine)

    • Added configurable VWAP, session TWAP, RVOL thresholding, RSI(7/14/21), OBV + OBV SMA, and MACD line/signal/histogram.
    • Replaced prior volume gate with RVOL-based confirmation and expanded entry/exit gates:
      • Entry: trend + regime + VWAP alignment + RVOL + OBV accumulation + MACD momentum + RSI divergence guard.
      • Exit: EMA reversal, MACD momentum reversal, VWAP rejection, OBV distribution, plus existing risk exits.
    • Added signal visual/alert hooks for VWAP cross, OBV reversal, and MACD divergence.
  • Python indicator module (indicators/institutional_indicators.py)

    • Introduced reusable indicator primitives: vwap, twap, rvol, rsi, obv, obv_sma, macd.
    • Added divergence helpers and non-negative volume guards.
    • Kept session-aware VWAP/TWAP behavior for parity with strategy-level usage.
  • Python backtest engine (test_netrade_dashboard.py)

    • Integrated the new indicator stack into feature computation and signal generation.
    • Updated portfolio logic to consume enhanced entry/exit conditions and maintain per-indicator signal attribution counters.
    • Added dashboard plotting for new institutional indicators and expanded metrics output.
  • Documentation and reporting

    • Updated README.md with new indicator definitions, strategy logic, and parameterized institutional filters.
    • Added BACKTEST_RESULTS.md to document baseline vs enhanced institutional configuration and archived result framing.
  • Focused coverage (tests/test_institutional_strategy.py)

    • Added targeted tests for indicator outputs, expected computed columns/signals, and backtest return structures.

Example (Python signal stack):

data["entry_long"] = (
    (data["ema_fast"] > data["ema_slow"])
    & (data["rsi_14"].between(params.rsi_min, params.rsi_max, inclusive="both"))
    & (data["close"] > data["sma_trend"])
    & (data["close"] > data["vwap"])
    & (data["rvol"] > params.rvol_threshold)
    & (data["obv"] > data["obv_sma"])
    & (data["macd_hist"] > 0)
    & (data["macd_line"] > data["macd_signal"])
    & (~data["rsi_bear_div"].fillna(False))
)

Copilot AI changed the title [WIP] Add institutional-grade advanced indicators to trading strategy Add institutional indicator stack (VWAP/TWAP/RVOL/MTF RSI/OBV/Advanced MACD) to Pine + Python strategy logic Jun 20, 2026
Copilot AI requested a review from Netrade1 June 20, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants