OPEN-SOURCE SCRIPT
Aggiornato

Ticker Pulse Meter + Fear EKG Strategy

200
Description
The Ticker Pulse Meter + Fear EKG Strategy is a technical analysis tool designed to identify potential entry and exit points for long positions based on price action relative to historical ranges. It combines two proprietary indicators: the Ticker Pulse Meter (TPM), which measures price positioning within short- and long-term ranges, and the Fear EKG, a VIX-inspired oscillator that detects extreme market conditions. The strategy is non-repainting, ensuring signals are generated only on confirmed bars to avoid false positives. Visual enhancements, such as optional moving averages and Bollinger Bands, provide additional context but are not core to the strategy's logic. This script is suitable for traders seeking a systematic approach to capturing momentum and mean-reversion opportunities.
How It Works
The strategy evaluates price action using two key metrics:
Ticker Pulse Meter (TPM): Measures the current price's position within short- and long-term price ranges to identify momentum or overextension.

Fear EKG: Detects extreme selling pressure (akin to "irrational selling") by analyzing price behavior relative to historical lows, inspired by volatility-based oscillators.

Entry signals are generated when specific conditions align, indicating potential buying opportunities. Exits are triggered based on predefined thresholds or partial position closures to manage risk. The strategy supports customizable lookback periods, thresholds, and exit percentages, allowing flexibility across different markets and timeframes. Visual cues, such as entry/exit dots and a position table, enhance usability, while optional overlays like moving averages and Bollinger Bands provide additional chart context.

Calculation Overview
Price Range Calculations:
Short-Term Range: Uses the lowest low (min_price_short) and highest high (max_price_short) over a user-defined short lookback period (lookback_short, default 50 bars).

Long-Term Range: Uses the lowest low (min_price_long) and highest high (max_price_long) over a user-defined long lookback period (lookback_long, default 200 bars).

Percentage Metrics:
pct_above_short: Percentage of the current close above the short-term range.

pct_above_long: Percentage of the current close above the long-term range.

Combined metrics (pct_above_long_above_short, pct_below_long_below_short) normalize price action for signal generation.

Signal Generation:
Long Entry (TPM): Triggered when pct_above_long_above_short crosses above a user-defined threshold (entryThresholdhigh, default 20) and pct_below_long_below_short is below a low threshold (entryThresholdlow, default 40).

Long Entry (Fear EKG): Triggered when pct_below_long_below_short crosses under an extreme threshold (orangeEntryThreshold, default 95), indicating potential oversold conditions.

Long Exit: Triggered when pct_above_long_above_short crosses under a profit-taking level (profitTake, default 95). Partial exits are supported via a user-defined percentage (exitAmt, default 50%).

Non-Repainting Logic: Signals are calculated using data from the previous bar ([1]) and only plotted on confirmed bars (barstate.isconfirmed), ensuring reliability.

Visual Enhancements:
Optional moving averages (SMA, EMA, WMA, VWMA, or SMMA) and Bollinger Bands can be enabled for trend context.

A position table displays real-time metrics, including open positions, Fear EKG, and Ticker Pulse values.

Background highlights mark periods of high selling pressure.

Entry Rules
Long Entry:
TPM Signal: Occurs when the price shows strength relative to both short- and long-term ranges, as defined by pct_above_long_above_short crossing above entryThresholdhigh and pct_below_long_below_short below entryThresholdlow.

Fear EKG Signal: Triggered by extreme selling pressure, when pct_below_long_below_short crosses under orangeEntryThreshold. This signal is optional and can be toggled via enable_yellow_signals.

Entries are executed only on confirmed bars to prevent repainting.

Exit Rules
Long Exit: Triggered when pct_above_long_above_short crosses under profitTake.

Partial exits are supported, with the strategy closing a user-defined percentage of the position (exitAmt) up to four times per position (exit_count limit).

Exits can be disabled or adjusted via enable_short_signal and exitPercentage settings.

Inputs
Backtest Start Date: Defines the start of the backtesting period (default: Jan 1, 2017).

Lookback Periods: Short (lookback_short, default 50) and long (lookback_long, default 200) periods for range calculations.

Resolution: Timeframe for price data (default: Daily).

Entry/Exit Thresholds:
entryThresholdhigh (default 20): Threshold for TPM entry.

entryThresholdlow (default 40): Secondary condition for TPM entry.

orangeEntryThreshold (default 95): Threshold for Fear EKG entry.

profitTake (default 95): Exit threshold.

exitAmt (default 50%): Percentage of position to exit.

Visual Options: Toggle for moving averages and Bollinger Bands, with customizable types and lengths.

Notes
The strategy is designed to work across various timeframes and assets, with data sourced from user-selected resolutions (i_res).

Alerts are included for long entry and exit signals, facilitating integration with TradingView's alert system.

The script avoids repainting by using confirmed bar data and shifted calculations ([1]).

Visual elements (e.g., SMA, Bollinger Bands) are inspired by standard Pine Script practices and are optional, not integral to the core logic.

Usage
Apply the script to a chart, adjust input settings to suit your trading style, and use the visual cues (entry/exit dots, position table) to monitor signals. Enable alerts for real-time notifications.

Designed to work best on Daily timeframe.

Note di rilascio
Updated properties tab to include realistic commission of 1% and slippage of 15 ticks. Check with your broker regarding commissions and update accordingly. Slippage may vary as well depending on the asset being traded.

Updated Initial capital to $5,000, updated Order size to $300 USD, 0.06% of total capital, a reasonable amount of risk per trade and allow for a max of 5 trades deep, so roughly no more than roughly $1,500 out there in working capital, or roughly 30% of total capital ($5,000).

Extended the backtesting period to 01/01/2000 (~24.5 years) to allow for adequate trade volumes and strengthen backtesting results.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.