Hull Suite StrategyConverted the hull suite into a strategy script for easy backtesting and added ability to specify a time periods to backtest over.
Поиск скриптов по запросу "backtesting"
SupterTrend I created this script for basically two reasons
1. there is not simple suptertrend indicator available on tv rather you will find many fancy suptrend indicators with confusing other indicators and absurd background colors i dont know why some of the trader coders are obsessed with is using over the top color and designing phenomena.
2. I want to let people know about the accuracy of suptertrend indicator on multiple time frames i am plaining to create a backtesting tool for almost all Famous indicators so that specially new folks know what should they expect from any particular Indicator
Also i added intraday filter to check the results for intrday signals . the sqaure off timings are for Indian markets only but you can edit the hours and minutes in the code for using other than indian markets. No need to do anything if you only want positional trading trading results
Patient Trendfollower (7)(alpha) Backtesting AlgorithmThis is an alpha version of backtesting algorithm for my Patient Trendfollower (7) strategy. It can help you adapt the indicator to other charts than EURUSD. Please bear in mind that price action, volume profiles and supzistences are a catalyst for successful trading, not an indicator. You can get significantly better results if you use these things in your trading and use Trendfollower only as a secondary tool.
Patient Trendfollower Indicator
Thanks belongs to @everget and Satik FX, their contributions are highlighted on an indicator page.
BO - RSI - M5 BacktestingBO - RSI - M5 Backtesting -Rule of Strategy
A. Data
1. Chart M5 IDC
2. Symbol: EURJPY
B. Indicator
1. RSI
2. Length: 12 (adjustable)
3. Extreme Top: 75 (adjustable)
4. Extreme Bottom: 25 (adjustable)
C. Rule of Signal
1. Put Signal
* Rsi create a temporary peak over Extreme Top
row61: peak_rsi= rsi >rsi and rsi >rsi and rsi rsi_top
2. Call Signal
* Rsi create a temporary bottom under Extreme Bottom
row62: bott_rsi= rsi rsi and rsi
UT Bot Strategy with Backtesting Range [QuantNomad]UT Bot indicator was inially developer by @Yo_adriiiiaan
Idea of original code belongs @HPotter
I can't update my original UT Bot Strategy so I publishing new strategy with backtesting range included.
I just took code of Yo_adriiiiaan, cleaned it, deleted all useless pieces of code, transformet to v4 and created a strategy from it.
Also I added an input that allows you to swich to signals from Heiking Ashi. I saw that author uses HA for the indicator and on HA it look much nices then on real candles.
Do not add this strategy to HA candles, use usual candles and this checkbox.
Original script:
UT Bot
SuperTrend BacktesterThis is a backtesting script for the famous Super Trend.
Features
- Custom Date Range
- Custom Targets and Risks
Requested by Dlatrella
CS Basic Scripts - Stochastic Special (Strategy)This Stochastic Special Strategy features inputs for:
- Custom Backtesting Date Range
- Long and Short Strategy Discinctions
- Utilize SMI, RSI, Martingale, and Body-Filter Strategy
- Adjust the SMI Percent Lengths and Limit
- Automate with the Autoview Trading Bot
Strategy script may be tested by favoriting and adding to any chart.
Study script is available for automated trading at www.cryptoscores.org
Deviation Back Tester (Great for Credit Spreads)!Error with math fixed in this one. Please use this one.
This is great for credit spreads! Lets say you wanted to know if you had sold a 15% OTM Bull Put vertical 2 months out, how often would you win? This Turns green if you would have been correct with your credit spread had it expired on that date, or red if you would've been wrong. Great for Back testing!
This could also be used for ATM debit spreads credit spreads etc. Example, how often does SPY deviate outside a 10% range relative to two months, 5% (if your doing straddles perhaps) etc.
This Can be used with any stock.
PLEASE KEEP IN MIND THAT IT TESTS DEVIATION IN BOTH DIRECTIONS. THEREFORE IT WILL HIGHLIGHT RED ON BOTH THE UPSIDE AND DOWNSIDE. WHEN BACKTESTING BE SURE TO CHECK WHETHER IT IS RED BECAUSE OF DOWNSIDE OR UPSIDE.
Simple Candle Info This script shows the following simple information about the last candle:
- Candle size
- Body size included %
- Top Wick size
- Bottom Wick size
- Top Wick + Body size
- Bottom Wick + Body size
You can change:
- colors and position for labels
- add information for previous candle too
- change language
Laguerre RSI by KivancOzbilgic STRATEGYBacktesting.
" Laguerre RSI is based on John EHLERS' Laguerre Filter to avoid the noise of RSI .
Change alpha coefficient to increase/decrease lag and smoothness.
Buy when Laguerre RSI crosses upwards above 20.
Sell when Laguerre RSI crosses down below 80.
While indicator runs flat above 80 level, it means that an uptrend is strong.
While indicator runs flat below 20 level, it means that a downtrend is strong. "
Developer: John EHLERS
Author: KivancOzbilgic
Simple Price Momentum - How To Create A Simple Trading StrategyThis script was built using a logical approach to trading systems. All the details can be found in a step by step guide below. I hope you enjoy it. I am really glad to be part of this community. Thank you all. I hope you not only succeed on your trading career but also enjoy it.
docs.google.com
Moving Averages Cross - MTF - StrategyBacktesting Script for the following strategy
Strategy Injector Source: github.com
Dual Timeframe SMA Ribbon Crossover Backtest// Backtesting Dual SMA Ribbon Crossover Strategy
// see f.bpcdn.co
// including time limiting
Turned this study into a backtest.
Hash Ember StackOverview
Hash Ember Stack is a multi-period momentum visualizer that displays a structured view of market pressure across ten different lookback windows. It is designed to help operators assess how momentum behaves across short-term, intermediate, and long-term horizons using a unified ribbon-stack format.
The tool does not generate trading entries by itself; instead, it organizes momentum data so traders can better understand how multiple timeframes align or diverge.
Conceptual Framework
The indicator calculates momentum using one of three oscillator families:
RSI – measures velocity and magnitude of price movement
Stochastic – compares close relative to recent range
CCI – measures deviation from the average price
Each oscillator is normalized into a comparable 0–100 scale so all periods can share the same heatmap color logic. This creates a consistent visual framework regardless of which momentum type is selected.
The ten lookback periods range from very short (fast response) to very long (structural regime). Displaying them together helps illustrate momentum compression, expansion, clustering, or divergence across timeframes.
Ribbon Structure & Visual System
Each period is represented as a horizontal band (“ribbon”) with:
A fixed vertical height for readability
A heat-mapped color derived from momentum value
Optional spacing between ribbons to improve separation
The color system transitions from green (momentum weakness), through neutral tones, into red (momentum strength). These colors do not predict price direction; they simply map oscillator values into a standardized visual gradient.
Labels may be shown on the right side to indicate each ribbon’s lookback period.
Extreme Condition Detection (Optional)
The indicator can highlight situations where several momentum periods reach extreme conditions at the same time.
Oversold status is defined by user-selected thresholds
Overbought status uses an upper threshold
A fluorescent cross is plotted when a minimum number of ribbons meet these definitions
These markers do not produce trading signals; they are intended only to highlight statistically uncommon clustering of extreme momentum readings.
Inputs & Controls
Momentum Type – Selects which oscillator family is used
Smoothing – Applies an SMA to reduce noise
Ten customizable lookback periods – Short to macro momentum
Ribbon Height & Gap – Adjusts layout density
Period Labels – Enables lookback annotations
Extreme Signal Settings – Thresholds and minimum ribbon count
Signal Position – Above or below the ribbon stack
Intended Use
Hash Ember Stack is suitable for:
Identifying how different time horizons align
Visualizing periods of momentum compression and expansion
Contextualizing reversals or trend continuation environments
Supporting discretionary or systematic analysis workflows
The indicator is not a strategy and does not perform backtesting or place trades. It provides structured momentum context that operators can integrate into their own decision-making frameworks.
Penny Stock Short Signal Pro# Penny Stock Short Signal Pro (PSSP) v1.0
## Complete User Guide & Documentation
---
# 📋 TABLE OF CONTENTS
1. (#introduction)
2. (#why-short-penny-stocks)
3. (#the-7-core-detection-systems)
4. (#installation--setup)
5. (#understanding-the-dashboard)
6. (#input-settings-deep-dive)
7. (#visual-elements-explained)
8. (#alert-configuration)
9. (#trading-strategies)
10. (#risk-management)
11. (#best-practices)
12. (#troubleshooting)
13. (#changelog)
---
# Introduction
**Penny Stock Short Signal Pro (PSSP)** is a comprehensive Pine Script v6 indicator specifically engineered for identifying high-probability short-selling opportunities on low-priced, high-volatility stocks. Unlike generic indicators that apply broad technical analysis, PSSP is purpose-built for the unique characteristics of penny stock price action—where parabolic moves, retail FOMO, and violent reversals create predictable patterns for prepared traders.
## Key Features
- **7 Independent Detection Systems** working in concert to identify exhaustion points
- **Composite Signal Engine** that requires multiple confirmations before triggering
- **Real-Time Dashboard** displaying all signal states and market metrics
- **Automatic Risk Management** with dynamic stop-loss and profit target calculations
- **Customizable Sensitivity** for different trading styles (scalping vs. swing)
- **Built-in Alert System** for all major signal types
## Who Is This For?
- **Active Day Traders** looking to capitalize on intraday reversals
- **Short Sellers** who specialize in penny stocks and small caps
- **Momentum Traders** who want to identify when momentum is exhausting
- **Risk-Conscious Traders** who need clear entry/exit levels
---
# Why Short Penny Stocks?
## The Penny Stock Lifecycle
Penny stocks follow a remarkably predictable lifecycle that creates shorting opportunities:
```
PHASE 1: ACCUMULATION
└── Low volume, tight range
└── Smart money quietly building positions
PHASE 2: MARKUP / PROMOTION
└── News catalyst or promotional campaign
└── Volume increases, price begins rising
└── Early momentum traders enter
PHASE 3: DISTRIBUTION (YOUR OPPORTUNITY)
└── Parabolic move attracts retail FOMO buyers
└── Smart money selling into strength
└── Volume climax signals exhaustion
└── ⚠️ PSSP SIGNALS FIRE HERE ⚠️
PHASE 4: DECLINE
└── Support breaks, panic selling
└── Price returns toward origin
└── Short sellers profit
```
## Why Shorts Work on Penny Stocks
1. **No Fundamental Support**: Most penny stocks have no earnings, revenue, or assets to justify elevated prices
2. **Promotional Nature**: Many rallies are driven by promoters who will eventually stop
3. **Retail Exhaustion**: Retail buying power is finite—when it's exhausted, gravity takes over
4. **Float Dynamics**: Low float stocks move fast in both directions
5. **Technical Levels Matter**: VWAP, round numbers, and prior highs become self-fulfilling resistance
---
# The 7 Core Detection Systems
PSSP employs seven independent detection algorithms. Each identifies a specific type of exhaustion or reversal signal. When multiple systems fire simultaneously, the probability of a successful short dramatically increases.
---
## 1. PARABOLIC EXHAUSTION DETECTOR
### What It Detects
Identifies when price has moved too far, too fast and is likely to reverse. This system looks for the classic "blow-off top" pattern common in penny stock runners.
### Technical Logic
```
Parabolic Signal = TRUE when:
├── Consecutive green candles ≥ threshold (default: 3)
├── AND price extension from VWAP ≥ threshold ATRs (default: 1.5)
└── OR shooting star / upper wick rejection pattern forms
```
### Visual Representation
```
╱╲ ← Shooting star / upper wick
╱ ╲ (Parabolic exhaustion)
╱
╱
╱
══════════════ VWAP
╱
╱
```
### Why It Works on Penny Stocks
Penny stocks are notorious for parabolic moves driven by retail FOMO. When everyone who wants to buy has bought, there's no one left to push prices higher. The shooting star pattern shows that sellers are already stepping in at higher prices.
### Key Settings
| Parameter | Default | Range | Description |
|-----------|---------|-------|-------------|
| Lookback Period | 10 | 3-30 | Bars to analyze for pattern |
| Extension Threshold | 1.5 ATR | 0.5-5.0 | How far above VWAP is "parabolic" |
| Consecutive Green Bars | 3 | 2-10 | Minimum green bars for exhaustion |
---
## 2. VWAP REJECTION SYSTEM
### What It Detects
Volume Weighted Average Price (VWAP) is the single most important level for institutional traders. This system identifies when price tests above VWAP and gets rejected back below—a powerful short signal.
### Technical Logic
```
VWAP Rejection = TRUE when:
├── Candle high pierces above VWAP
├── AND candle closes below VWAP
├── AND candle is bearish (close < open)
└── AND rejection distance is within sensitivity threshold
```
### Visual Representation
```
High ──→ ╱╲
╱ ╲
VWAP ════════╱════╲═══════════
Close ←── Rejection
```
### Extended VWAP Signals
The system also tracks VWAP standard deviation bands. Rejection from the upper band (2 standard deviations above VWAP) is an even stronger signal.
### Why It Works on Penny Stocks
- Algorithms and institutions use VWAP as their benchmark
- Failed attempts to reclaim VWAP often lead to waterfall selling
- VWAP acts as a "magnet" that price tends to revert toward
### Key Settings
| Parameter | Default | Range | Description |
|-----------|---------|-------|-------------|
| Rejection Sensitivity | 0.5 ATR | 0.1-2.0 | How close to VWAP for valid rejection |
| Show VWAP Line | True | - | Display VWAP on chart |
| Show VWAP Bands | True | - | Display standard deviation bands |
| Band Multiplier | 2.0 | 0.5-4.0 | Standard deviations for bands |
---
## 3. VOLUME CLIMAX DETECTOR
### What It Detects
Identifies "blow-off tops" where extreme volume accompanies a price spike. This often marks the exact top as it represents maximum retail participation—after which buying power is exhausted.
### Technical Logic
```
Volume Climax = TRUE when:
├── Current volume ≥ (Average volume × Climax Multiple)
├── AND one of:
│ ├── Selling into the high (upper wick > lower wick on green bar)
│ └── OR post-climax weakness (red bar following climax bar)
```
### Visual Representation
```
Price: ╱╲
╱ ╲
╱ ╲
╱ ╲
╱
Volume:
▂▃▅▇██▇▅▃▂▁
↑
Volume Climax (3x+ average)
```
### Why It Works on Penny Stocks
- Retail traders pile in at the top, creating volume spikes
- Market makers and smart money use this liquidity to exit
- Once the volume spike passes, there's no fuel left for higher prices
- The "smart money selling into dumb money buying" creates the top
### Key Settings
| Parameter | Default | Range | Description |
|-----------|---------|-------|-------------|
| Volume MA Length | 20 | 5-50 | Period for average volume calculation |
| Climax Volume Multiple | 3.0x | 1.5-10.0 | Multiple of average for "climax" |
| Show Volume Bars | True | - | Visual volume representation |
---
## 4. RSI DIVERGENCE ANALYZER
### What It Detects
Bearish divergence occurs when price makes higher highs but RSI (momentum) makes lower highs. This indicates that momentum is weakening even as price pushes higher—a warning of imminent reversal.
### Technical Logic
```
Bearish Divergence = TRUE when:
├── RSI is in overbought territory (> threshold)
├── AND RSI is declining (current < previous < prior)
└── Indicates momentum exhaustion before price catches up
```
### Visual Representation
```
Price: /\ /\
/ \ / \ ← Higher high
/ \/
/
/
RSI: /\
/ \ /\
/ \/ \ ← Lower high (DIVERGENCE)
/ \
════════════════════ Overbought (70)
```
### Why It Works on Penny Stocks
- Penny stocks often push to new highs on weaker and weaker momentum
- Divergence signals that fewer buyers are participating at each new high
- Eventually, the lack of buying pressure leads to collapse
### Key Settings
| Parameter | Default | Range | Description |
|-----------|---------|-------|-------------|
| RSI Length | 14 | 5-30 | Standard RSI calculation period |
| Overbought Level | 70 | 60-90 | RSI level considered overbought |
| Divergence Lookback | 14 | 5-30 | Bars to look back for swing highs |
---
## 5. KEY LEVEL REJECTION TRACKER
### What It Detects
Identifies rejections from significant price levels where shorts are likely to be concentrated: High of Day (HOD), premarket highs, and psychological levels (whole and half dollars).
### Technical Logic
```
Level Rejection = TRUE when:
├── Price touches key level (within 0.2% tolerance)
├── AND candle is bearish (close < open)
├── AND close is in lower portion of candle range
│
├── Key Levels Tracked:
│ ├── High of Day (HOD)
│ ├── Premarket High
│ └── Psychological levels ($1.00, $1.50, $2.00, etc.)
```
### Visual Representation
```
HOD ─────────────────────────────────
╱╲ ← Rejection
╱ ╲
╱ ╲
╱
─────────────────────────────────
PM High ─────────────────────────────
```
### Why It Works on Penny Stocks
- **HOD**: The high of day is where the most traders are trapped long. Failure to break HOD often triggers stop-loss cascades
- **Premarket High**: Represents overnight enthusiasm; failure to exceed often means the "news" is priced in
- **Psychological Levels**: Round numbers ($1, $2, $5) attract orders and act as natural resistance
### Key Settings
| Parameter | Default | Range | Description |
|-----------|---------|-------|-------------|
| Track HOD Rejection | True | - | Monitor high of day |
| Track Premarket High | True | - | Monitor premarket resistance |
| Track Psychological Levels | True | - | Monitor round numbers |
---
## 6. FAILED BREAKOUT DETECTOR
### What It Detects
Identifies "bull traps" where price breaks above resistance but immediately fails and closes back below. This traps breakout buyers and often leads to accelerated selling.
### Technical Logic
```
Failed Breakout = TRUE when:
├── Price breaks above recent high (lookback period)
├── AND one of:
│ ├── Same bar closes below the breakout level
│ └── OR following bars show consecutive red candles
```
### Visual Representation
```
╱╲
╱ ╲ ← False breakout
Recent High ══╱════╲════════════════
╱ ╲
╱ ╲
╱ ╲ ← Trapped longs panic sell
```
### Why It Works on Penny Stocks
- Breakout traders enter on the break, providing exit liquidity for smart money
- When the breakout fails, these traders become trapped and must exit
- Their forced selling accelerates the decline
- Penny stocks have thin order books, making failed breakouts especially violent
### Key Settings
| Parameter | Default | Range | Description |
|-----------|---------|-------|-------------|
| Breakout Lookback | 5 | 2-15 | Bars to define "recent high" |
| Confirmation Bars | 2 | 1-5 | Bars to confirm failure |
---
## 7. MOVING AVERAGE BREAKDOWN SYSTEM
### What It Detects
Monitors exponential moving averages (EMAs) for bearish crossovers and price rejections. EMA crosses often signal trend changes, while rejections from EMAs indicate resistance.
### Technical Logic
```
MA Breakdown = TRUE when:
├── Bearish EMA cross (fast crosses below slow)
└── OR EMA rejection (price tests EMA from below and fails)
```
### Visual Representation
```
╱╲ ← Rejection from EMA
╱ ╲
EMA 9 ═══════════╱════╲═══════════
╲
EMA 20 ═══════════════════╲════════
╲
Bearish cross ↓
```
### Why It Works on Penny Stocks
- EMAs smooth out the noise and show underlying trend direction
- When fast EMA crosses below slow EMA, it signals momentum shift
- Rejected attempts to reclaim EMAs show sellers are in control
### Key Settings
| Parameter | Default | Range | Description |
|-----------|---------|-------|-------------|
| Fast EMA | 9 | 3-20 | Short-term trend |
| Slow EMA | 20 | 10-50 | Medium-term trend |
| Show EMAs | True | - | Display on chart |
---
# Installation & Setup
## Step 1: Access Pine Editor
1. Open TradingView (tradingview.com)
2. Open any chart
3. Click "Pine Editor" at the bottom of the screen
## Step 2: Create New Indicator
1. Click "Open" → "New blank indicator"
2. Delete any existing code
3. Paste the entire PSSP code
## Step 3: Save and Add to Chart
1. Click "Save" (give it a name like "PSSP")
2. Click "Add to chart"
3. The indicator will appear with default settings
## Step 4: Configure Settings
1. Click the gear icon (⚙️) on the indicator
2. Adjust settings based on your trading style (see Settings section)
3. Click "OK" to apply
## Recommended Chart Setup
- **Timeframe**: 1-minute or 5-minute for scalping, 15-minute for swing shorts
- **Chart Type**: Candlestick
- **Extended Hours**: Enable if trading premarket/afterhours
- **Volume**: Can disable default volume since PSSP tracks it
---
# Understanding the Dashboard
The real-time dashboard provides at-a-glance status of all systems:
```
┌─────────────────────────────────────────┐
│ 📊 SHORT SIGNAL DASHBOARD │
├─────────────────────────────────────────┤
│ Signal Strength: 5/7 │
├─────────────────────────────────────────┤
│ ─── ACTIVE SIGNALS ─── │
│ │
│ Parabolic Exhaustion 🔴 2.1 ATR │
│ VWAP Rejection 🔴 Above │
│ Volume Climax 🔴 4.2x Avg │
│ RSI Divergence ⚪ RSI: 68 │
│ Level Rejection 🔴 @ HOD │
│ Failed Breakout 🔴 │
│ MA Breakdown ⚪ Bullish │
├─────────────────────────────────────────┤
│ ─── RISK LEVELS ─── │
│ Stop: $2.45 T1: $2.10 T2: $1.85 │
└─────────────────────────────────────────┘
```
## Dashboard Elements Explained
### Signal Strength Indicator
| Rating | Signals | Color | Interpretation |
|--------|---------|-------|----------------|
| STRONG | 5-7 | Red | High-confidence short opportunity |
| MODERATE | 3-4 | Orange | Decent setup, consider other factors |
| WEAK | 1-2 | Gray | Insufficient confirmation |
| NONE | 0 | Gray | No short signals active |
### Signal Status Icons
- 🔴 = Signal is ACTIVE (condition met)
- ⚪ = Signal is INACTIVE (condition not met)
### Contextual Metrics
Each signal row includes relevant metrics:
- **Parabolic**: Shows ATR extension from VWAP
- **VWAP**: Shows if price is Above/Below VWAP
- **Volume**: Shows current volume as multiple of average
- **RSI**: Shows current RSI value
- **Level**: Shows which level was touched (HOD, PM High, etc.)
- **MA**: Shows EMA relationship (Bullish/Bearish)
### Risk Levels
When a composite short signal fires:
- **Stop**: Suggested stop-loss level (high + ATR multiple)
- **T1**: First profit target (1:1 risk/reward)
- **T2**: Second profit target (user-defined R:R)
---
# Input Settings Deep Dive
## Group 1: Parabolic Exhaustion
| Setting | Default | Conservative | Aggressive | Description |
|---------|---------|--------------|------------|-------------|
| Enable | True | True | True | Turn system on/off |
| Lookback Period | 10 | 15 | 5 | Bars analyzed for pattern |
| Extension Threshold | 1.5 | 2.0 | 1.0 | ATRs above VWAP for "parabolic" |
| Consecutive Green Bars | 3 | 4 | 2 | Minimum green bars required |
**Tuning Tips:**
- Lower thresholds = more signals but more false positives
- Higher thresholds = fewer signals but higher quality
- For very volatile penny stocks, consider higher thresholds
## Group 2: VWAP Rejection
| Setting | Default | Conservative | Aggressive | Description |
|---------|---------|--------------|------------|-------------|
| Enable | True | True | True | Turn system on/off |
| Rejection Sensitivity | 0.5 | 0.3 | 0.8 | ATR distance for valid rejection |
| Show VWAP Line | True | True | True | Display VWAP |
| Show VWAP Bands | True | True | True | Display deviation bands |
| Band Multiplier | 2.0 | 2.5 | 1.5 | Standard deviations for bands |
**Tuning Tips:**
- Tighter sensitivity (lower number) = must reject very close to VWAP
- Wider bands = less frequent upper band rejections but more significant
## Group 3: Volume Climax
| Setting | Default | Conservative | Aggressive | Description |
|---------|---------|--------------|------------|-------------|
| Enable | True | True | True | Turn system on/off |
| Volume MA Length | 20 | 30 | 10 | Baseline volume period |
| Climax Volume Multiple | 3.0 | 4.0 | 2.0 | Multiple for "climax" status |
| Show Volume Profile | True | True | True | Visual volume bars |
**Tuning Tips:**
- Higher multiple = only extreme volume spikes trigger
- Shorter MA = more responsive to recent volume changes
- For highly liquid stocks, consider higher multiples
## Group 4: Momentum Divergence
| Setting | Default | Conservative | Aggressive | Description |
|---------|---------|--------------|------------|-------------|
| Enable | True | True | True | Turn system on/off |
| RSI Length | 14 | 21 | 7 | RSI calculation period |
| Overbought Level | 70 | 75 | 65 | Threshold for "overbought" |
| Divergence Lookback | 14 | 20 | 10 | Bars for swing high detection |
**Tuning Tips:**
- Lower overbought threshold = more frequent signals
- Shorter RSI length = more responsive but noisier
## Group 5: Key Level Rejection
| Setting | Default | Description |
|---------|---------|-------------|
| Enable | True | Master toggle for level system |
| Track Premarket High | True | Monitor premarket resistance |
| Track HOD Rejection | True | Monitor high of day |
| Track Psychological Levels | True | Monitor round numbers |
**Tuning Tips:**
- Disable premarket tracking if stock doesn't have significant premarket activity
- Psychological levels work best on stocks under $10
## Group 6: Failed Follow-Through
| Setting | Default | Conservative | Aggressive | Description |
|---------|---------|--------------|------------|-------------|
| Enable | True | True | True | Turn system on/off |
| Breakout Lookback | 5 | 8 | 3 | Bars defining "recent high" |
| Confirmation Bars | 2 | 3 | 1 | Bars to confirm failure |
**Tuning Tips:**
- Shorter lookback = more breakouts detected but smaller significance
- More confirmation bars = higher confidence but later entry
## Group 7: Moving Average Signals
| Setting | Default | Conservative | Aggressive | Description |
|---------|---------|--------------|------------|-------------|
| Enable | True | True | True | Turn system on/off |
| Fast EMA | 9 | 12 | 5 | Short-term trend |
| Slow EMA | 20 | 26 | 13 | Medium-term trend |
| Show EMAs | True | True | True | Display on chart |
**Tuning Tips:**
- Standard 9/20 works well for most penny stocks
- Faster EMAs (5/13) for scalping, slower (12/26) for swing trading
## Group 8: Composite Signal
| Setting | Default | Conservative | Aggressive | Description |
|---------|---------|--------------|------------|-------------|
| Minimum Signals | 3 | 4-5 | 2 | Signals needed for trigger |
| Show Dashboard | True | True | True | Display signal table |
| Dashboard Position | top_right | - | - | Screen location |
**Tuning Tips:**
- **Minimum Signals is the most important setting**
- Higher minimum = fewer trades but higher win rate
- Lower minimum = more trades but more false signals
## Group 9: Risk Management
| Setting | Default | Conservative | Aggressive | Description |
|---------|---------|--------------|------------|-------------|
| Show Stop Levels | True | True | True | Display stop loss |
| Stop ATR Multiple | 1.5 | 2.0 | 1.0 | Stop distance in ATRs |
| Show Targets | True | True | True | Display profit targets |
| Target R:R | 2.0 | 1.5 | 3.0 | Risk:Reward for Target 2 |
**Tuning Tips:**
- Tighter stops (lower ATR multiple) = less risk but more stop-outs
- Higher R:R targets = bigger winners but fewer targets hit
## Group 10: Visual Settings
| Setting | Default | Description |
|---------|---------|-------------|
| Bullish Color | Green | Color for bullish elements |
| Bearish Color | Red | Color for bearish/short signals |
| Warning Color | Orange | Color for caution signals |
| Neutral Color | Gray | Color for inactive elements |
---
# Visual Elements Explained
## Chart Overlays
### VWAP Line (Blue)
- **Solid blue line** = Volume Weighted Average Price
- Price above VWAP = bullish bias
- Price below VWAP = bearish bias
- **Use**: Short when price rejects from above VWAP
### VWAP Bands (Purple circles)
- Upper band = 2 standard deviations above VWAP
- Lower band = 2 standard deviations below VWAP
- **Use**: Extreme extension to upper band signals potential reversal
### EMAs (Orange and Red)
- **Orange line** = Fast EMA (9-period default)
- **Red line** = Slow EMA (20-period default)
- **Use**: Bearish cross or price rejection from EMAs confirms short
### HOD Line (Red, dashed)
- Shows the current day's high
- **Use**: Rejection from HOD is a key short signal
### Premarket High (Orange, dashed)
- Shows premarket session high
- **Use**: Failure to break PM high often signals weakness
## Signal Markers
### Individual Signal Markers (Small)
| Shape | Color | Signal |
|-------|-------|--------|
| ▼ Triangle | Purple | Parabolic Exhaustion |
| ✕ X-Cross | Blue | VWAP Rejection |
| ◆ Diamond | Yellow | Volume Climax |
| ● Circle | Orange | RSI Divergence |
| ■ Square | Red | Failed Breakout |
### Composite Short Signal (Large)
- **Large red triangle** with "SHORT" text
- Only appears when minimum signal threshold is met
- This is your primary trading signal
## Risk Level Lines
### Stop Loss (Red line)
- Calculated as: Entry + (ATR × Stop Multiple)
- Represents maximum acceptable loss
- **RESPECT THIS LEVEL**
### Target 1 (Light green line)
- First profit target at 1:1 risk/reward
- Consider taking partial profits here
### Target 2 (Dark green line)
- Second profit target at user-defined R:R
- Let winners run to this level
## Background Coloring
### Light Red Background
- Appears when composite short signal is active
- Indicates you should be looking for shorts, not longs
### Light Purple Background
- Appears during extreme parabolic extension
- Warning of potential imminent reversal
---
# Alert Configuration
## Available Alerts
### 1. Composite Short Signal
**Best for**: Primary trading signal
```
Condition: Composite short signal fires
Message: "PSSP: Short Signal Triggered - {ticker} at {close}"
```
### 2. Parabolic Exhaustion
**Best for**: Early warning of potential top
```
Condition: Parabolic exhaustion detected
Message: "PSSP: Parabolic exhaustion detected on {ticker}"
```
### 3. Volume Climax
**Best for**: Blow-off top identification
```
Condition: Volume climax occurs
Message: "PSSP: Volume climax / blow-off top on {ticker}"
```
### 4. Strong Short Setup (5+ Signals)
**Best for**: High-confidence opportunities only
```
Condition: 5 or more signals active
Message: "PSSP: STRONG short setup on {ticker}"
```
### 5. Very Strong Short Setup (6+ Signals)
**Best for**: Maximum confidence trades
```
Condition: 6 or more signals active
Message: "PSSP: VERY STRONG short setup on {ticker}"
```
### 6. Failed Breakout
**Best for**: Bull trap identification
```
Condition: Failed breakout detected
Message: "PSSP: Failed breakout detected on {ticker}"
```
### 7. Key Level Rejection
**Best for**: Resistance level plays
```
Condition: Key level rejection occurs
Message: "PSSP: Key level rejection on {ticker}"
```
## Setting Up Alerts in TradingView
1. Right-click on the chart
2. Select "Add Alert"
3. Set Condition to "Penny Stock Short Signal Pro"
4. Choose your desired alert condition
5. Configure notification method (popup, email, webhook, etc.)
6. Set expiration (or "Open-ended" for permanent)
7. Click "Create"
## Alert Strategy Recommendations
### For Active Day Traders
- Enable: Composite Short Signal, Volume Climax
- Set to: Popup + Sound
- Check frequently during market hours
### For Swing Traders
- Enable: Strong Short Setup (5+), Very Strong Short Setup (6+)
- Set to: Email + Mobile Push
- Review at key times (open, lunch, close)
### For Part-Time Traders
- Enable: Very Strong Short Setup (6+) only
- Set to: Email + SMS
- Only trade highest-conviction setups
---
# Trading Strategies
## Strategy 1: The Parabolic Fade
**Setup Requirements:**
- Parabolic Exhaustion signal ACTIVE
- Extension from VWAP ≥ 2.0 ATR
- Volume climax or declining volume on push
**Entry:**
- Short on first red candle after signal
- Or short on break below prior candle's low
**Stop Loss:**
- Above the high of the parabolic move
- Maximum: 1.5 ATR above entry
**Targets:**
- T1: VWAP (take 50% off)
- T2: Lower VWAP band or LOD
**Best Time:** 9:30-10:30 AM (morning runners)
---
## Strategy 2: VWAP Rejection Short
**Setup Requirements:**
- VWAP Rejection signal ACTIVE
- Price came from below VWAP
- Rejection candle has significant upper wick
**Entry:**
- Short on close below VWAP
- Or short on break below rejection candle low
**Stop Loss:**
- Above VWAP + 0.5 ATR
- Or above rejection candle high
**Targets:**
- T1: Lower VWAP band
- T2: Prior support or LOD
**Best Time:** Midday (11:00 AM - 2:00 PM)
---
## Strategy 3: HOD Failure Short
**Setup Requirements:**
- Level Rejection signal ACTIVE (HOD)
- Multiple tests of HOD without breakthrough
- Volume declining on each test
**Entry:**
- Short on confirmed HOD rejection
- Wait for close below the rejection candle
**Stop Loss:**
- Above HOD + 0.25 ATR (tight)
- Clear invalidation if HOD breaks
**Targets:**
- T1: VWAP
- T2: Morning support levels
**Best Time:** 10:30 AM - 12:00 PM
---
## Strategy 4: Volume Climax Fade
**Setup Requirements:**
- Volume Climax signal ACTIVE
- Volume ≥ 3x average on green candle
- Followed by bearish candle or upper wick
**Entry:**
- Short on first red candle after climax
- Or short on break below climax candle low
**Stop Loss:**
- Above climax candle high
- Give room for volatility spike
**Targets:**
- T1: 50% retracement of the run
- T2: VWAP or start of the run
**Best Time:** First hour of trading
---
## Strategy 5: The Full Composite (High Conviction)
**Setup Requirements:**
- Composite Short signal ACTIVE
- Minimum 4-5 individual signals
- Clear visual of signal markers clustering
**Entry:**
- Short immediately on composite signal
- Use market order for fast-moving stocks
**Stop Loss:**
- Use indicator's automatic stop level
- Do not deviate from system
**Targets:**
- T1: Indicator's T1 level (1:1)
- T2: Indicator's T2 level (2:1)
**Best Time:** Any time with sufficient signals
---
# Risk Management
## Position Sizing Formula
```
Position Size = (Account Risk %) / (Stop Loss %)
Example:
- Account: $25,000
- Risk per trade: 1% = $250
- Entry: $2.00
- Stop: $2.20 (10% stop)
- Position Size: $250 / 10% = $2,500 worth
- Shares: $2,500 / $2.00 = 1,250 shares
```
## Risk Rules
### The 1% Rule
Never risk more than 1% of your account on any single trade. For a $25,000 account, max risk = $250.
### The 2x Stop Rule
If your stop gets hit twice on the same stock, stop trading it for the day. The pattern isn't working.
### The Daily Loss Limit
Set a maximum daily loss (e.g., 3% of account). Stop trading if hit.
### The Size-Down Rule
After a losing trade, reduce your next position size by 50%. Rebuild after a winner.
## Short-Specific Risks
### The Short Squeeze
- Penny stocks can squeeze violently
- ALWAYS use stops
- Never "hope" a position comes back
- Size appropriately for volatility
### The Hard-to-Borrow
- Check borrow availability before trading
- High borrow fees eat into profits
- Some stocks become HTB mid-trade
### The Halt Risk
- Penny stocks can halt on volatility
- Position size for worst-case halt against you
- Halts can open significantly higher
---
# Best Practices
## DO's
✅ **Wait for multiple signals** - Single signals have lower accuracy
✅ **Trade with the trend** - Short when daily trend is down
✅ **Use the dashboard** - Check signal count before entering
✅ **Respect stops** - The indicator calculates them for a reason
✅ **Size appropriately** - Penny stocks are volatile; position small
✅ **Trade liquid stocks** - Volume ≥ 500K daily average
✅ **Know the catalyst** - Understand why the stock is moving
✅ **Take partial profits** - Secure gains at T1
✅ **Journal your trades** - Track what works and what doesn't
✅ **Time your entries** - Best shorts often come 10:30-11:30 AM
## DON'Ts
❌ **Don't short strong stocks** - If it won't go down, don't force it
❌ **Don't fight the tape** - A stock going up can keep going up
❌ **Don't average up on losers** - Adding to losing shorts is dangerous
❌ **Don't ignore the dashboard** - It exists to help you
❌ **Don't overtrade** - Quality over quantity
❌ **Don't short into news** - Wait for the reaction first
❌ **Don't trade the first 5 minutes** - Too chaotic for reliable signals
❌ **Don't hold overnight** - Penny stock gaps can destroy accounts
❌ **Don't trade without stops** - Ever.
❌ **Don't trade on tilt** - After losses, take a break
## Optimal Trading Windows
| Time (ET) | Quality | Notes |
|-----------|---------|-------|
| 9:30-9:35 | ⭐ | Too volatile, avoid |
| 9:35-10:30 | ⭐⭐⭐⭐⭐ | Best shorts, morning runners exhaust |
| 10:30-11:30 | ⭐⭐⭐⭐ | Secondary exhaustion, HOD rejections |
| 11:30-2:00 | ⭐⭐ | Midday lull, lower quality |
| 2:00-3:00 | ⭐⭐⭐ | Afternoon setups develop |
| 3:00-3:30 | ⭐⭐⭐⭐ | End of day momentum |
| 3:30-4:00 | ⭐⭐ | Closing volatility, risky |
---
# Troubleshooting
## Common Issues
### "Signals aren't appearing"
- Check that the relevant system is enabled in settings
- Ensure minimum signals threshold isn't too high
- Verify the stock has sufficient volume for calculations
### "Too many false signals"
- Increase minimum signals threshold
- Use more conservative settings (see Settings section)
- Focus on stocks with cleaner price action
### "Dashboard not showing"
- Ensure "Show Signal Dashboard" is enabled
- Check that your chart has enough space
- Try a different dashboard position
### "VWAP line is missing"
- VWAP requires intraday timeframes (1m, 5m, 15m, etc.)
- VWAP resets daily; won't show on daily+ charts
- Ensure "Show VWAP Line" is enabled
### "Stop loss seems too tight/wide"
- Adjust Stop ATR Multiple in Risk Management settings
- Lower multiple = tighter stop
- Higher multiple = wider stop
### "Alerts not triggering"
- Verify alert is set to the correct indicator
- Check that alert hasn't expired
- Ensure notification settings are configured in TradingView
## Performance Optimization
If the indicator is slow:
1. Reduce the number of visual elements shown
2. Disable unused signal systems
3. Use on fewer simultaneous charts
4. Close unused browser tabs
---
# Changelog
## Version 1.0 (Initial Release)
- 7 core detection systems implemented
- Real-time signal dashboard
- Automatic risk management calculations
- 7 alert conditions
- Full visual overlay system
- Comprehensive input settings
## Planned Features (Future Updates)
- Scanner integration for multi-stock screening
- Machine learning signal weighting
- Backtesting statistics panel
- Volume profile analysis
- Level 2 data integration (if available)
- Custom timeframe VWAP options
---
# Support & Feedback
## Reporting Issues
When reporting issues, please include:
1. TradingView username
2. Stock symbol and timeframe
3. Screenshot of the issue
4. Your indicator settings
5. Steps to reproduce
## Feature Requests
We welcome suggestions for improving PSSP. Consider:
- What specific pattern are you trying to catch?
- How would this help your trading?
- Any reference examples?
---
# Disclaimer
**IMPORTANT: This indicator is for educational and informational purposes only.**
- Past performance does not guarantee future results
- Short selling carries unlimited risk potential
- Always use proper position sizing and stop losses
- Paper trade before using real capital
- The creator assumes no liability for trading losses
- Consult a financial advisor before trading
**Trade at your own risk.**
---
*Penny Stock Short Signal Pro v1.0*
*Pine Script v6*
*© 2025*
Game Theory Trading StrategyGame Theory Trading Strategy: Explanation and Working Logic
This Pine Script (version 5) code implements a trading strategy named "Game Theory Trading Strategy" in TradingView. Unlike the previous indicator, this is a full-fledged strategy with automated entry/exit rules, risk management, and backtesting capabilities. It uses Game Theory principles to analyze market behavior, focusing on herd behavior, institutional flows, liquidity traps, and Nash equilibrium to generate buy (long) and sell (short) signals. Below, I'll explain the strategy's purpose, working logic, key components, and usage tips in detail.
1. General Description
Purpose: The strategy identifies high-probability trading opportunities by combining Game Theory concepts (herd behavior, contrarian signals, Nash equilibrium) with technical analysis (RSI, volume, momentum). It aims to exploit market inefficiencies caused by retail herd behavior, institutional flows, and liquidity traps. The strategy is designed for automated trading with defined risk management (stop-loss/take-profit) and position sizing based on market conditions.
Key Features:
Herd Behavior Detection: Identifies retail panic buying/selling using RSI and volume spikes.
Liquidity Traps: Detects stop-loss hunting zones where price breaks recent highs/lows but reverses.
Institutional Flow Analysis: Tracks high-volume institutional activity via Accumulation/Distribution and volume spikes.
Nash Equilibrium: Uses statistical price bands to assess whether the market is in equilibrium or deviated (overbought/oversold).
Risk Management: Configurable stop-loss (SL) and take-profit (TP) percentages, dynamic position sizing based on Game Theory (minimax principle).
Visualization: Displays Nash bands, signals, background colors, and two tables (Game Theory status and backtest results).
Backtesting: Tracks performance metrics like win rate, profit factor, max drawdown, and Sharpe ratio.
Strategy Settings:
Initial capital: $10,000.
Pyramiding: Up to 3 positions.
Position size: 10% of equity (default_qty_value=10).
Configurable inputs for RSI, volume, liquidity, institutional flow, Nash equilibrium, and risk management.
Warning: This is a strategy, not just an indicator. It executes trades automatically in TradingView's Strategy Tester. Always backtest thoroughly and use proper risk management before live trading.
2. Working Logic (Step by Step)
The strategy processes each bar (candle) to generate signals, manage positions, and update performance metrics. Here's how it works:
a. Input Parameters
The inputs are grouped for clarity:
Herd Behavior (🐑):
RSI Period (14): For overbought/oversold detection.
Volume MA Period (20): To calculate average volume for spike detection.
Herd Threshold (2.0): Volume multiplier for detecting herd activity.
Liquidity Analysis (💧):
Liquidity Lookback (50): Bars to check for recent highs/lows.
Liquidity Sensitivity (1.5): Volume multiplier for trap detection.
Institutional Flow (🏦):
Institutional Volume Multiplier (2.5): For detecting large volume spikes.
Institutional MA Period (21): For Accumulation/Distribution smoothing.
Nash Equilibrium (⚖️):
Nash Period (100): For calculating price mean and standard deviation.
Nash Deviation (0.02): Multiplier for equilibrium bands.
Risk Management (🛡️):
Use Stop-Loss (true): Enables SL at 2% below/above entry price.
Use Take-Profit (true): Enables TP at 5% above/below entry price.
b. Herd Behavior Detection
RSI (14): Checks for extreme conditions:
Overbought: RSI > 70 (potential herd buying).
Oversold: RSI < 30 (potential herd selling).
Volume Spike: Volume > SMA(20) x 2.0 (herd_threshold).
Momentum: Price change over 10 bars (close - close ) compared to its SMA(20).
Herd Signals:
Herd Buying: RSI > 70 + volume spike + positive momentum = Retail buying frenzy (red background).
Herd Selling: RSI < 30 + volume spike + negative momentum = Retail selling panic (green background).
c. Liquidity Trap Detection
Recent Highs/Lows: Calculated over 50 bars (liquidity_lookback).
Psychological Levels: Nearest round numbers (e.g., $100, $110) as potential stop-loss zones.
Trap Conditions:
Up Trap: Price breaks recent high, closes below it, with a volume spike (volume > SMA x 1.5).
Down Trap: Price breaks recent low, closes above it, with a volume spike.
Visualization: Traps are marked with small red/green crosses above/below bars.
d. Institutional Flow Analysis
Volume Check: Volume > SMA(20) x 2.5 (inst_volume_mult) = Institutional activity.
Accumulation/Distribution (AD):
Formula: ((close - low) - (high - close)) / (high - low) * volume, cumulated over time.
Smoothed with SMA(21) (inst_ma_length).
Accumulation: AD > MA + high volume = Institutions buying.
Distribution: AD < MA + high volume = Institutions selling.
Smart Money Index: (close - open) / (high - low) * volume, smoothed with SMA(20). Positive = Smart money buying.
e. Nash Equilibrium
Calculation:
Price mean: SMA(100) (nash_period).
Standard deviation: stdev(100).
Upper Nash: Mean + StdDev x 0.02 (nash_deviation).
Lower Nash: Mean - StdDev x 0.02.
Conditions:
Near Equilibrium: Price between upper and lower Nash bands (stable market).
Above Nash: Price > upper band (overbought, sell potential).
Below Nash: Price < lower band (oversold, buy potential).
Visualization: Orange line (mean), red/green lines (upper/lower bands).
f. Game Theory Signals
The strategy generates three types of signals, combined into long/short triggers:
Contrarian Signals:
Buy: Herd selling + (accumulation or down trap) = Go against retail panic.
Sell: Herd buying + (distribution or up trap).
Momentum Signals:
Buy: Below Nash + positive smart money + no herd buying.
Sell: Above Nash + negative smart money + no herd selling.
Nash Reversion Signals:
Buy: Below Nash + rising close (close > close ) + volume > MA.
Sell: Above Nash + falling close + volume > MA.
Final Signals:
Long Signal: Contrarian buy OR momentum buy OR Nash reversion buy.
Short Signal: Contrarian sell OR momentum sell OR Nash reversion sell.
g. Position Management
Position Sizing (Minimax Principle):
Default: 1.0 (10% of equity).
In Nash equilibrium: Reduced to 0.5 (conservative).
During institutional volume: Increased to 1.5 (aggressive).
Entries:
Long: If long_signal is true and no existing long position (strategy.position_size <= 0).
Short: If short_signal is true and no existing short position (strategy.position_size >= 0).
Exits:
Stop-Loss: If use_sl=true, set at 2% below/above entry price.
Take-Profit: If use_tp=true, set at 5% above/below entry price.
Pyramiding: Up to 3 concurrent positions allowed.
h. Visualization
Nash Bands: Orange (mean), red (upper), green (lower).
Background Colors:
Herd buying: Red (90% transparency).
Herd selling: Green.
Institutional volume: Blue.
Signals:
Contrarian buy/sell: Green/red triangles below/above bars.
Liquidity traps: Red/green crosses above/below bars.
Tables:
Game Theory Table (Top-Right):
Herd Behavior: Buying frenzy, selling panic, or normal.
Institutional Flow: Accumulation, distribution, or neutral.
Nash Equilibrium: In equilibrium, above, or below.
Liquidity Status: Trap detected or safe.
Position Suggestion: Long (green), Short (red), or Wait (gray).
Backtest Table (Bottom-Right):
Total Trades: Number of closed trades.
Win Rate: Percentage of winning trades.
Net Profit/Loss: In USD, colored green/red.
Profit Factor: Gross profit / gross loss.
Max Drawdown: Peak-to-trough equity drop (%).
Win/Loss Trades: Number of winning/losing trades.
Risk/Reward Ratio: Simplified Sharpe ratio (returns / drawdown).
Avg Win/Loss Ratio: Average win per trade / average loss per trade.
Last Update: Current time.
i. Backtesting Metrics
Tracks:
Total trades, winning/losing trades.
Win rate (%).
Net profit ($).
Profit factor (gross profit / gross loss).
Max drawdown (%).
Simplified Sharpe ratio (returns / drawdown).
Average win/loss ratio.
Updates metrics on each closed trade.
Displays a label on the last bar with backtest period, total trades, win rate, and net profit.
j. Alerts
No explicit alertconditions defined, but you can add them for long_signal and short_signal (e.g., alertcondition(long_signal, "GT Long Entry", "Long Signal Detected!")).
Use TradingView's alert system with Strategy Tester outputs.
3. Usage Tips
Timeframe: Best for H1-D1 timeframes. Shorter frames (M1-M15) may produce noisy signals.
Settings:
Risk Management: Adjust sl_percent (e.g., 1% for volatile markets) and tp_percent (e.g., 3% for scalping).
Herd Threshold: Increase to 2.5 for stricter herd detection in choppy markets.
Liquidity Lookback: Reduce to 20 for faster markets (e.g., crypto).
Nash Period: Increase to 200 for longer-term analysis.
Backtesting:
Use TradingView's Strategy Tester to evaluate performance.
Check win rate (>50%), profit factor (>1.5), and max drawdown (<20%) for viability.
Test on different assets/timeframes to ensure robustness.
Live Trading:
Start with a demo account.
Combine with other indicators (e.g., EMAs, support/resistance) for confirmation.
Monitor liquidity traps and institutional flow for context.
Risk Management:
Always use SL/TP to limit losses.
Adjust position_size for risk tolerance (e.g., 5% of equity for conservative trading).
Avoid over-leveraging (pyramiding=3 can amplify risk).
Troubleshooting:
If no trades are executed, check signal conditions (e.g., lower herd_threshold or liquidity_sensitivity).
Ensure sufficient historical data for Nash and liquidity calculations.
If tables overlap, adjust position.top_right/bottom_right coordinates.
4. Key Differences from the Previous Indicator
Indicator vs. Strategy: The previous code was an indicator (VP + Game Theory Integrated Strategy) focused on visualization and alerts. This is a strategy with automated entries/exits and backtesting.
Volume Profile: Absent in this strategy, making it lighter but less focused on high-volume zones.
Wick Analysis: Not included here, unlike the previous indicator's heavy reliance on wick patterns.
Backtesting: This strategy includes detailed performance metrics and a backtest table, absent in the indicator.
Simpler Signals: Focuses on Game Theory signals (contrarian, momentum, Nash reversion) without the "Power/Ultra Power" hierarchy.
Risk Management: Explicit SL/TP and dynamic position sizing, not present in the indicator.
5. Conclusion
The "Game Theory Trading Strategy" is a sophisticated system leveraging herd behavior, institutional flows, liquidity traps, and Nash equilibrium to trade market inefficiencies. It’s designed for traders who understand Game Theory principles and want automated execution with robust risk management. However, it requires thorough backtesting and parameter optimization for specific markets (e.g., forex, crypto, stocks). The backtest table and visual aids make it easy to monitor performance, but always combine with other analysis tools and proper capital management.
If you need help with backtesting, adding alerts, or optimizing parameters, let me know!
Absorption DetectorABSORPTION DETECTOR -
The Absorption Detector identifies institutional order flow by detecting "absorption" patterns where smart money quietly accumulates or distributes positions by absorbing retail order flow. This creates high-probability support and resistance zones for trading. This is an approximation only and does not read any footprint data.
WHAT IS ABSORPTION?
Absorption occurs when institutions take the opposite side of retail trades, creating specific candlestick patterns with high volume and significant wicks. The indicator identifies two main patterns:
SELLING ABSORPTION (P-Pattern): Red zones above candles where institutions sell into retail buying pressure, creating resistance levels. Look for high volume candles with large upper wicks that close in the lower half.
BUYING ABSORPTION (B-Pattern): Green zones below candles where institutions buy from retail selling pressure, creating support levels. Look for high volume candles with large lower wicks that close in the upper half.
KEY FEATURES
- Automatic detection of institutional absorption patterns
- Dynamic support and resistance zone creation
- Customizable styling for all visual elements
- Historic zone display for backtesting analysis
- Strength-based filtering to show only high-probability setups
- Real-time alerts for new absorption patterns
- Professional info panel with key statistics
- Multi-timeframe compatibility
MAIN SETTINGS
Volume Threshold (1.2): Minimum volume surge required compared to average. Higher values = fewer but stronger signals.
Minimum Volume (2500): Absolute volume floor to prevent signals during low-volume periods.
Min Wick Size (0.2): Minimum wick size as ATR multiple. Ensures significant rejection occurred.
Minimum Strength (1.5): Combined volume and wick strength filter. Higher values = higher quality signals.
Show Historic Zones (OFF): Enable to see all historical zones for backtesting. Disable for better performance.
Zone Extension (20): How many bars to project zones forward for anticipating future reactions.
TRADING APPROACH
ZONE REACTION STRATEGY: Wait for price to approach absorption zones and trade the bounce or rejection. Use the zones as dynamic support and resistance levels.
BREAKOUT STRATEGY: Trade decisive breaks of strong absorption zones with proper risk management. Failed zones often lead to strong moves.
CONFLUENCE TRADING: Combine absorption zones with other technical analysis for highest probability setups. Look for alignment with trend lines, Fibonacci levels, and key support/resistance.
RISK MANAGEMENT: Always use stop losses beyond the absorption zones. Target minimum 1:2 risk-reward ratios. Position size appropriately based on zone strength.
OPTIMIZATION GUIDE
For Conservative Trading (fewer, higher quality signals):
- Volume Threshold: 1.5
- Minimum Strength: 2.0
- Min Wick Size: 0.3
For Aggressive Trading (more signals, requires careful filtering):
- Volume Threshold: 1.1
- Minimum Strength: 1.0
- Min Wick Size: 0.15
BEST PRACTICES
Markets: Works best on liquid instruments with good volume - major forex pairs, popular stocks, liquid futures, and established cryptocurrencies.
Timeframes: Effective on all timeframes from 1-minute scalping to daily swing trading. Adjust settings based on your timeframe and trading style.
Confirmation: Never trade absorption signals in isolation. Always combine with trend analysis, market structure, and proper risk management.
Session Timing: Be aware of market sessions and avoid trading during low liquidity periods or major news events.
Backtesting: Use the historic zones feature to validate performance on your chosen market and timeframe before live trading.
CUSTOMIZATION
The indicator offers complete visual customization including zone colors, border styles, label appearances, and info panel positioning. All colors can be adapted to match your chart theme and personal preferences.
Alert system provides both basic and custom message alerts for real-time notifications of new absorption patterns.
PERFORMANCE NOTES
Default settings are optimized for most markets and timeframes. For best performance on older charts, keep "Show Historic Zones" disabled unless specifically backtesting.
The indicator maintains excellent performance even with extensive historical analysis enabled, handling up to 500 zones and 100 labels for comprehensive backtesting.
Zero Lag Trend Signals (MTF) [Quant Trading] V7Overview
The Zero Lag Trend Signals (MTF) V7 is a comprehensive trend-following strategy that combines Zero Lag Exponential Moving Average (ZLEMA) with volatility-based bands to identify high-probability trade entries and exits. This strategy is designed to reduce lag inherent in traditional moving averages while incorporating dynamic risk management through ATR-based stops and multiple exit mechanisms.
This is a longer term horizon strategy that takes limited trades. It is not a high frequency trading and therefore will also have limited data and not > 100 trades.
How It Works
Core Signal Generation:
The strategy uses a Zero Lag EMA (ZLEMA) calculated by applying an EMA to price data that has been adjusted for lag:
Calculate lag period: floor((length - 1) / 2)
Apply lag correction: src + (src - src )
Calculate ZLEMA: EMA of lag-corrected price
Volatility bands are created using the highest ATR over a lookback period multiplied by a band multiplier. These bands are added to and subtracted from the ZLEMA line to create upper and lower boundaries.
Trend Detection:
The strategy maintains a trend variable that switches between bullish (1) and bearish (-1):
Long Signal: Triggers when price crosses above ZLEMA + volatility band
Short Signal: Triggers when price crosses below ZLEMA - volatility band
Optional ZLEMA Trend Confirmation:
When enabled, this filter requires ZLEMA to show directional momentum before entry:
Bullish Confirmation: ZLEMA must increase for 4 consecutive bars
Bearish Confirmation: ZLEMA must decrease for 4 consecutive bars
This additional filter helps avoid false signals in choppy or ranging markets.
Risk Management Features:
The strategy includes multiple stop-loss and take-profit mechanisms:
Volatility-Based Stops: Default stop-loss is placed at ZLEMA ± volatility band
ATR-Based Stops: Dynamic stop-loss calculated as entry price ± (ATR × multiplier)
ATR Trailing Stop: Ratcheting stop-loss that follows price but never moves against position
Risk-Reward Profit Target: Take-profit level set as a multiple of stop distance
Break-Even Stop: Moves stop to entry price after reaching specified R:R ratio
Trend-Based Exit: Closes position when price crosses EMA in opposite direction
Performance Tracking:
The strategy includes optional features for monitoring and analyzing trades:
Floating Statistics Table: Displays key metrics including win rate, GOA (Gain on Account), net P&L, and max drawdown
Trade Log Labels: Shows entry/exit prices, P&L, bars held, and exit reason for each closed trade
CSV Export Fields: Outputs trade data for external analysis
Default Strategy Settings
Commission & Slippage:
Commission: 0.1% per trade
Slippage: 3 ticks
Initial Capital: $1,000
Position Size: 100% of equity per trade
Main Calculation Parameters:
Length: 70 (range: 70-7000) - Controls ZLEMA calculation period
Band Multiplier: 1.2 - Adjusts width of volatility bands
Entry Conditions (All Disabled by Default):
Use ZLEMA Trend Confirmation: OFF - Requires ZLEMA directional momentum
Re-Enter on Long Trend: OFF - Allows multiple entries during sustained trends
Short Trades:
Allow Short Trades: OFF - Strategy is long-only by default
Performance Settings (All Disabled by Default):
Use Profit Target: OFF
Profit Target Risk-Reward Ratio: 2.0 (when enabled)
Dynamic TP/SL (All Disabled by Default):
Use ATR-Based Stop-Loss & Take-Profit: OFF
ATR Length: 14
Stop-Loss ATR Multiplier: 1.5
Profit Target ATR Multiplier: 2.5
Use ATR Trailing Stop: OFF
Trailing Stop ATR Multiplier: 1.5
Use Break-Even Stop-Loss: OFF
Move SL to Break-Even After RR: 1.5
Use Trend-Based Take Profit: OFF
EMA Exit Length: 9
Trade Data Display (All Disabled by Default):
Show Floating Stats Table: OFF
Show Trade Log Labels: OFF
Enable CSV Export: OFF
Trade Label Vertical Offset: 0.5
Backtesting Date Range:
Start Date: January 1, 2018
End Date: December 31, 2069
Important Usage Notes
Default Configuration: The strategy operates in its most basic form with default settings - using only ZLEMA crossovers with volatility bands and volatility-based stop-losses. All advanced features must be manually enabled.
Stop-Loss Priority: If multiple stop-loss methods are enabled simultaneously, the strategy will use whichever condition is hit first. ATR-based stops override volatility-based stops when enabled.
Long-Only by Default: Short trading is disabled by default. Enable "Allow Short Trades" to trade both directions.
Performance Monitoring: Enable the floating stats table and trade log labels to visualize strategy performance during backtesting.
Exit Mechanisms: The strategy can exit trades through multiple methods: stop-loss hit, take-profit reached, trend reversal, or trailing stop activation. The trade log identifies which exit method was used.
Re-Entry Logic: When "Re-Enter on Long Trend" is enabled with ZLEMA trend confirmation, the strategy can take multiple long positions during extended uptrends as long as all entry conditions remain valid.
Capital Efficiency: Default setting uses 100% of equity per trade. Adjust "default_qty_value" to manage position sizing based on risk tolerance.
Realistic Backtesting: Strategy includes commission (0.1%) and slippage (3 ticks) to provide realistic performance expectations. These values should be adjusted based on your broker and market conditions.
Recommended Use Cases
Trending Markets: Best suited for markets with clear directional moves where trend-following strategies excel
Medium to Long-Term Trading: The default length of 70 makes this strategy more appropriate for swing trading rather than scalping
Risk-Conscious Traders: Multiple stop-loss options allow traders to customize risk management to their comfort level
Backtesting & Optimization: Comprehensive performance tracking features make this strategy ideal for testing different parameter combinations
Limitations & Considerations
Like all trend-following strategies, performance may suffer in choppy or ranging markets
Default 100% position sizing means full capital exposure per trade - consider reducing for conservative risk management
Higher length values (70+) reduce signal frequency but may improve signal quality
Multiple simultaneous risk management features may create conflicting exit signals
Past performance shown in backtests does not guarantee future results
Customization Tips
For more aggressive trading:
Reduce length parameter (minimum 70)
Decrease band multiplier for tighter bands
Enable short trades
Use lower profit target R:R ratios
For more conservative trading:
Increase length parameter
Enable ZLEMA trend confirmation
Use wider ATR stop-loss multipliers
Enable break-even stop-loss
Reduce position size from 100% default
For optimal choppy market performance:
Enable ZLEMA trend confirmation
Increase band multiplier
Use tighter profit targets
Avoid re-entry on trend continuation
Visual Elements
The strategy plots several elements on the chart:
ZLEMA line (color-coded by trend direction)
Upper and lower volatility bands
Long entry markers (green triangles)
Short entry markers (red triangles, when enabled)
Stop-loss levels (when positions are open)
Take-profit levels (when enabled and positions are open)
Trailing stop lines (when enabled and positions are open)
Optional ZLEMA trend markers (triangles at highs/lows)
Optional trade log labels showing complete trade information
Exit Reason Codes (for CSV Export)
When CSV export is enabled, exit reasons are coded as:
0 = Manual/Other
1 = Trailing Stop-Loss
2 = Profit Target
3 = ATR Stop-Loss
4 = Trend Change
Conclusion
Zero Lag Trend Signals V7 provides a robust framework for trend-following with extensive customization options. The strategy balances simplicity in its core logic with sophisticated risk management features, making it suitable for both beginner and advanced traders. By reducing moving average lag while incorporating volatility-based signals, it aims to capture trends earlier while managing risk through multiple configurable exit mechanisms.
The modular design allows traders to start with basic trend-following and progressively add complexity through ZLEMA confirmation, multiple stop-loss methods, and advanced exit strategies. Comprehensive performance tracking and export capabilities make this strategy an excellent tool for systematic testing and optimization.
Note: This strategy is provided for educational and backtesting purposes. All trading involves risk. Past performance does not guarantee future results. Always test thoroughly with paper trading before risking real capital, and adjust position sizing and risk parameters according to your risk tolerance and account size.
================================================================================
TAGS:
================================================================================
trend following, ZLEMA, zero lag, volatility bands, ATR stops, risk management, swing trading, momentum, trend confirmation, backtesting
================================================================================
CATEGORY:
================================================================================
Strategies
================================================================================
CHART SETUP RECOMMENDATIONS:
================================================================================
For optimal visualization when publishing:
Use a clean chart with no other indicators overlaid
Select a timeframe that shows multiple trade signals (4H or Daily recommended)
Choose a trending asset (crypto, forex major pairs, or trending stocks work well)
Show at least 6-12 months of data to demonstrate strategy across different market conditions
Enable the floating stats table to display key performance metrics
Ensure all indicator lines (ZLEMA, bands, stops) are clearly visible
Use the default chart type (candlesticks) - avoid Heikin Ashi, Renko, etc.
Make sure symbol information and timeframe are clearly visible
================================================================================
COMPLIANCE NOTES:
================================================================================
✅ Open-source publication with complete code visibility
✅ English-only title and description
✅ Detailed explanation of methodology and calculations
✅ Realistic commission (0.1%) and slippage (3 ticks) included
✅ All default parameters clearly documented
✅ Performance limitations and risks disclosed
✅ No unrealistic claims about performance
✅ No guaranteed results promised
✅ Appropriate for public library (original trend-following implementation with ZLEMA)
✅ Educational disclaimers included
✅ All features explained in detail
================================================================================
Asset Rotation System [InvestorUnknown]Overview
This system creates a comprehensive trend "matrix" by analyzing the performance of six assets against both the US Dollar and each other. The objective is to identify and hold the asset that is currently outperforming all others, thereby focusing on maintaining an investment in the most "optimal" asset at any given time.
- - - Key Features - - -
1. Trend Classification:
The system evaluates the trend for each of the six assets, both individually against USD and in pairs (assetX/assetY), to determine which asset is currently outperforming others.
Utilizes five distinct trend indicators: RSI (50 crossover), CCI, SuperTrend, DMI, and Parabolic SAR.
Users can customize the trend analysis by selecting all indicators or choosing a single one via the "Trend Classification Method" input setting.
2. Backtesting:
Calculates an equity curve for each asset and for the system itself, which assumes holding only the asset deemed optimal at any time.
Customizable start date for backtesting; by default, it begins either 5000 bars ago (the maximum in TradingView) or at the inception of the youngest asset included, whichever is shorter. If the youngest asset's history exceeds 5000 bars, the system uses 5000 bars to prevent errors.
The equity curve is dynamically colored based on the asset held at each point, with this coloring also reflected on the chart via barcolor().
Performance metrics like returns, standard deviation of returns, Sharpe, Sortino, and Omega ratios, along with maximum drawdown, are computed for each asset and the system's equity curve.
3 Alerts:
Supports alerts for when a new, confirmed optimal asset is identified. However, due to TradingView limitations, the specific asset cannot be included in the alert message.
- - - Usage - - -
1. Select Assets/Tickers:
Choose which assets or tickers you want to include in the rotation system. Ensure that all selected tickers are denominated in USD to maintain consistency in analysis.
2. Configure Trend Classification:
Decide on the trend classification method from the available options (RSI, CCI, SuperTrend, DMI, or Parabolic SAR, All) and adjust the settings to your preferences. This customization allows you to tailor the system to different market conditions or your specific trading strategy.
3. Utilize Backtesting for Calibration:
Use the backtesting results, including equity curves and performance metrics, to fine-tune your chosen trend indicators.
Be cautious not to overemphasize performance maximization, as this can lead to overfitting. The goal is to achieve a robust system that performs well across various market conditions, rather than just optimizing for past data.
- - - Parameters - - -
Tickers:
Asset 1: Select the symbol for the first asset.
Asset 2: Select the symbol for the second asset.
Asset 3: Select the symbol for the third asset.
Asset 4: Select the symbol for the fourth asset.
Asset 5: Select the symbol for the fifth asset.
Asset 6: Select the symbol for the sixth asset.
General Settings:
Trend Classification Method: Choose from RSI, CCI, SuperTrend, DMI, PSAR, or "All" to determine how trends are analyzed.
Use Custom Starting Date for Backtest: Toggle to use a custom date for beginning the backtest.
Custom Starting Date: Set the custom start date for backtesting.
Plot Perf. Metrics Table: Option to display performance metrics in a table on the chart.
RSI (Relative Strength Index):
RSI Source: Choose the price data source for RSI calculation.
RSI Length: Set the period for the RSI calculation.
CCI (Commodity Channel Index):
CCI Source: Select the price data source for CCI calculation.
CCI Length: Determine the period for the CCI.
SuperTrend:
SuperTrend Factor: Adjust the sensitivity of the SuperTrend indicator.
SuperTrend Length: Set the period for the SuperTrend calculation.
DMI (Directional Movement Index):
DMI Length: Define the period for DMI calculations.
Parabolic SAR:
PSAR Start: Initial acceleration factor for the Parabolic SAR.
PSAR Increment: Increment value for the acceleration factor.
PSAR Max Value: Maximum value the acceleration factor can reach.
Notes/Recommendations:
While this system is operational, it's important to recognize that it relies on "basic" indicators, which may not be ideal for generating trading signals on their own. I strongly suggest that users delve into the code to grasp the underlying logic of the system. Consider customizing it by integrating more sophisticated and higher-quality trend-following indicators to enhance its performance and reliability.
Disclaimer:
This system's backtest results are historical and do not predict future performance. Use for educational purposes only; not investment advice.
Intraday Session Levels: Pre-Mkt, 5m, 15m (Replay/Toggle/Labels)Intraday Session Levels: Pre-Mkt, 5m, 15m (Replay/Toggle/Labels)
Version v1.0
Live session levels for every trader!
This indicator automatically tracks and draws the most actionable intraday levels as they develop—live in real-time and fully compatible with TradingView’s bar replay and backtesting.
How it works:
Pre-Market High & Low:
Levels appear and update live as soon as the pre-market session starts (4:00am ET), then “freeze” at the official open (9:30am ET) and remain visible for the rest of the day.
First 5-Minute Candle High/Low:
Drawn instantly after the first 5-minute candle (9:30–9:35am ET) completes.
First 15-Minute Candle High/Low:
Drawn right after the first 15-minute candle (9:30–9:45am ET) completes.
Labels on every line
Each level is clearly labeled on your chart (“PreMkt High”, “5m Low”, “15m High”, etc).
Perfect for backtesting:
All levels display exactly as they would have appeared in real time, making this indicator fully bar replay and historical test compatible.
Flexible ON/OFF toggles:
Instantly show or hide Pre-Mkt, 5m, and 15m levels via the settings panel.
Why use it?
Identify support/resistance and key reaction zones intraday
Fade or break the opening range with confidence
Backtest your strategies with accurate historical context
Reduce chart clutter with customizable, minimal visuals
Whether you’re a scalper, day trader, or backtest enthusiast, this tool keeps your charts focused and your edge sharp.
Developed by






















