Engulfing & Pin Bar Breakout StrategyOverview
This strategy automates a classic, powerful trading methodology based on identifying key candlestick reversal patterns and trading the subsequent price breakout. It is designed to be a complete, "set-and-go" system with built-in risk and position size management.
The core logic operates on the 1-Hour timeframe, scanning for four distinct high-probability reversal signals: two bullish and two bearish. An entry is only triggered when the market confirms the signal by breaking a key price level, aiming to capture momentum following a potential shift in market sentiment.
The Strategy Logic
The system is composed of two distinct modules: Bullish (Long) and Bearish (Short).
🐂 Bullish (Long) Setup
The script initiates a long trade based on the following strict criteria:
Signal: Identifies either a Hammer or a Bullish Engulfing pattern. These patterns often indicate that sellers are losing control and buyers are stepping in.
Confirmation: Waits for the very next candle after the signal.
Entry Trigger: A long position is automatically opened as soon as the price breaks above the high of the signal candle.
Stop Loss: Immediately set just below the low of the signal candle.
Take Profit: A fixed target is placed at a 1:5 Risk/Reward Ratio.
🐻 Bearish (Short) Setup
The script initiates a short trade based on the following strict criteria:
Signal: Identifies either a Shooting Star or a Bearish Engulfing pattern. These patterns suggest buying pressure is fading and sellers are taking over.
Confirmation: Waits for the very next candle after the signal.
Entry Trigger: A short position is automatically opened as soon as the price breaks below the low of the signal candle.
Stop Loss: Immediately set just above the high of the signal candle.
Take Profit: A fixed target is placed at a 1:4 Risk/Reward Ratio.
Key Feature: Automated Risk Management
This strategy is designed for disciplined trading. You do not need to calculate position sizes manually.
Fixed Risk: The script automatically calculates the correct position size to risk exactly 2% of your total account equity on every single trade.
Dynamic Sizing: The position size will adjust based on the distance between your entry price and your stop loss for each specific setup, ensuring a consistent risk profile.
How To Use
Apply the script to your chosen chart (e.g., BTC/USD).
Crucially, set your chart's timeframe to 1-Hour (H1). The strategy is specifically calibrated for this interval.
Navigate to the "Strategy Tester" tab below your chart to view backtest results, including net profit, win rate, and individual trades.
Disclaimer: This script is provided for educational and informational purposes only. It is not financial advice. All trading involves substantial risk, and past performance is not indicative of future results. Please use this tool responsibly and at your own risk.
Penunjuk dan strategi
EMA Crossover Strategy with Filters//@version=5
strategy("EMA Crossover Strategy with Filters", overlay=true,
initial_capital=100000, default_qty_type=strategy.percent_of_equity, default_qty_value=10)
// EMA lengths
ema9_len = 9
ema50_len = 50
ema100_len = 100
ema200_len = 200
// EMA calculation
ema9 = ta.ema(close, ema9_len)
ema50 = ta.ema(close, ema50_len)
ema100 = ta.ema(close, ema100_len)
ema200 = ta.ema(close, ema200_len)
// Plot EMAs
plot(ema9, color=color.yellow, title="9 EMA")
plot(ema50, color=color.orange, title="50 EMA")
plot(ema100, color=color.green, title="100 EMA")
plot(ema200, color=color.blue, title="200 EMA")
// Entry conditions
longCondition = ta.crossover(ema100, ema200) and ema9 > ema50
shortCondition = ta.crossunder(ema100, ema200) and ema9 < ema50
// Exit conditions
longExit = ta.crossunder(ema100, ema50)
shortExit = ta.crossover(ema100, ema50)
// Execute trades
if (longCondition)
strategy.entry("Long", strategy.long)
if (shortCondition)
strategy.entry("Short", strategy.short)
if (longExit)
strategy.close("Long")
if (shortExit)
strategy.close("Short")
MACD-V (Volatility-Normalised Momentum) — Spiroglou, 2022Volatility-normalized MACD per Alex Spiroglou (2022):
MACD-V = (EMA12 − EMA26) / ATR26 × 100, so momentum is expressed in ATR units and stays comparable across assets/timeframes.
What you get
• Trend-colored line: green when price ≥ EMA200, red otherwise.
• Guides: ±50 / ±100 / 0; Extremes: ±140 (editable).
• Regime shading: OB ≥ +140 shaded red; OS ≤ −140 shaded green.
• Clean, on-curve markers: small circles on the MACD-V line at the four edge events — OB (enter ≥ +threshold), OBX (cross back down), OS (enter ≤ −threshold), OSX (cross back up).
• Text labels are off by default; optional toggle only for OB/OBX.
• Signal & histogram: EMA(9) of MACD-V and (MACD-V − Signal) columns.
• Alerts: OB/OS entries & exits included.
How to use
• Favor longs when MACD-V > 0 (ideally > +50); respect OB for possible exhaustion.
• Favor shorts when MACD-V < 0 (ideally < −50); respect OS for possible exhaustion.
• Because it’s ATR-normalized, thresholds transfer well across symbols and timeframes.
MACD (Panel) with Histogram-Confirmed Signals - Middle LineMacd indicator with buy and sell signals to help spot the macd signal crossover and histogram
Latent Regime Informed Monte Carlo ForecastThis script uses a Monte Carlo simulation to forecast where price might be a set number of bars into the future (default 6 bars ahead). It generates hundreds of possible future price paths based on an average move (drift) and random shocks (volatility). The result is a distribution of outcomes, displayed as probability zones: the median (most likely), inner bands (50% confidence), and wider bands (80% and 95% confidence). Due to the randomness assumption in Monte Carlo simulations, the paths are not very important so to minimize cluttering on the graphs we only plot bands. These zones help you visualize uncertainty, set stops and targets based on probabilities, and spot when market behavior changes.
The accuracy of any Monte Carlo forecast depends heavily on how well you estimate trend and volatility. By default and no prior information the Monte Carlo simulation gives you a parabolic forecast that assumes absolute randomness. This is where the Kalman filter comes in. The filter (derived from control theory) aims to detect latent (unobservable) traits about the system by continuously updating its transition probabilities to better understand how the latent traits affect the observable measurement (price). With each new observable state we get better and better transition probabilities and enhances our understanding about the latent and unobservable market characteristics like trend and volatility. Both crucial measurements for short term market sentiment.
Extracting these measurements for market sentiment informs us how to better parametrize the Monte Carlo simulation for a better forecast. Each bar, the KF updates its estimates based on how close its last prediction was to reality. In calm periods, it holds estimates steady; in volatile periods, it adapts quickly. This gives you real-time, low-lag measurements of both trend and volatility.
By feeding these adaptive estimates into the Monte Carlo simulation, the forecast becomes much more responsive to current market conditions. In trends, the predicted paths tilt toward the direction of movement; in choppy markets, they spread wider but stay centered; when volatility spikes, the probability zones expand immediately. The result is a dynamic forecast tool that adjusts on every bar, giving you a clearer, probability-based picture of where the market could go next.
This is my very first script and I would love feedback/ideas for different topics.
My background is in economics/mathematics and interests lie in time series analysis/exploring financial features for DS
ECG chart - mauricioofsousaMGO Primary – Matriz Gráficos ON
The Blockchain of Trading applied to price behavior
The MGO Primary is the foundation of Matriz Gráficos ON — an advanced graphical methodology that transforms market movement into a logical, predictable, and objective sequence, inspired by blockchain architecture and periodic oscillatory phenomena.
This indicator replaces emotional candlestick reading with a mathematical interpretation of price blocks, cycles, and frequency. Its mission is to eliminate noise, anticipate reversals, and clearly show where capital is entering or exiting the market.
What MGO Primary detects:
Oscillatory phenomena that reveal the true behavior of orders in the book:
RPA – Breakout of Bullish Pivot
RPB – Breakout of Bearish Pivot
RBA – Sharp Bullish Breakout
RBB – Sharp Bearish Breakout
Rhythmic patterns that repeat in medium timeframes (especially on 12H and 4H)
Wave and block frequency, highlighting critical entry and exit zones
Validation through Primary and Secondary RSI, measuring the real strength behind movements
Who is this indicator for:
Traders seeking statistical clarity and visual logic
Operators who want to escape the subjectivity of candlesticks
Anyone who values technical precision with operational discipline
Recommended use:
Ideal timeframes: 12H (high precision) and 4H (moderate intensity)
Recommended assets: indices (e.g., NASDAQ), liquid stocks, and futures
Combine with: structured risk management and macro context analysis
Real-world performance:
The MGO12H achieved a 92% accuracy rate in 2025 on the NASDAQ, outperforming the average performance of major global quantitative strategies, with a net score of over 6,200 points for the year.
Return Volatility (σ) — auto-annualized [v6]Overview
This indicator calculates and visualizes the return-based volatility (standard deviation) of any asset, automatically adjusting for your chart's timeframe to provide both absolute and annualized volatility values.
It’s designed for traders who want to filter trades, adjust position sizing, and detect volatility events based on statistically significant changes in market activity.
Key Features
Absolute Volatility (abs σ%) – Standard deviation of returns for the current timeframe (e.g., 1H, 4H, 1D).
Annualized Volatility (ann σ%) – Converts abs σ% into an annualized figure for easier cross-timeframe and cross-asset comparison.
Relative Volatility (rel σ) – Ratio of current volatility to the long-term average (default: 120 periods).
Z-Score – Number of standard deviations the current volatility is above or below its historical average.
Auto-Timeframe Adjustment – Detects your chart’s bar size (seconds per bar) and calculates bars/year automatically for crypto’s 24/7 market.
Highlight Mode – Optional yellow background when volatility exceeds set thresholds (rel σ ≥ threshold OR z-score ≥ threshold).
Alert Conditions – Alerts trigger when relative volatility or z-score exceed defined limits.
How It Works
Return Calculation
Log returns: ln(Pt / Pt-1) (default)
or Simple returns: (Pt / Pt-1) – 1
Volatility Measurement
Standard deviation of returns over the lookback period N (default: 20 bars).
Absolute volatility = σ × 100 (% per bar).
Annualization
Uses: σₐₙₙ = σ × √(bars/year) × 100 (%)
Bars/year auto-calculated based on timeframe:
1H = 8,760 bars/year
4H ≈ 2,190 bars/year
1D = 365 bars/year
Relative and Statistical Context
Relative σ = Current σ / Historical average σ (baseLen, default: 120)
Z-score = (Current σ – Historical average σ) / Std. dev. of σ over baseLen
Trading Applications
Volatility Filter – Only allow trade entries when volatility exceeds historical norms (trend traders often benefit from this).
Risk Management – Reduce position size during high volatility spikes to manage risk; increase size in low-volatility trending environments.
Market Scanning – Identify assets with the highest relative volatility for momentum or breakout strategies.
Event Detection – Highlight significant volatility surges that may precede large moves.
Suggested Settings
Lookback (N): 20 bars for short/medium-term trading.
Base Length (M): 120 bars to establish long-term volatility baseline.
Relative Threshold: 1.5× baseline σ.
Z-score Threshold: ≥ 2.0 for statistically significant volatility shifts.
Use Log Returns: Recommended for more consistent scaling across prices.
Notes & Limitations
Volatility measures movement magnitude, not direction. Combine with trend or momentum filters for directional bias.
Very low volatility may still produce false breakouts; combine with volume and market structure analysis.
Crypto markets trade 24/7 — annualization assumes no market closures; adjust for other asset classes if needed.
💡 Best Practice: Use this indicator as a pre-trade filter for breakout or trend-following strategies, or as a risk control overlay in mean-reversion systems.
Bullish Bearish volatility analysisThis script is used to analyse Bullish/Bearish volatility direction based on volumes and moving average.
SMI Base-Trigger Bullish Re-acceleration (Higher High)Description
What it does
This indicator highlights a two-step bullish pattern using Stochastic Momentum Index (SMI) plus an ATR distance filter:
1. Base (orange) – Marks a momentum “reset.” A base prints when SMI %K crosses up through %D while %K is below the Base level (default -70). The base stores the base price and starts a waiting window.
2. Trigger (green) – Confirms momentum and price strength. A trigger prints only if, before the timeout window ends:
• SMI %K crosses up through %D again,
• %K is above the Trigger level (default -60),
• Close > Base Price, and
• Price has advanced at least Min ATR multiple (default 1.0× the 14-period ATR) above the base price.
A dashed green line connects the base to the trigger.
Why it’s useful
It seeks a bullish divergence / reacceleration: momentum recovers from deeply negative territory, then price reclaims and exceeds the base by a volatility-aware margin. This helps filter out weak “oversold bounces.”
Signals
• Base ▲ (orange): Potential setup begins.
• Trigger ▲ (green): Confirmation—momentum and price agree.
Inputs (key ones)
• %K Length / EMA Smoothing / %D Length: SMI construction.
• Base when %K < (default -70): depth required for a valid reset.
• Trigger when %K > (default -60): strength required on confirmation.
• Base timeout (days) (default 100): maximum look-ahead window.
• ATR Length (default 14) and Min ATR multiple (default 1.0): price must exceed the base by this ATR-scaled distance.
How traders use it (example rules)
• Entry: On the Trigger.
• Risk: A common approach is a stop somewhere between the base price and a multiple of ATR below trigger; or use your system’s volatility stop.
• Exits: Your choice—trend MA cross, fixed R multiple, or structure-based levels.
Notes & tips
• Works best on liquid symbols and mid-to-higher timeframes (reduce noise).
• Increase Min ATR multiple to demand stronger price confirmation; tighten or widen Base/Trigger levels to fit your market.
• This script plots signals only; convert to a strategy to backtest entries/exits.
Defense Mode Dashboard ProWhat it is
A one‑look market regime dashboard for ES, NQ, YM, RTY, and SPY that tells you when to play defense, when you might have an offense cue, and when to chill. It blends VIX, VIX term structure, ATR 5 over 60, and session gap signals with clean alerts and a compact table you can park anywhere.
Why traders like it
Because it filters out the noise. Regime first, tactics second. You avoid trading size into landmines and lean in when volatility cooperates.
What it measures
Volatility stress with VIX level and VIX vs 20‑SMA
Term structure using VX1 vs VX2 with two modes
Diff mode: VX1 minus VX2
Ratio mode: VX1 divided by VX2
Realized volatility using ATR5 over ATR60 with optional smoothing
Session risk from RTH opening gaps and overnight range, normalized by ATR
How to use in 30 seconds
Pick a preset in the inputs. ES, NQ, YM, RTY, SPY are ready.
Leave thresholds at defaults to start.
Add one TradingView alert using “Any alert() function call”.
Trade smaller or stand aside when the header reads DEFENSE ON. Consider leaning in only when you see OFFENSE CUE and your playbook agrees.
Defaults we recommend
VIX triggers: 22 and 1.25× the 20‑SMA
Term mode: Diff with tolerance 0.00. Use Ratio at 1.00+ for choppier markets
ATR 5/60 defense: 1.25. Offense cue: 0.85 or lower
ATR smoothing: 1. Try 2 to 3 if you want fewer flips
Gap mode: RTH. Turn Both on if you want ON range to count too
RTH wild gap: 0.60× ATR5. ON wild range: 0.80× ATR5
Alert cadence: Once per RTH session
Snooze: Quick snooze first 30 minutes on. Fire on snooze exit off, unless you really want the catch‑up ping
New since the last description
Multi‑asset presets set symbols and RTH windows for ES, NQ, YM, RTY, SPY
Term ratio mode with near‑flat warning when ratio is between 1.00 and your trigger
ATR smoothing for the 5 over 60 ratio
RTH keying for cadence, so “Once per RTH session” behaves like a trader expects
Snooze upgrades with quick snooze tied to the first N minutes of RTH and an optional fire‑on‑snooze‑exit
Compact title merge and user color controls for labels, values, borders, and background
Exposed series for integrations: DefenseOn(1=yes) and OffenseCue(1=yes)
Debug toggle to visualize gap points, ON range, and term readings
Stronger NA handling with a clear “No core data” row when feeds are missing
Notes
Dynamic alerts require “Any alert() function call”.
Works on any chart timeframe. Daily reads and 1‑minute anchors handle the regime logic.
VPOC Progressivo – Start da data/oraPlots a progressive VPOC starting from a user-selected bar.
The script accumulates volume and updates the Volume Point of Control (VPOC) on every bar. Useful for analysing intraday volume distribution from any custom starting point.
AK_Trend continuation_Trending Market_RSI + Stoch. RSIIndicator to predict where to buy and sell based on market structure. Most applicable in a trending market. Based on RSI and Stochastic RSI
Keltner Channel Based Grid Strategy # KC Grid Strategy - Keltner Channel Based Grid Trading System
## Strategy Overview
KC Grid Strategy is an innovative grid trading system that combines the power of Keltner Channels with dynamic position sizing to create a mean-reversion trading approach. This strategy automatically adjusts position sizes based on price deviation from the Keltner Channel center line, implementing a systematic grid-based approach that capitalizes on market volatility and price oscillations.
## Core Principles
### Keltner Channel Foundation
The strategy builds upon the Keltner Channel indicator, which consists of:
- **Center Line**: Moving average (EMA or SMA) of the price
- **Upper Band**: Center line + (ATR/TR/Range × Multiplier)
- **Lower Band**: Center line - (ATR/TR/Range × Multiplier)
### Grid Trading Logic
The strategy implements a sophisticated grid system where:
1. **Position Direction**: Inversely correlated to price position within the channel
- When price is above center line → Short positions
- When price is below center line → Long positions
2. **Position Size**: Proportional to distance from center line
- Greater deviation = Larger position size
3. **Grid Activation**: Positions are adjusted only when the difference exceeds a predefined grid threshold
### Mathematical Foundation
The core calculation uses the KC Rate formula:
```
kcRate = (close - ma) / bandWidth
targetPosition = kcRate × maxAmount × (-1)
```
This creates a mean-reversion system where positions increase as price moves further from the mean, expecting eventual return to equilibrium.
## Parameter Guide
### Time Range Settings
- **Start Date**: Beginning of strategy execution period
- **End Date**: End of strategy execution period
### Core Parameters
1. **Number of Grids (NumGrid)**: Default 12
- Controls grid sensitivity and position adjustment frequency
- Higher values = More frequent but smaller adjustments
- Lower values = Less frequent but larger adjustments
2. **Length**: Default 10
- Period for moving average and volatility calculations
- Shorter periods = More responsive to recent price action
- Longer periods = Smoother, less noisy signals
3. **Grid Coefficient (kcRateMult)**: Default 1.33
- Multiplier for channel width calculation
- Higher values = Wider channels, less frequent trades
- Lower values = Narrower channels, more frequent trades
4. **Source**: Default Close
- Price source for calculations (Close, Open, High, Low, etc.)
- Close price typically provides most reliable signals
5. **Use Exponential MA**: Default True
- True = Uses EMA (more responsive to recent prices)
- False = Uses SMA (equal weight to all periods)
6. **Bands Style**: Default "Average True Range"
- **Average True Range**: Smoothed volatility measure (recommended)
- **True Range**: Current bar's volatility only
- **Range**: Simple high-low difference
## How to Use
### Setup Instructions
1. **Apply to Chart**: Add the strategy to your desired timeframe and instrument
2. **Configure Parameters**: Adjust settings based on market characteristics:
- Volatile markets: Increase Grid Coefficient, reduce Number of Grids
- Stable markets: Decrease Grid Coefficient, increase Number of Grids
3. **Set Time Range**: Define your backtesting or live trading period
4. **Monitor Performance**: Watch strategy performance metrics and adjust as needed
### Optimal Market Conditions
- **Range-bound markets**: Strategy performs best in sideways trending markets
- **High volatility**: Benefits from frequent price oscillations around the mean
- **Liquid instruments**: Ensures efficient order execution and minimal slippage
### Position Management
The strategy automatically:
- Calculates optimal position sizes based on account equity
- Adjusts positions incrementally as price moves through grid levels
- Maintains risk control through maximum position limits
- Executes trades only during specified time periods
## Risk Warnings
### ⚠️ Important Risk Considerations
1. **Trending Market Risk**:
- Strategy may underperform or generate losses in strong trending markets
- Mean-reversion assumption may fail during sustained directional moves
- Consider market regime analysis before deployment
2. **Leverage and Position Size Risk**:
- Strategy uses pyramiding (up to 20 positions)
- Large positions may accumulate during extended moves
- Monitor account equity and margin requirements closely
3. **Volatility Risk**:
- Sudden volatility spikes may trigger multiple rapid position adjustments
- Consider volatility filters during high-impact news events
- Backtest across different volatility regimes
4. **Execution Risk**:
- Strategy calculates on every tick (calc_on_every_tick = true)
- May generate frequent orders in volatile conditions
- Ensure adequate execution infrastructure and consider transaction costs
5. **Parameter Sensitivity**:
- Performance highly dependent on parameter optimization
- Over-optimization may lead to curve-fitting
- Regular parameter review and adjustment may be necessary
## Suitable Scenarios
### Ideal Market Conditions
- **Sideways/Range-bound markets**: Primary use case
- **Mean-reverting instruments**: Forex pairs, some commodities
- **Stable volatility environments**: Consistent ATR patterns
- **Liquid markets**: Major currency pairs, popular stocks/indices
## Important Notes
### Strategy Limitations
1. **No Stop Loss**: Strategy relies on mean reversion without traditional stop losses
2. **Capital Requirements**: Requires sufficient capital for grid-based position sizing
3. **Market Regime Dependency**: Performance varies significantly across different market conditions
## Disclaimer
This strategy is provided for educational and research purposes only. Past performance does not guarantee future results. Trading involves substantial risk of loss and is not suitable for all investors. Users should thoroughly test the strategy and understand its mechanics before risking real capital. The author assumes no responsibility for trading losses incurred through the use of this strategy.
---
# KC网格策略 - 基于肯特纳通道的网格交易系统
## 策略概述
KC网格策略是一个创新的网格交易系统,它将肯特纳通道的力量与动态仓位调整相结合,创建了一个均值回归交易方法。该策略根据价格偏离肯特纳通道中心线的程度自动调整仓位大小,实施系统化的网格方法,利用市场波动和价格振荡获利。
## 核心原理
### 肯特纳通道基础
该策略建立在肯特纳通道指标之上,包含:
- **中心线**: 价格的移动平均线(EMA或SMA)
- **上轨**: 中心线 + (ATR/TR/Range × 乘数)
- **下轨**: 中心线 - (ATR/TR/Range × 乘数)
### 网格交易逻辑
该策略实施复杂的网格系统:
1. **仓位方向**: 与价格在通道中的位置呈反向关系
- 当价格高于中心线时 → 空头仓位
- 当价格低于中心线时 → 多头仓位
2. **仓位大小**: 与距离中心线的距离成正比
- 偏离越大 = 仓位越大
3. **网格激活**: 只有当差异超过预定义的网格阈值时才调整仓位
### 数学基础
核心计算使用KC比率公式:
```
kcRate = (close - ma) / bandWidth
targetPosition = kcRate × maxAmount × (-1)
```
这创建了一个均值回归系统,当价格偏离均值越远时仓位越大,期望最终回归均衡。
## 参数说明
### 时间范围设置
- **开始日期**: 策略执行期间的开始时间
- **结束日期**: 策略执行期间的结束时间
### 核心参数
1. **网格数量 (NumGrid)**: 默认12
- 控制网格敏感度和仓位调整频率
- 较高值 = 更频繁但较小的调整
- 较低值 = 较少频繁但较大的调整
2. **长度**: 默认10
- 移动平均线和波动率计算的周期
- 较短周期 = 对近期价格行为更敏感
- 较长周期 = 更平滑,噪音更少的信号
3. **网格系数 (kcRateMult)**: 默认1.33
- 通道宽度计算的乘数
- 较高值 = 更宽的通道,较少频繁的交易
- 较低值 = 更窄的通道,更频繁的交易
4. **数据源**: 默认收盘价
- 计算的价格来源(收盘价、开盘价、最高价、最低价等)
- 收盘价通常提供最可靠的信号
5. **使用指数移动平均**: 默认True
- True = 使用EMA(对近期价格更敏感)
- False = 使用SMA(对所有周期等权重)
6. **通道样式**: 默认"平均真实范围"
- **平均真实范围**: 平滑的波动率测量(推荐)
- **真实范围**: 仅当前K线的波动率
- **范围**: 简单的高低价差
## 使用方法
### 设置说明
1. **应用到图表**: 将策略添加到您所需的时间框架和交易品种
2. **配置参数**: 根据市场特征调整设置:
- 波动市场:增加网格系数,减少网格数量
- 稳定市场:减少网格系数,增加网格数量
3. **设置时间范围**: 定义您的回测或实盘交易期间
4. **监控表现**: 观察策略表现指标并根据需要调整
### 最佳市场条件
- **区间震荡市场**: 策略在横盘趋势市场中表现最佳
- **高波动性**: 受益于围绕均值的频繁价格振荡
- **流动性强的品种**: 确保高效的订单执行和最小滑点
### 仓位管理
策略自动:
- 根据账户权益计算最优仓位大小
- 随着价格在网格水平移动逐步调整仓位
- 通过最大仓位限制维持风险控制
- 仅在指定时间段内执行交易
## 风险警示
### ⚠️ 重要风险考虑
1. **趋势市场风险**:
- 策略在强趋势市场中可能表现不佳或产生损失
- 在持续方向性移动期间均值回归假设可能失效
- 部署前考虑市场制度分析
2. **杠杆和仓位大小风险**:
- 策略使用金字塔加仓(最多20个仓位)
- 在延长移动期间可能积累大仓位
- 密切监控账户权益和保证金要求
3. **波动性风险**:
- 突然的波动性激增可能触发多次快速仓位调整
- 在高影响新闻事件期间考虑波动性过滤器
- 在不同波动性制度下进行回测
4. **执行风险**:
- 策略在每个tick上计算(calc_on_every_tick = true)
- 在波动条件下可能产生频繁订单
- 确保充足的执行基础设施并考虑交易成本
5. **参数敏感性**:
- 表现高度依赖于参数优化
- 过度优化可能导致曲线拟合
- 可能需要定期参数审查和调整
## 适用场景
### 理想市场条件
- **横盘/区间震荡市场**: 主要用例
- **均值回归品种**: 外汇对,某些商品
- **稳定波动性环境**: 一致的ATR模式
- **流动性市场**: 主要货币对,热门股票/指数
## 注意事项
### 策略限制
1. **无止损**: 策略依赖均值回归而无传统止损
2. **资金要求**: 需要充足资金进行基于网格的仓位调整
3. **市场制度依赖性**: 在不同市场条件下表现差异显著
## 免责声明
该策略仅供教育和研究目的。过往表现不保证未来结果。交易涉及重大损失风险,并非适合所有投资者。用户应在投入真实资金前彻底测试策略并理解其机制。作者对使用此策略产生的交易损失不承担任何责任。
---
**Strategy Version**: Pine Script v6
**Author**: Signal2Trade
**Last Updated**: 2025-8-9
**License**: Open Source (Mozilla Public License 2.0)
Adaptive Correlation Engine (ACE)🧠 Adaptive Correlation Engine (ACE)
Quantify inter-asset relationships with adaptive lag detection and actionable insights.
📌 What is ACE?
The Adaptive Correlation Engine (ACE) is a precision tool for seeking to uncover meaningful relationships between two assets — not just raw correlation, but also lag dynamics, leader detection, and alignment vs. divergence classification.
Unlike static correlation tools, ACE intelligently scans multiple lag windows to find:
✅ The maximum correlation between the base asset and a comparison symbol
⏱️ The optimal lag (if any) at which the correlation is strongest
🧭 Whether the assets are Aligned (positive correlation) or Divergent (inverse)
🔁 Which symbol is leading, and by how many bars
📈 Actionable signal strength based on a user-defined correlation threshold
⚙️ How It Works
Correlation Scan:
For each bar, ACE checks the correlation between the charted asset (close) and a lagged version of the comparison asset across a sliding window of lookback periods.
Lag Optimization:
The engine searches from lag 0 up to your specified Max Lag to find where the correlation (positive or negative) is most significant.
Relationship Classification:
The indicator classifies the relationship as:
Aligned: Positive correlation above the threshold
Divergent: Negative correlation above the threshold
Synchronous: No lag detected
Low Signal: Correlation is weak or noisy
Visual & Tabular Insights:
ACE plots the highest detected correlation on the chart and shows an insight table displaying:
- Correlation value
- Detected lag
- Direction type (aligned/divergent)
- Leading asset
- Suggested action (e.g., “Likely continuation” or “Possible mean reversion”)
💡 How to Use It
Use ACE to identify leadership patterns between assets (e.g., ETH leads altcoins, SPX leads crypto, etc.)
Spot potential lagging trade setups where one asset’s move may soon echo in another
Confirm or challenge correlation-based trading assumptions with data
Combine with technical indicators or price action to time entries and exits more confidently
🔔 Alerts
Built-in alerts notify you when correlation strength crosses your actionable threshold, classified by alignment or divergence.
🛠️ Inputs
Compare Symbol: The asset to compare against (e.g., INDEX:ETHUSD)
Correlation Lookback: Rolling window for calculating correlation
Max Lag Bars: Maximum lag shift to test
Minimum Actionable Correlation: Signal threshold for trade-worthy insights
⚠️ Disclaimer
This tool is for research and informational purposes only. It does not constitute financial advice or a trading signal. Always perform your own due diligence and consult a financial advisor before making investment decisions.
Big Daddy Ray DashboardMulti-Asset Moving Average Signal Dashboard
This indicator tracks multiple user-selected tickers and displays their technical conditions in a clear, color-coded dashboard. For every ticker, the script calculates both fast and slow Simple Moving Averages (SMAs) as well as fast and slow Exponential Moving Averages (EMAs). These values are compared to generate a visual trend signal.
Dashboard: How It Works - Longs Only
Green – Fast SMA and fast EMA are both above their slow counterparts → strong bullish momentum. Trade Open.
Red – Fast SMA and fast EMA are both below their slow counterparts → bearish momentum.
No Trade.
Yellow – SMA and EMA conditions are mixed → indecision or trend transition. Caution. Watch for trade opening.
Use Cases:
Cryptocurrency traders can monitor multiple altcoins for rotation opportunities.
Forex traders can track major and minor currency pairs to identify the strongest and weakest performers.(Just swap the tickers in the code.)
Stock traders can scan a watchlist for synchronized bullish or bearish setups. (Just swap the tickers in the code.)
With its at-a-glance color coding, this tool removes the need to flip between charts and makes multi-market monitoring efficient, visual, and customizable for any trading style.
I love making new scripts to help refine the trading process. If you would like access to my brightest ideas, click the link below!
gordontradingcompany.com
Kalman Supertrend (High vs Low) Bands by Skyito V2Inspired by BackQuant's Kalman Hull Supertrend, this upgraded version replaces the typical Kalman-close method with Kalman-filtered High and Low sources. This approach provides clearer trend visualization and helps confirm potential breakouts or reversals using clean, directional candle signals.
The core logic revolves around BB (Band Buy) and SS (Band Sell) signals:
BB appears only when a candle fully breaks above both Kalman High and Low bands.
SS appears when a candle fully breaks below both bands.
These clean triggers help avoid false signals and are excellent for capturing high-probability trend shifts.
✅ The Supertrend line is also included and can be toggled on or off — useful for those who prefer early trend detection or confirmation.
🆕 Why the SMA Band was Included
To complement the Kalman band system, a Moving Average Band (default: SMA 200) is added:
It helps detect the long-term trend direction.
Candles are colored green when above the SMA band and red when below.
This visual cue strengthens trend confidence and adds an extra layer for filtering trades.
The MA band and coloring can be turned on or off based on preference.
This tool is built for traders who want a clean trend-following and breakout confirmation system. It can be used as a standalone strategy or paired with price action, volume, or support/resistance tools.
Hull Suite Strategy – 1% Risk, No SL/TP Catch trends early. Exit only on reversal.
This Hull Suite Strategy uses ultra-smooth HMA, EHMA, or THMA signals to ride big moves with minimal noise. Risk just 1% per trade, keep positions open until the market truly flips — no premature exits, no guesswork.
Hull Suite Strategy – 1% Risk (No SL/TP)
A clean trend-following system built on the Hull Moving Average and its powerful variations (HMA, EHMA, THMA) for fast, smooth, and low-lag signals. The strategy automatically flips between long and short positions based on trend reversals, using just 1% equity risk per trade.
Features:
Hull Variations – test HMA, EHMA, or THMA for your market.
Automatic Trend Switching – enter and exit only on confirmed reversals.
No Fixed SL/TP – ride trends as long as they last.
Optional Trend-Colored Candles – for quick, visual market direction.
Clear Bull/Bear Line Coloring – instantly see the trend bias.
Perfect for traders who prefer to let winners run and avoid fixed take profit limits, with a focus on pure trend action and minimal lag.
Bullish Divergence SMI Base & Trigger with ATR FilterDescription:
A bullish divergence indicator combining the Stochastic Momentum Index (SMI) and Average True Range (ATR) to pinpoint high-probability entries:
1. Base Arrow (Orange ▲):
• Marks every SMI %K / %D bullish crossover where %K < –70 (deep oversold)—the first half of the divergence setup.
• Each new qualifying crossover replaces the previous base, continuously “arming” the divergence signal.
• Configurable SMI lookbacks, oversold threshold, and a base timeout (default 100 days) to clear stale bases.
2. Trigger Arrow (Green ▲):
• Completes the bullish divergence: fires on the next SMI bullish crossover where %K > –60 and price has dropped below the base arrow’s close by at least N × ATR (default 1 × 14-day ATR).
• A dashed green line links the base and trigger to visually confirm the divergence.
• Resets after triggering, ready for a new divergence cycle.
Inputs:
• SMI %K Length, EMA Smoothing, %D Length
• Oversold Base Level (–70), Trigger Level (–60)
• ATR Length (14), ATR Multiplier (1.0)
• Base Timeout (100 days)
Ideal for any market, this study highlights genuine bullish divergences—oversold momentum crossovers that coincide with significant price reactions—before entering long trades.
Wickless Precision IndicatorThe Wickless Precision Indicator is a powerful tool designed to identify and highlight wickless and tailless candlestick patterns on your TradingView charts. A wickless candle, where the open or close price equals the high or low, signals strong directional momentum and potential support or resistance levels. This indicator automatically detects these unique candles, drawing customizable horizontal lines at their key price levels to help traders spot critical zones for entries, exits, or reversals.
Key Features:
Automatic Wickless Detection: Identifies bullish (no lower wick) and bearish (no upper wick) candles with precision.
Dynamic Line Plotting: Draws horizontal lines at the high or low of wickless candles, extending until price interaction or user-defined conditions.
Customizable Settings: Adjust line styles, colors, and sensitivity thresholds to suit your trading style.
Visual Markers: Highlights wickless candles with distinct shapes (e.g., triangles or crosses) for easy identification.
Alert Integration: Set real-time alerts to stay notified when wickless candles form, ensuring you never miss a potential trading opportunity.
Use Cases:
Pinpoint strong support/resistance zones where price rejection is evident.
Identify high-probability entry or exit points based on momentum-driven candles.
Enhance price action strategies with clear visual cues for market sentiment shifts.
Perfect for traders seeking to capitalize on clean, wickless price movements, the Wickless Precision Indicator simplifies technical analysis and boosts trading confidence.
SR Indicator//@version=5
indicator("TenUp Bots S R (fixed)", overlay=true)
a = input.int(title="Sensitivity", defval=10, minval=1, maxval=9999)
d = input.int(title="Transparency", defval=85, minval=0, maxval=100)
colR = color.new(color.red, d)
colS = color.new(color.blue, d)
// Use ta.highest(source, length) and ta.lowest(source, length)
plot(ta.highest(high, a * 1), title='Resistance 1', color=colR, linewidth=2, style=plot.style_line, trackprice=true)
plot(ta.lowest(low, a * 1), title='Support 1', color=colS, linewidth=2, style=plot.style_line, trackprice=true)
plot(ta.highest(high, a * 2), title='Resistance 2', color=colR, linewidth=2, style=plot.style_line, trackprice=true)
plot(ta.lowest(low, a * 2), title='Support 2', color=colS, linewidth=2, style=plot.style_line, trackprice=true)
plot(ta.highest(high, a * 3), title='Resistance 3', color=colR, linewidth=2, style=plot.style_line, trackprice=true)
plot(ta.lowest(low, a * 3), title='Support 3', color=colS, linewidth=2, style=plot.style_line, trackprice=true)
// ... repeat for all multipliers you had ...
// (copy the pattern above for 4,5,6,...,1500)