Box Range with RSI Divergence (OKX)Strategy Name: Box Range with RSI Divergence (Dynamic Fibonacci DCA Logic for OKX Signals)
This advanced trading strategy integrates Box Range Breakout, Dynamic DCA (Dollar-Cost Averaging) based on Fibonacci levels, and RSI Divergence to build a robust and adaptive trading system. The strategy is designed to dynamically adjust its position size based on market conditions and account performance, while providing precise entry and exit signals compatible with OKX trading bots.
Core Mechanisms:
Box Range Logic:
The strategy identifies the highest and lowest price levels within a defined box length (e.g., 333 bars).
These levels act as dynamic support and resistance zones, triggering trades when prices break out or revert from these levels.
RSI Divergence for Entry & Exit:
Detects bullish RSI divergence at key support levels for potential long entries.
Detects bearish RSI divergence at resistance levels for short exits or reversals.
RSI divergence helps confirm the strength of breakouts or reversals, reducing false signals.
Dynamic Fibonacci-Based DCA for Loss Recovery:
When a position moves into a loss, the strategy applies Dynamic Dollar-Cost Averaging (DCA).
Position-sizing is calculated using Fibonacci adjustment factors based on the percentage drawdown.
This ensures that larger positions are added at key Fibonacci retracement levels to improve the average entry price.
Dynamic Fibonacci-Based Exit for Profit Maximization:
As a position moves into profit, Dynamic Fibonacci Profit Scaling is used.
Gradual position reductions occur at Fibonacci extension levels, locking in profits dynamically as prices trend favorably.
Adaptive Position Sizing:
Entry and exit amounts are dynamically adjusted based on the account balance, current drawdown, and market conditions.
Prevents overleveraging while maximizing capital efficiency.
Take Profit and Stop Loss:
Configurable percentage-based take profit and stop loss ensure disciplined risk management.
Protects gains and prevents excessive losses in volatile markets.
OKX Bot Signal Integration:
Automatically generates alerts in the OKX signal format, including all required parameters:
Order type (market/limit)
Investment type (percentage-based)
Dynamic position size (calculated automatically)
When to Use This Strategy:
This strategy is ideal for traders who:
Prefer systematic, rule-based trading.
Use automated trading bots like OKX for signal execution.
Want to take advantage of RSI divergence for precision entries and exits.
Require adaptive position management for both loss recovery and profit scaling.
中文描述 (Chinese Description)
策略名称: Box Range with RSI Divergence (动态斐波那契 DCA 策略,支持 OKX 信号格式)
这是一种高级交易策略,结合了 箱体区间突破、基于 斐波那契动态加仓 (DCA) 和 盈利动态斐波那契离场 的逻辑,同时配合 RSI 背离检测,构建出一个高度自适应的交易系统。此策略可根据市场条件及账户表现动态调整仓位大小,并生成与 OKX 交易机器人兼容的精确入场与离场信号。
核心机制:
箱体区间逻辑:
策略通过定义的 箱体周期(例如 333 根 K 线)检测最高点和最低点。
这些点位作为动态的 支撑和阻力区域,当价格突破或从这些区域反弹时触发交易信号。
RSI 背离检测:
在支撑区域检测到 RSI 看涨背离 时触发多头开仓信号。
在阻力区域检测到 RSI 看跌背离 时触发空头平仓或反转信号。
RSI 背离确认了突破或反转的强度,有助于过滤虚假信号。
基于斐波那契的动态加仓 (DCA):
当仓位进入亏损状态时,策略应用 动态加仓 (DCA)。
加仓比例基于 斐波那契调整因子 和 亏损百分比 计算。
在关键斐波那契回撤位进行加仓,从而优化持仓均价,快速恢复盈利能力。
基于斐波那契的盈利动态离场:
当仓位进入盈利状态时,策略应用 盈利动态斐波那契离场。
在价格到达斐波那契扩展位时逐步减仓,动态锁定利润。
自适应仓位管理:
根据账户余额、当前亏损情况及市场条件动态调整开仓与平仓金额。
避免过度杠杆的同时,充分利用资金效率。
止盈与止损管理:
提供基于百分比的止盈与止损设置,确保纪律化的风险管理。
在极端行情中保护盈利,限制亏损。
OKX 交易信号集成:
自动生成兼容 OKX 信号格式 的警报:
包括订单类型(市价/限价)、投资类型(百分比仓位)、动态仓位大小等参数。
适用场景:
此策略适合以下交易者:
偏好 系统化、规则化交易 的用户。
使用 OKX 自动化交易机器人 进行信号执行的用户。
需要通过 RSI 背离 精确捕捉入场与离场时机的用户。
需要 自适应仓位管理 来应对亏损和锁定盈利的用户。
核心亮点 (Key Highlights)
箱体突破 + RSI 背离确认:
结合动态支撑/阻力与指标背离,精准捕捉趋势反转与延续。
动态斐波那契加仓与离场:
亏损时按斐波那契比例动态加仓,优化均价。
盈利时按斐波那契扩展位逐步减仓,动态锁定收益。
OKX 信号兼容:
信号格式完全符合 OKX 机器人要求,支持自动化交易。
适配账户动态调整:
基于账户余额与亏损比例自动调整仓位,灵活应对不同市场环境。
止盈止损风控:
内置动态止盈与止损,合理控制风险。
中文最后提醒一下注意改里面参数,英文的描述我就不提醒了,老外都觉得比华人聪明,让他们自己去看去改,箱体参数越大,加仓越不频繁,箱体参数越小加仓越频繁,加仓参数设置小,箱体K线周期设置小,加仓参数设置大,箱体就要设置大,不然就是baocang.
Chỉ báo và chiến lược
Scalping Pro Balance (EMA + MACD + RSI + Trailing TP)//@version=5
strategy("Scalping Pro Balance (EMA + MACD + RSI + Trailing TP)", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100)
// === THAM SỐ ===
emaLen = input.int(20, "EMA Trend", minval=1) // Giảm độ dài EMA để tín hiệu nhanh hơn
takeProfitPerc = input.float(1.0, "Take Profit (%)", step=0.1)
atrMult = input.float(0.8, "Trailing ATR Multiplier", step=0.1)
atrLen = input.int(14, "ATR Length")
rsiLen = input.int(9, "RSI Length") // Giảm độ dài RSI để tín hiệu nhanh hơn
// === CHỈ BÁO ===
ema = ta.ema(close, emaLen)
= ta.macd(close, 6, 13, 6) // Giảm độ dài MACD để tín hiệu nhanh hơn
rsi = ta.rsi(close, rsiLen)
atr = ta.atr(atrLen)
// === TÍN HIỆU ===
macdBuy = ta.crossover(macdLine, signalLine)
macdSell = ta.crossunder(macdLine, signalLine)
rsiOk = rsi > 40 and rsi < 75 // Mở rộng vùng RSI để tăng tần suất
longCond = close > ema and macdBuy and rsiOk
shortCond = close < ema and macdSell and rsi < 60 // Điều chỉnh vùng RSI cho lệnh sell
// === VÀO LỆNH ===
if (longCond)
strategy.entry("BUY", strategy.long)
strategy.exit("TP/TSL BUY", from_entry="BUY", limit=close * (1 + takeProfitPerc / 100), trail_points=atr * atrMult, trail_offset=atr * atrMult)
if (shortCond)
strategy.entry("SELL", strategy.short)
strategy.exit("TP/TSL SELL", from_entry="SELL", limit=close * (1 - takeProfitPerc / 100), trail_points=atr * atrMult, trail_offset=atr * atrMult)
// === HIỂN THỊ ===
plot(ema, title="EMA 20", color=color.orange)
plotshape(longCond, title="BUY", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(shortCond, title="SELL", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
// === CẢNH BÁO ===
alertcondition(longCond, title="BUY Signal", message="BUY signal: EMA trend up, MACD crossover, RSI OK")
alertcondition(shortCond, title="SELL Signal", message="SELL signal: EMA trend down, MACD crossunder, RSI low")
EMA & MA Crossover StrategyGuys, you asked, we did. Strategy for crossing moving averages .
The Moving Average Crossover trading strategy is possibly the most popular
trading strategy in the world of trading. First of them were written in the
middle of XX century, when commodities trading strategies became popular.
This strategy is a good example of so-called traditional strategies.
Traditional strategies are always long or short. That means they are never
out of the market. The concept of having a strategy that is always long or
short may be scary, particularly in today’s market where you don’t know what
is going to happen as far as risk on any one market. But a lot of traders
believe that the concept is still valid, especially for those of traders who
do their own research or their own discretionary trading.
This version uses crossover of moving average and its exponential moving average.
Strategy parameters:
Take Profit % - when it receives the opposite signal
Stop Loss % - when it receives the opposite signal
Current Backtest:
Account: 1000$
Trading size: 0.01
Commission: 0.05%
WARNING:
- For purpose educate only
- This script to change bars colors.
eureka - with strategythis is based on ict teachings and it has fvg, ob, choch and so many things you cant imagine in 1 min tf
Vinicius Setup ATR//@version=5
strategy("Vinicius Setup ATR", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100)
// ===== PARÂMETROS =====
atrLength = input.int(10, title="ATR Length")
factor = input.float(6.0, title="Multiplier", step=0.1)
riskValue = input.float(1.0, title="Risk Value")
rsiPeriod = input.int(14, title="RSI Period")
minBodySize = input.float(1.0, title="Mínimo Tamanho do Corpo %")
// ===== INDICADORES =====
= ta.supertrend(factor, atrLength)
rsi = ta.rsi(close, rsiPeriod)
avgVolume = ta.sma(volume, 20)
candleBody = math.abs(close - open)
isStrongCandle = candleBody > (ta.atr(atrLength) * minBodySize)
isHighVolume = volume > avgVolume * 1.2
// ===== ZONAS DE SUPORTE / RESISTÊNCIA (simples) =====
pivotHigh = ta.pivothigh(high, 5, 5)
pivotLow = ta.pivotlow(low, 5, 5)
plotshape(pivotHigh, title="Resistência", location=location.abovebar, color=color.red, style=shape.labeldown, text="RES")
plotshape(pivotLow, title="Suporte", location=location.belowbar, color=color.green, style=shape.labelup, text="SUP")
// ===== SINAL DE COMPRA =====
buySignal = direction == 1 and isStrongCandle and isHighVolume and rsi < 70
if buySignal
strategy.entry("Compra", strategy.long)
label.new(bar_index, low, "BUY", style=label.style_label_up, color=color.green, textcolor=color.white)
// ===== SINAL DE VENDA =====
sellSignal = direction == -1 and isStrongCandle and isHighVolume and rsi > 30
if sellSignal
strategy.entry("Venda", strategy.short)
label.new(bar_index, high, "SELL", style=label.style_label_down, color=color.red, textcolor=color.white)
// ===== SAÍDA =====
strategy.close("Compra", when = sellSignal)
strategy.close("Venda", when = buySignal)
15 ORB Breakout-Retest with Pivot Points Standard1. 15 Minute Opening Range Breakout
2. Entry on Successful Breakout and Retest Confirmation
3. Pivot Points Standard
4. 21 EMA Trend table on different time frames
15Min Engulfing Break StrategyThe strategy involves the Engulfing Theory, Bullish and Bearish Engulfing patterns. Its specifically for 15 Minute chart. win ratio is 76%.
Enhanced Momentum Wave Catcher2 minute scalping strategy using the 200 ema wave and MCB momentum wave and the 9 ema for entry.
Volume Spike with Entry & Stop LossSure! Here's a **short and concise description** of your strategy that you can share with the public:
---
### **Volume Spike with Entry & Stop Loss Strategy**
This strategy identifies **significant volume spikes** in the market combined with **price breakouts** to signal **buy entries**. It aims to capture strong momentum moves while managing risk with a **stop loss**.
- **Entry Signal**: When **volume spikes** (current volume > average volume by a specified multiplier) and the **price breaks above** the highest price in the last N periods.
- **Stop Loss**: Set at a fixed percentage below the entry price to limit potential losses.
**Key Benefits**:
- **Volume-based**: Focuses on detecting high market participation.
- **Price action**: Combines volume with price breakout for stronger entry signals.
- **Risk management**: Includes a stop loss to protect against significant drawdowns.
Ideal for traders looking for momentum-based entries with built-in risk control.
---
This is a **momentum strategy** that thrives during times of high market activity, making it useful for capturing trending moves while minimizing risk.
Buy Sell Ma20 with Volume_[Longtien]Strategy Name: Buy/Sell MA20 with Volume
This strategy uses TradingView’s built-in Technical Rating signals on the 15-minute timeframe, combining them with volume analysis and ATR-based dynamic stop loss.
Buy (Long): When the technical rating > 0.6 and volume is above its 20-period average.
Sell (Short): When the technical rating < -0.6 and volume is above its 20-period average.
Exits use dynamic ATR-based trailing stop and loss.
You can switch between signal sources: Moving Averages, Oscillators, or All.
MA200 + Momentum Candle Strategy (No Duplicate Entry)This strategy is suitable for use on the 4H timeframe and above
Natural Gas Scalping Method v2ultimate scalping stratey for ng,it hels you to capture big moves with a lesser risk
PG2 Mean Reversion Channel - Lower Quartile Loband with MACD🧠 Strategy Overview
This is a mean reversion strategy using multi-filter smoothing for channel detection and MACD-based momentum validation. It’s designed for structured entries near volatility-based lower bounds with adaptive risk control based on dynamic equity drawdown.
⸻
📌 Core Logic
• Lower Quartile Channel Entry:
Uses 8 smoothing filters to create a distribution of lobands and selects the lower quartile as the trigger zone.
• MACD Validation:
Requires MACD histogram to flip from negative to positive, ensuring upward momentum confirmation.
• Entry Trigger:
Entry occurs when:
• Not in a position
• Price is below the lower quartile band
• MACD histogram is positive
⸻
📉 Dynamic Exit & Risk Control
• Per-Trade Equity Tracking:
Tracks equity highs/lows per trade to calculate intra-trade drawdown.
• Rolling Drawdown Threshold:
Stores drawdowns in a rolling array (up to maxGlobalTrades) and uses the max of that array as a dynamic exit threshold.
• Dynamic Drawdown Exit:
If a position is open for over minBarsForDynamicExit and drawdown exceeds the dynamic threshold → exit.
• Cascading Take Profit:
Profit target starts at 7% and slowly degrades by decrement_percent until a min threshold is hit.
• Extended Exit Logic:
After 1000 bars in a trade, triggers additional drawdown-based exit with MACD momentum check.
⸻
📊 Performance Multiplier Logic
• Uses strategy.closedtrades to calculate Profit Factor
• Multiplier is purely reporting metadata — included in alerts but not used for trade logic
• VPS or external system interprets and sizes trades accordingly
⸻
🔔 Automation-Ready Alerts
• Clean JSON payloads
• Payload includes:
• Ticker
• Action (buy3/sell3/sell1)
• Multiplier
• Timeframe & strategy name
⸻
✅ Compliance Highlights
• No repainting
• No security() calls
• No dynamic position sizing inside Pine
• Multiplier is metadata only
• Alerts structured for webhook consumption
Haze EMA SignalStrategy Logic:
Buy Entry 🟢
→ When the 11 EMA crosses above the 50 EMA,
→ And Stochastic RSI shows bullish momentum (%K > %D).
Sell / Exit 🔴
→ When the 11 EMA crosses below the 50 EMA,
→ And Stochastic RSI shows bearish momentum (%K < %D).
This dual-confirmation method helps reduce false signals by combining trend-following and momentum-based entries and exits.
SHORT TERM TRADE SIGNAL
EMA= 11/50
K/D/L=15/7/10
Breakout Entry with BEP, SL & Target//@version=5
strategy("Breakout Entry with BEP, SL & Target", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100)
// === User Inputs ===
resistance = input(23400, "Resistance Level")
stopLoss = input(23250, "Stop Loss Level")
target = input(23600, "Target Level")
premium = input(100, "Premium Paid (for BEP)")
// === Break-even Calculation ===
breakEven = resistance + premium
plot(breakEven, title="Break Even", color=color.orange, linewidth=2)
// === Entry Condition ===
longCondition = ta.crossover(close, resistance)
if (longCondition)
strategy.entry("Buy", strategy.long)
// === Exit Conditions ===
strategy.exit("Exit Target", from_entry="Buy", limit=target, stop=stopLoss)
// === Plots for Reference Levels ===
plot(target, title="Target", color=color.green, linewidth=1)
plot(stopLoss, title="Stop Loss", color=color.red, linewidth=1)
plot(resistance, title="Entry Level", color=color.blue, linewidth=1)
// === Entry Marker (Replaces label.new) ===
plotshape(longCondition, location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small, title="Entry Marker")
20/50 EMA Crossover Strategysimple yet, effective moving average cross over for swing trading, long positions only.
5-Min Call/Put Entry StrategyNifty / Bank Nifty /FinNifty
Call buy signal (all conditions must) :-
5 min time frame Close above 21SMA high
Close above vwap
5 min time frame close above 50 ema
RSI above 60 on 5 min time frame
Put buy signal (all conditions must) :-
5 min time frame Close below 21SMA low
Close below vwap 5 min time frame
close below 50 ema
RSI below 40 on 5 min time frame
Stop Loss condition for Call : 5 min time frame Close below 21SMA Low
Stop Loss condition for Put : 5 min time frame close above 21SMA High
Precision RSI StrategyCall buy signal (all conditions must) :-
5 min time frame Close above 21SMA high
Close above vwap
5 min time frame close above 50 ema
RSI above 60 on 5 min time frame
Put buy signal (all conditions must) :-
5 min time frame Close below 21SMA low
Close below vwap 5 min time frame
close below 50 ema
RSI below 40 on 5 min time frame
Stop Loss condition for Call : 5 min time frame Close below 21SMA Low
Stop Loss condition for Put : 5 min time frame close above 21SMA High
Liquidity SweepsThis indicator will show you all the liquidity sweeps for the previous 'x' amount of candles.
AI Volume StrategyAI Volume Strategy detects significant volume spikes and combines them with trend direction and candlestick color to generate buy and sell signals. The strategy uses an Exponential Moving Average (EMA) of volume to identify abnormal volume spikes that may indicate strong market activity. Additionally, it uses a 50-period EMA of price to filter the trend and decide on entry direction.
Key Features:
Volume Spike Detection: The strategy detects when the current volume exceeds the EMA of volume by a user-defined multiplier, signaling abnormal increases in market activity.
Trend Direction Filter: The strategy uses a 50-period EMA of price to determine the market trend. Buy signals are generated when the price is above the EMA (uptrend), and sell signals are generated when the price is below the EMA (downtrend).
Candle Color Filter: The strategy generates a buy signal only when the current candle is bullish (green) and a sell signal only when the current candle is bearish (red).
Exit after X Bars: The strategy automatically closes the position after a specified number of bars (default is 5 bars), but the exit condition can be adjusted based on user preference, timeframe, and backtesting results. The default exit is after 5 bars, but users can set it to 1 bar or any other number depending on their preferences and strategy.
Signals:
Buy Signal: Generated when a volume spike occurs, the trend is upward, and the current candle is bullish.
Sell Signal: Generated when a volume spike occurs, the trend is downward, and the current candle is bearish.
Alerts:
Buy Alert: Alerts the user when a buy signal is triggered.
Sell Alert: Alerts the user when a sell signal is triggered.
Visualization:
Buy Signal: A green label appears below the bar when the buy conditions are met.
Sell Signal: A red label appears above the bar when the sell conditions are met.
Volume EMA: Optionally, the Volume EMA line can be plotted on the chart to visualize volume trends.
This strategy helps traders identify potential entry points based on increased volume activity while considering trend direction and candlestick patterns. With the ability to adjust the exit condition, users can fine-tune the strategy to their specific needs and backtest results.
20 EMA Cross StrategyWhen a bar crosses an closes above or below the 20 EMA, a buy or sell signal is produced.
Moving Average Shift WaveTrend StrategyMoving Average Shift WaveTrend Strategy
🧭 Overview
The Moving Average Shift WaveTrend Strategy is a trend-following and momentum-based trading system designed to be overlayed on TradingView charts. It executes trades based on the confluence of multiple technical conditions—volatility, session timing, trend direction, and oscillator momentum—to deliver logical and systematic trade entries and exits.
🎯 Strategy Objectives
Enter trades aligned with the prevailing long-term trend
Exit trades on confirmed momentum reversals
Avoid false signals using session timing and volatility filters
Apply structured risk management with automatic TP, SL, and trailing stops
⚙️ Key Features
Selectable MA types: SMA, EMA, SMMA (RMA), WMA, VWMA
Dual-filter logic using a custom oscillator and moving averages
Session and volatility filters to eliminate low-quality setups
Trailing stop, configurable Take Profit / Stop Loss logic
“In-wave flag” prevents overtrading within the same trend wave
Visual clarity with color-shifting candles and entry/exit markers
📈 Trading Rules
✅ Long Entry Conditions:
Price is above the selected MA
Oscillator is positive and rising
200-period EMA indicates an uptrend
ATR exceeds its median value (sufficient volatility)
Entry occurs between 09:00–17:00 (exchange time)
Not currently in an active wave
🔻 Short Entry Conditions:
Price is below the selected MA
Oscillator is negative and falling
200-period EMA indicates a downtrend
All other long-entry conditions are inverted
❌ Exit Conditions:
Take Profit or Stop Loss is hit
Opposing signals from oscillator and MA
Trailing stop is triggered
🛡️ Risk Management Parameters
Pair: ETH/USD
Timeframe: 4H
Starting Capital: $3,000
Commission: 0.02%
Slippage: 2 pips
Risk per Trade: 2% of account equity (adjustable)
Total Trades: 224
Backtest Period: May 24, 2016 — April 7, 2025
Note: Risk parameters are fully customizable to suit your trading style and broker conditions.
🔧 Trading Parameters & Filters
Time Filter: Trades allowed only between 09:00–17:00 (exchange time)
Volatility Filter: ATR must be above its median value
Trend Filter: Long-term 200-period EMA
📊 Technical Settings
Moving Average
Type: SMA
Length: 40
Source: hl2
Oscillator
Length: 15
Threshold: 0.5
Risk Management
Take Profit: 1.5%
Stop Loss: 1.0%
Trailing Stop: 1.0%
👁️ Visual Support
MA and oscillator color changes indicate directional bias
Clear chart markers show entry and exit points
Trailing stops and risk controls are transparently managed
🚀 Strategy Improvements & Uniqueness
In-wave flag avoids repeated entries within the same trend phase
Filtering based on time, volatility, and trend ensures higher-quality trades
Dynamic high/low tracking allows precise trailing stop placement
Fully rule-based execution reduces emotional decision-making
💡 Inspirations & Attribution
This strategy is inspired by the excellent concept from:
ChartPrime – “Moving Average Shift”
It expands on the original idea with advanced trade filters and trailing logic.
Source reference:
📌 Summary
The Moving Average Shift WaveTrend Strategy offers a rule-based, reliable approach to trend trading. By combining trend and momentum filters with robust risk controls, it provides a consistent framework suitable for various market conditions and trading styles.
⚠️ Disclaimer
This script is for educational purposes only. Trading involves risk. Always use proper backtesting and risk evaluation before applying in live markets.