OPEN-SOURCE SCRIPT

Rifle Unified

150
This script is designed for use on 30-second charts of Dow Jones-related symbols (YM, MYM, US30). It provides automated buy and sell signals using a combination of price action, RSI (Relative Strength Index), and volume analysis. The script is intended for both live trading signals and backtesting, with configurable risk management and debugging features.

Core Functionality
1. Signal Generation Logic
  • Trigger: The algorithm looks for a sharp price move (drop or rise) of a user-defined threshold (default: 80 points) within a specified lookback window (default: 20 minutes).
  • Levels: It monitors for price drops below specific numerical levels ending in 23, 43, or 73 (e.g., 42223, 42273).
  • RSI Condition: When price falls below one of these levels and the RSI is below 30, the setup is considered active.


Buy Signal: A buy is triggered if, after setup:
  • Price rises back above the level,
  • The RSI rate of change (ROC) indicates exhaustion of the drop,
  • The current bar shows positive momentum.


2. Trade Management
  • Stop Loss & Take Profit: Configurable fixed or trailing stop loss and take profit levels are plotted and managed automatically.
  • Exit Signals: The script signals exit based on price action relative to these risk management levels.


3. Filters & Enhancements
  • Parabolic Move Filter: Prevents entries during extreme price moves.
  • Dead Cat Bounce Filter: Avoids false signals after sharp reversals.
  • Volume Filter: Optionally requires volume conditions for trade entries (especially for shorts).
  • Multiple Confirmation Layers: Includes checks for 5-minute RSI, momentum, and price retracement.


User Inputs & Customization
  • Trade Direction: Toggle between LONG and SHORT signal generation.
  • Trigger Settings: Adjust thresholds for price moves, lookback windows, RSI ROC, and volume requirements.
  • Trade Settings: Set take profit, stop loss, and trailing stop behavior.
  • Debug & Visualization: Enable or disable various plots, labels, and debug tables for in-depth analysis.
  • Backtesting: Integrated backtester with summary and detailed statistics tables.


Technical Features
  • Uses External Libraries: Relies on RifleShooterLib for core logic and BackTestLib for backtesting and statistics.
  • Multi-timeframe Analysis: Incorporates both 30-second and 5-minute RSI calculations.
  • Chart Annotations: Plots entry/exit points, risk levels, and debug information directly on the chart.
  • Alert Conditions: Built-in alert triggers for key events (initial move, stall, entry).


Intended Use
  • Markets: Dow Jones symbols (YM, MYM, US30, or US30 CFD).
  • Timeframe: 30-second chart.
  • Purpose: Automated signal generation for discretionary or algorithmic trading, with robust risk management and backtesting support.


Notable Customization & Extension Points
  • Momentum Calculation: Plans to replace the current momentum measure with "sqz momentum".
  • Displacement Logic: Future update to use "FVG concept" for displacement.
  • High-Contrast RSI: Optional visual enhancements for RSI extremes.
  • Time-based Stop: Consideration for adding a time-based stop mechanism.


This script is highly modular, with extensive user controls, and is suitable for both live trading and historical analysis of Dow Jones index movements

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.