Seçmeli İndikatör Stratejisi
It is a strategy formed with different indicators.
You can determine take profit and stop.
You can use it as a template and create your own strategies.
You can change the values of the indicators from the settings section.
지표 및 전략
Ruben.Ramiro - Momentum Breakout StrategyThis strategy is designed to capture breakout movements aligned with the prevailing trend, using a combination of Exponential Moving Averages (EMAs), Relative Strength Index (RSI), and Average True Range (ATR) for entry signals and risk management. It includes clear long/short entry conditions, dynamic stop-losses.
1. Trend Identification
Uses two EMAs:
• Fast EMA (default 20 periods)
• Slow EMA (default 50 periods)
The trend is considered bullish if EMA Fast > EMA Slow, and bearish if EMA Fast < EMA Slow.
2. Momentum Filter (RSI)
Applies a 14-period RSI to avoid entries during overbought/oversold conditions:
• Avoids long entries when RSI > 70 (overbought)
• Avoids short entries when RSI < 30 (oversold)
3. Breakout Logic
Detects breakouts over a configurable period (default: 5 candles):
• Resistance: Highest high over the last N periods (excluding the current one)
• Support: Lowest low over the last N periods (excluding the current one)
4. Entry Conditions
Long Entry:
• Price breaks above recent resistance
• Uptrend confirmed (EMA Fast > EMA Slow)
• RSI not overbought
Short Entry:
• Price breaks below recent support
• Downtrend confirmed (EMA Fast < EMA Slow)
• RSI not oversold
5. Position Management
Stop-Loss and Trailing Stop based on ATR:
Stop-Loss:
• For long: entry price - (ATR * SL multiplier)
• For short: entry price + (ATR * SL multiplier)
Trailing Stop:
• Uses same ATR * trailing multiplier for both trail_points and trail_offset
• Defaults for both SL and trailing multiplier: 1.5x ATR
6. Alerts (Webhook)
JSON-formatted webhook alerts:
• Long entry: Market buy order
• Short entry: Market sell order
7. Visual Cues
• Green triangle below bar for Long entries
• Red triangle above bar for Short entries
Supply & Demand Zones + Order Block (Pro Fusion) - Auto Order Strategy Title:
Smart Supply & Demand Zones + Order Block Auto Strategy with ScalpPro (Buy-Focused)
📄 Strategy Description:
This strategy combines the power of Supply & Demand Zone analysis, Order Block detection, and an enhanced Scalp Pro momentum filter, specifically designed for automated decision-making based on high-volume breakouts.
✅ Key Features:
Auto Entry (Buy Only) Based on Breakouts
Automatically enters a Buy position when the price breaks out of a valid demand zone, confirmed by EMA 50 trend and volume spike.
Order Block Logic
Identifies bullish and bearish order blocks using consecutive candle structures and significant price movement.
Dynamic Stop Loss & Trailing Stop
Implements a trailing stop once price moves in profit, along with static initial stop loss for risk management.
Clear Visual Labels & Alerts
Displays BUY/SELL, Demand/Supply, and Order Block labels directly on the chart. Alerts trigger on valid breakout signals.
Scalp Pro Momentum Filter (Optimized)
Uses a modified MACD-style momentum indicator to confirm trend strength and filter out weak signals.
Hyperliquid ConnectorThis template can automate your Tradingview strategy on Hyperliquid's decentralized exchange.
Money Printer V3 – BTC 15M EMA Crossover Strategy🚀 Overview
Money Printer V3 is a trend-following strategy built for crypto markets. It uses fast EMA crossovers with RSI filtering, optional MACD and volume confirmation, and ATR-based trailing stops to capture high-probability momentum trades. This version is optimized for 15-minute timeframes with responsive parameters to increase trade frequency and signal clarity.
📈 How It Works
Buy Conditions:
Fast EMA crosses above Slow EMA
RSI > 40 (customizable)
Optional: MACD histogram > 0
Optional: Volume above 1.5x 20-period average
Sell Conditions:
Opposite of the buy conditions
Risk Management:
Stop-loss and trailing stop are dynamically set using ATR
Position size based on account equity and ATR distance (2% risk per trade)
⚙️ Default Settings
Fast EMA: 5
Slow EMA: 20
RSI Threshold: 40
MACD Filter: OFF
Volume Filter: ON
ATR SL Multiplier: 2.5
ATR Trailing Multiplier: 3.5
Risk: 2% of equity per trade
Initial Capital: $5,000
Commission: 0.1%
Slippage: 0.5%
📊 Backtest Notes
Tested on BTC/USD 15-minute timeframe from 2018 to 2024
Produces 100+ trades for statistically relevant sample size
Strategy is not predictive — it reacts to confirmed trends with filters to reduce false signals
Past performance does not guarantee future results
📌 How to Use
Add this strategy to your BTC/USD 15M chart
Customize the input parameters to match your trading style
Enable alerts for buy/sell conditions
Always forward test before using with real funds
⚠️ Disclaimer
This script is for educational and research purposes only. Use at your own risk. Markets are unpredictable, and no strategy can guarantee profits. Always use proper risk management.
Buy on 5% dip strategy with time adjustment
This script is a strategy called "Buy on 5% Dip Strategy with Time Adjustment 📉💡," which detects a 5% drop in price and triggers a buy signal 🔔. It also automatically closes the position once the set profit target is reached 💰, and it has additional logic to close the position if the loss exceeds 14% after holding for 230 days ⏳.
Strategy Explanation
Buy Condition: A buy signal is triggered when the price drops 5% from the highest price reached 🔻.
Take Profit: The position is closed when the price hits a 1.22x target from the average entry price 📈.
Forced Sell Condition: If the position is held for more than 230 days and the loss exceeds 14%, the position is automatically closed 🚫.
Leverage & Capital Allocation: Leverage is adjustable ⚖️, and you can set the percentage of capital allocated to each trade 💸.
Time Limits: The strategy allows you to set a start and end time ⏰ for trading, making the strategy active only within that specific period.
Code Credits and References
Credits: This script utilizes ideas and code from @QuantNomad and jangdokang for the profit table and algorithm concepts 🔧.
Sources:
Monthly Performance Table Script by QuantNomad:
ZenAndTheArtOfTrading's Script:
Strategy Performance
This strategy provides risk management through take profit and forced sell conditions and includes a performance table 📊 to track monthly and yearly results. You can compare backtest results with real-time performance to evaluate the strategy's effectiveness.
The performance numbers shown in the backtest reflect what would have happened if you had used this strategy since the launch date of the SOXL (the Direxion Daily Semiconductor Bull 3x Shares ETF) 📅. These results are not hypothetical but based on actual performance from the day of the ETF’s launch 📈.
Caution ⚠️
No Guarantee of Future Results: The results are based on historical performance from the launch of the SOXL ETF, but past performance does not guarantee future results. It’s important to approach with caution when applying it to live trading 🔍.
Risk Management: Leverage and capital allocation settings are crucial for managing risk ⚠️. Make sure to adjust these according to your risk tolerance ⚖️.
Dow Theory Trend Strategy v3Title: Dow Theory Trend Strategy
Description:
This Pine Script implements a trading strategy based on classic Dow Theory principles for trend identification. It analyzes pivot highs and lows to determine uptrends (Higher Highs & Higher Lows) and downtrends (Lower Highs & Lower Lows), entering trades when the trend direction is confirmed to change.
This version (v3) includes several key features and improvements:
Core Dow Theory Logic: Identifies trends based on confirmed sequences of pivot points detected using ta.pivothigh() and ta.pivotlow().
Improved Trend Persistence: The script confirms an uptrend only on both a Higher High (HH) and Higher Low (HL), and a downtrend on both a Lower High (LH) and Lower Low (LL). Crucially, if neither condition is met, the script maintains the previous trend state (trendDirection ), leading to smoother trend following compared to logic that frequently resets to neutral.
Manual Trend Override: A user input allows you to override the automatic Dow Theory trend detection. You can set the strategy to:
Auto: Follow the calculated Dow Theory trend signals.
Long Only: Only take long entry signals.
Short Only: Only take short entry signals.
Tick-Based Stop Loss & Take Profit: Optional Stop Loss (SL) and Take Profit (TP) levels can be enabled. These are set in Ticks from the entry price using strategy.exit().
Important: You must understand what a 'tick' (syminfo.mintick) represents for the specific instrument you are trading when setting the stopLossTicks and takeProfitTicks inputs (e.g., for EURUSD with mintick=0.00001, a 20 pip SL = 200 ticks).
Clear Visualizations:
Background color changes to reflect the detected Dow Theory trend (Blue for Up, Red for Down, Gray for Undetermined).
Optional markers for confirmed pivot points.
Optional labels indicating confirmed trend change signals (potential entry points).
Code Structure Note: This version defines the options for the "Manual Trend Mode" input directly inline within the input.string() function to potentially improve compatibility for users who experienced issues with copy-pasting previous versions that used a separate array definition.
How it Works:
Pivots are identified using the pivotLookback period (note the inherent lag).
The trend direction (trendDirection) is updated based on HH/HL or LH/LL confirmations, otherwise, it persists.
Strategy enters long on changedToUp (if allowed by mode) and short on changedToDown (if allowed by mode).
If enabled, strategy.exit places SL and TP orders based on the specified number of ticks immediately upon entry.
Inputs:
Calculation Settings:
pivotLookback: Controls pivot detection sensitivity and lag.
Display Settings:
Show Pivot Points: Toggle pivot markers.
Show Trend Change Signals: Toggle entry signal labels.
Strategy Settings:
Manual Trend Mode: Select "Auto", "Long Only", or "Short Only".
Risk Management:
Use Stop Loss: Enable/disable SL.
Stop Loss (Ticks): Set SL distance in ticks.
Use Take Profit: Enable/disable TP.
Take Profit (Ticks): Set TP distance in ticks.
How to Use:
Add the script to your TradingView chart.
Access the Settings panel for the script.
Configure the pivotLookback appropriate for your timeframe and instrument.
Choose your desired Manual Trend Mode.
Enable and configure the Stop Loss (Ticks) and Take Profit (Ticks) carefully, based on the instrument's tick size and your risk management plan.
Use the Strategy Tester tab to backtest performance on historical data.
Disclaimer:
This script is provided for educational and informational purposes only. Trading strategies based on Dow Theory involve inherent lag. Past performance is not indicative of future results. Financial markets involve risk, and you should not trade with capital you cannot afford to lose. Always conduct thorough backtesting and implement robust risk management practices before considering any live trading. This script does not constitute financial advice.
Momentum Strategy with Selectable PositionsThis strategy is written based on momentum 5 and 10. If both momentums are positive, it takes a long position and when both momentums are negative, it takes a short position.
Optimized Trading Strategy v6my strategy is about support and demand, support and resistance timeframe m5 and m15
Golden Cross & Death Cross Strategy with SL & TPGolden Cross (BUY Signal):
• Enter long when 50 EMA crosses above 200 EMA
• Stop-Loss = 1% below entry price
• Take-Profit = 2x risk (default 1:2 ratio)
✅ Death Cross (SELL Signal):
• Enter short when 50 EMA crosses below 200 EMA
• Stop-Loss = 1% above entry price
• Take-Profit = 2x risk
Long Term Profitable Swing | AbbasA Story of a Profitable Swing Trading Strategy
Imagine you're sailing across the ocean, looking for the perfect wave to ride. Swing trading is quite similar—you're navigating the stock market, searching for the ideal moments to enter and exit trades. This strategy, created by Abbas, helps you find those waves and ride them effectively to profitable outcomes.
🌊 Finding the Perfect Wave (Entry)
Our journey begins with two simple signs that tell us a great trading opportunity is forming:
- Moving Averages: We use two lines that follow price trends—the faster one (EMA 16) reacts quickly to recent price moves, and the slower one (EMA 30) gives us a longer-term perspective. When the faster line crosses above the slower line, it's like a clear signal saying, "Hey! The wave is rising, and prices might move higher!"
- RSI Momentum: Next, we check a tool called the RSI, which measures momentum (how strongly prices are moving). If the RSI number is above 50, it means there's enough strength behind this rising wave to carry us forward.
When both signals appear together, that's our green light. It's time to jump on our surfboard and start riding this promising wave.
⚓ Safely Riding the Wave (Risk Management)
While we're riding this wave, we want to ensure we're safe from sudden surprises. To do this, we use something called the Average True Range (ATR), which measures how volatile (or bumpy) the price movements are:
- Stop-Loss: To avoid falling too hard, we set a safety line (stop-loss) 8 times the ATR below our entry price. This helps ensure we exit if the wave suddenly turns against us, protecting us from heavy losses.
- Take Profit: We also set a goal to exit the trade at 11 times the ATR above our entry. This way, we capture significant profits when the wave reaches a nice high point.
🌟 Multiple Rides, Bigger Adventures
This strategy allows us to take multiple positions simultaneously—like riding several waves at once, up to 5. Each trade we make uses only 10% of our trading capital, keeping risks manageable and giving us multiple opportunities to win big.
🗺️ Easy to Follow Settings
Here are the basic settings we use:
- Fast EMA**: 16
- Slow EMA**: 30
- RSI Length**: 9
- RSI Threshold**: 50
- ATR Length**: 21
- ATR Stop-Loss Multiplier**: 8
- ATR Take-Profit Multiplier**: 11
These settings are flexible—you can adjust them to better suit different markets or your personal trading style.
🎉 Riding the Waves of Success
This simple yet powerful swing trading approach helps you confidently enter trades, clearly know when to exit, and effectively manage your risk. It’s a reliable way to ride market waves, capture profits, and minimize losses.
Happy trading, and may you find many profitable waves to ride! 🌊✨
Please test, and take into account that it depends on taking multiple longs within the swing, and you only get to invest 25/30% of your equity.
RecoveryPLAN - XAUUSD 1DCopyright RecoveryPLAN
This indicator utilizes the probability opportunities of the XAUUSD candlestick habits which are specifically designed for the 1D timeframe and have minimal risk because they use a relatively small stop loss.
SPY MACD Histogram Reversals and RejectionsStrategy Overview: Intraday SPY Options Day Trading with MACD Histogram Reversals and Rejections
This is an intraday trading strategy designed specifically for trading SPY (or SPX) using 1DTE options. It focuses on price action during the morning session and leverages MACD histogram crossovers, volatility analysis, and short-term price rejections to enter directional trades (calls or puts). The goal is to capitalize on early momentum shifts and retracement failures after initial market moves.
Key Trading Hours and Constraints
Trading Window: Only trades between 9:50 AM and 1:00 PM EST are considered.
Trade Cutoff Buffer: New trades are blocked in the final 5 minutes before the 1:00 PM end time to avoid auto-close conflicts.
First Hour Focus: Special logic applies during the first hour of the session (9:30 AM to 10:30 AM), where reversal-based setups are tracked more aggressively.
MACD Histogram Setup
The strategy calculates both 5-minute and 10-minute MACD values.
Signals are generated when the 5-minute MACD histogram crosses the zero line, indicating a momentum shift.
The magnitude of the histogram (absolute value) must exceed a threshold (0.10) to validate strong enough momentum.
The 10-minute histogram is used as a confirmation filter: if it’s under 0.17 in magnitude, it favors a call entry (bullish breakout); otherwise, it defaults to put entry (bearish momentum).
Reversal & Protection Logic (Early Morning Retests)
Call Rejection Protection (To avoid entering long after a strong upward move and sharp retrace):
Monitors price from 9:30–10:00 AM for the lowest point.
Then from 10:00–10:35 AM, it tracks the highest price.
If price retraces more than 90% of that move up, it avoids new call entries.
Put Rejection Protection (To avoid entering short after a downward move and retrace):
Tracks the highest point from 9:30–10:00 AM, then the lowest price from 10:00–10:35 AM.
If price retraces more than 90% of that downward move, put entries are skipped.
This avoids buying into failed breakouts or deep retracements, protecting against reversal traps.
Entry Conditions Summary
A trade is considered only if:
It's within the allowed time window.
MACD histogram crosses zero with sufficient strength.
No retracement rejection conditions are triggered.
The 10-minute MACD filter confirms momentum direction.
Risk Management – Dynamic ATR-Based Stop Loss & Profit Target
Uses a 6-period ATR to size both the stop loss and profit target.
ATR multipliers are adjusted dynamically based on RSI(14) values to account for current volatility and overbought/oversold conditions:
Profit Targets: Scaled using an aggressive ATR multiplier tied to RSI position.
Stop Losses: Slightly wider to prevent premature exits from minor retracements.
This adaptive approach helps ensure realistic targets while keeping risk within bounds.
Options Profit Estimation
Estimated option move is calculated using:
The difference between entry price and the profit target (in underlying asset).
Assumes 0.48 delta to approximate the expected option gain/loss.
These values are displayed directly on the chart as part of the trade label.
Trade Execution and Labeling
Each trade is assigned a unique ID and visually labeled on the chart with:
Direction (Call or Put)
Profit target level
Estimated underlying move
Estimated option gain in dollars
Alerts are also triggered to notify on entry signals, showing the estimated option profit.
Performance Tracking and Statistics
Tracks total trades, wins, losses, and current win streak using strategy.closedtrades.
Displays these values in a live stats table on the chart for real-time feedback.
Additional Visual Aids
Table showing:
MACD profit targets and histograms
Estimated option moves
Intraday range (high – low)
Draws a horizontal line at the nearest rounded price level for quick visual context.
Marks key morning times (9:55, 10:00, and 10:30) with small labeled markers.
Overall Objective
This strategy aims to:
Catch early directional momentum in SPY within a controlled risk framework.
Avoid trading into retracements or false breakouts.
Provide visually clear, data-supported trade entries for real-time manual execution.
Estimate profitability in terms of options pricing for quick decision-making.
It's ideal for traders looking to day trade 0DTE or 1DTE SPY options using technical triggers, real-time filtering, and protective logic to reduce false signals and improve timing.
Ersin Efsanesi Stratejisi v1.0This strategy uses moving averages, RSI, and volume analysis to identify potential buy and sell signals. It aims to find market trends and provide trading opportunities based on specific technical indicators.
EMA 10/55/200 - LONG ONLY MTF (4h with 1D & 1W confirmation)Title: EMA 10/55/200 - Long Only Multi-Timeframe Strategy (4h with 1D & 1W confirmation)
Description:
This strategy is designed for trend-following long entries using a combination of exponential moving averages (EMAs) on the 4-hour chart, confirmed by higher timeframe trends from the daily (1D) and weekly (1W) charts.
🔍 How It Works
🔹 Entry Conditions (4h chart):
EMA 10 crosses above EMA 55 and price is above EMA 55
OR
EMA 55 crosses above EMA 200
OR
EMA 10 crosses above EMA 500
These entries indicate short-term momentum aligning with medium/long-term trend strength.
🔹 Confirmation (multi-timeframe alignment):
Daily (1D): EMA 55 is above EMA 200
Weekly (1W): EMA 55 is above EMA 200
This ensures that we only enter long trades when the higher timeframes support an uptrend, reducing false signals during sideways or bearish markets.
🛑 Exit Conditions
Bearish crossover of EMA 10 below EMA 200 or EMA 500
Stop Loss: 5% below entry price
⚙️ Backtest Settings
Capital allocation per trade: 10% of equity
Commission: 0.1%
Slippage: 2 ticks
These are realistic conditions for crypto, forex, and stocks.
📈 Best Used On
Timeframe: 4h
Instruments: Trending markets like BTC/ETH, FX majors, or growth stocks
Works best in volatile or trending environments
⚠️ Disclaimer
This is a backtest tool and educational resource. Always validate on demo accounts before applying to real capital. Do your own due diligence.
External Signals Strategy TesterExternal Signals Strategy Tester
This strategy is designed to help you backtest external buy/sell signals coming from another indicator on your chart. It is a flexible and powerful tool that allows you to simulate real trading based on signals generated by any indicator, using input.source connections.
🔧 How It Works
Instead of generating signals internally, this strategy listens to two external input sources:
One for buy signals
One for sell signals
These sources can be connected to the plots from another indicator (for example, custom indicators, signal lines, or logic-based plots).
To use this:
Add your indicator to the chart (it must be visible on the same pane as this strategy).
Open the settings of the strategy.
In the fields Buy Signal and Sell Signal, select the appropriate plot (line, value, etc.) from the indicator that represents the buy/sell logic.
The strategy will open positions when the selected buy signal crosses above 0, and sell signal crosses above 0.
This logic can be easily adapted by modifying the crossover rule inside the script if your signal style is different.
⚙️ Features Included
✅ Configurable trade direction:
You can choose whether to allow long trades, short trades, or both.
✅ Optional close on opposite signal:
When enabled, the strategy will exit the current position if an opposite signal appears.
✅ Optional full position reversal:
When enabled, the strategy will close the current position and immediately open an opposite one on the reverse signal.
✅ Risk Management Tools:
You can define:
Take Profit (TP): Position will be closed once the specified profit (in %) is reached.
Stop Loss (SL): Position will be closed if the price drops to the specified loss level (in %).
BreakEven (BE): Once the specified profit threshold is reached, the strategy will move the stop-loss to the entry price.
📌 If any of these values (TP, SL, BE) are set to 0, the feature is disabled and will not be applied.
🧪 Best Use Cases
Backtesting signals from custom indicators, without rewriting the logic into a strategy.
Comparing the performance of different signal sources.
Testing external indicators with optional position management logic.
Validating strategies using external filters, oscillators, or trend signals.
📌 Final Notes
You can visualize where the strategy detected buy/sell signals using green/red markers on the chart.
All parameters are customizable through the strategy settings panel.
This strategy does not repaint, and it processes signals in real-time only (no lookahead bias).
CPR Trading Strategy//@version=5
strategy("CPR Trading Strategy", overlay=true, margin_long=100, margin_short=100)
// Input Parameters
stopLossPerc = input.float(1.5, "Stop Loss %", minval=0.1, maxval=10, step=0.1) / 100
takeProfitPerc = input.float(3.0, "Take Profit %", minval=0.1, maxval=10, step=0.1) / 100
useCPRFilter = input.bool(true, "Use CPR Filter")
showCPRLines = input.bool(true, "Show CPR Lines")
// Calculate CPR Levels
pivot = (high + low + close) / 3
bc = (high + low) / 2
tc = (pivot - bc) + pivot
// Plot CPR Levels
plot(showCPRLines ? pivot : na, "Pivot", color=color.new(#2962FF, 0), linewidth=2)
plot(showCPRLines ? bc : na, "BC", color=color.new(#FF6D00, 0), linewidth=1)
plot(showCPRLines ? tc : na, "TC", color=color.new(#00C853, 0), linewidth=1)
// Trading Conditions
priceAbovePivot = close > pivot
priceBelowPivot = close < pivot
priceBetweenBC_TC = close > bc and close < tc
// Entry Logic
longCondition = priceAbovePivot and (useCPRFilter ? priceBetweenBC_TC : true)
shortCondition = priceBelowPivot and (useCPRFilter ? priceBetweenBC_TC : true)
// Execute Trades
if (longCondition)
entryPrice = close
strategy.entry("Long", strategy.long)
strategy.exit("Long Exit", "Long", stop=entryPrice * (1 - stopLossPerc), limit=entryPrice * (1 + takeProfitPerc))
if (shortCondition)
entryPrice = close
strategy.entry("Short", strategy.short)
strategy.exit("Short Exit", "Short", stop=entryPrice * (1 + stopLossPerc), limit=entryPrice * (1 - takeProfitPerc))
// Visual Signals
bgcolor(longCondition ? color.new(color.green, 90) : shortCondition ? color.new(color.red, 90) : na)
plotshape(longCondition, "Buy Signal", shape.triangleup, location=location.belowbar, color=color.green, size=size.small)
plotshape(shortCondition, "Sell Signal", shape.triangledown, location=location.abovebar, color=color.red, size=size.small)
SPY Enhanced Short Signals – Fixed1.54% profit per trade
SPY Enhanced Short Signals – Fixed is a 5-minute strategy for SPY that triggers short entries when price nears resistance under confirmed bearish conditions (RSI below 45, MACD momentum, and volume spikes). It uses ATR-based dynamic exits to manage risk with adaptive take profit and stop loss settings. Customize inputs for optimal performance.
Dow Theory Trend StrategyDow Theory Trend Strategy (Pine Script)
Overview
This Pine Script implements a trading strategy based on the core principles of Dow Theory. It visually identifies trends (uptrend, downtrend) by analyzing pivot highs and lows and executes trades when the trend direction changes. This script is an improved version that features refined trend determination logic and strategy implementation.
Core Concept: Dow Theory
The script uses a fundamental Dow Theory concept for trend identification:
Uptrend: Characterized by a series of Higher Highs (HH) and Higher Lows (HL).
Downtrend: Characterized by a series of Lower Highs (LH) and Lower Lows (LL).
How it Works
Pivot Point Detection:
It uses the built-in ta.pivothigh() and ta.pivotlow() functions to identify significant swing points (potential highs and lows) in the price action.
The pivotLookback input determines the number of bars to the left and right required to confirm a pivot. Note that this introduces a natural lag (equal to pivotLookback bars) before a pivot is confirmed.
Improved Trend Determination:
The script stores the last two confirmed pivot highs and the last two confirmed pivot lows.
An Uptrend (trendDirection = 1) is confirmed only when the latest pivot high is higher than the previous one (HH) AND the latest pivot low is higher than the previous one (HL).
A Downtrend (trendDirection = -1) is confirmed only when the latest pivot high is lower than the previous one (LH) AND the latest pivot low is lower than the previous one (LL).
Key Improvement: If neither a clear uptrend nor a clear downtrend is confirmed based on the latest pivots, the script maintains the previous trend state (trendDirection := trendDirection ). This differs from simpler implementations that might switch to a neutral/range state (e.g., trendDirection = 0) more frequently. This approach aims for smoother trend following, acknowledging that trends often persist through periods without immediate new HH/HL or LH/LL confirmations.
Trend Change Detection:
The script monitors changes in the trendDirection variable.
changedToUp becomes true when the trend shifts to an Uptrend (from Downtrend or initial state).
changedToDown becomes true when the trend shifts to a Downtrend (from Uptrend or initial state).
Visualizations
Background Color: The chart background is colored to reflect the currently identified trend:
Blue: Uptrend (trendDirection == 1)
Red: Downtrend (trendDirection == -1)
Gray: Initial state or undetermined (trendDirection == 0)
Pivot Points (Optional): Small triangles (shape.triangledown/shape.triangleup) can be displayed above pivot highs and below pivot lows if showPivotPoints is enabled.
Trend Change Signals (Optional): Labels ("▲ UP" / "▼ DOWN") can be displayed when a trend change is confirmed (changedToUp / changedToDown) if showTrendChange is enabled. These visually mark the potential entry points for the strategy.
Strategy Logic
Entry Conditions:
Enters a long position (strategy.long) using strategy.entry("L", ...) when changedToUp becomes true.
Enters a short position (strategy.short) using strategy.entry("S", ...) when changedToDown becomes true.
Position Management: The script uses strategy.entry(), which automatically handles position reversal. If the strategy is long and a short signal occurs, strategy.entry() will close the long position and open a new short one (and vice-versa).
Inputs
pivotLookback: The number of bars on each side to confirm a pivot high/low. Higher values mean pivots are confirmed later but may be more significant.
showPivotPoints: Toggle visibility of pivot point markers.
showTrendChange: Toggle visibility of the trend change labels ("▲ UP" / "▼ DOWN").
Key Improvements from Original
Smoother Trend Logic: The trend state persists unless a confirmed reversal pattern (opposite HH/HL or LH/LL) occurs, reducing potential whipsaws in choppy markets compared to logic that frequently resets to neutral.
Strategy Implementation: Converted from a pure indicator to a strategy capable of executing backtests and potentially live trades based on the Dow Theory trend changes.
Disclaimer
Dow Theory signals are inherently lagging due to the nature of pivot confirmation.
The effectiveness of the strategy depends heavily on the market conditions and the chosen pivotLookback setting.
This script serves as a basic template. Always perform thorough backtesting and implement proper risk management (e.g., stop-loss, take-profit, position sizing) before considering any live trading.
US30 1-min Strategy with TP/SL, Grades, Alerts🟢 Grade A (Strongest)
• Candle is very large (body is 2x the 20-bar average)
• Volume rising
• RSI strongly confirms direction (RSI > 55 or < 45)
🟠 Grade B (Moderate)
• Candle is large
• Volume rising
• RSI confirms trend (but not as strong as A)
🟡 Grade C (Weak)
• Candle is large
• Volume rising or RSI confirms (not both)
You can select which grades to trade (A, B, C) from the strategy settings.
💰 Risk Management
• Take Profit: Default = 0.5%
• Stop Loss: Default = 0.3%
TP and SL are applied as percentage of entry price. You can adjust both in the strategy settings.
Trade Alerts & Visuals
• Labels appear on the chart when a trade is triggered (green for longs, red for shorts, with grade label)
• Alerts are sent using the alert() function, which you can link to popups, emails, or mobile notifications via TradingView
🧭 Strategy Use Case
This strategy is ideal for:
• Scalping US30 during high-volume sessions
• Traders who prefer rules-based setups with clear grading and confirmation
• Running backtests in TradingView with risk controls and performance analysis
KumoBreakLongShows Breakouts over and under Kumo Cloud, don't trade with it, just use it as indicator
Arbitrage Spot-Futures Don++Strategy: Spot-Futures Arbitrage Don++
This strategy has been designed to detect and exploit arbitrage opportunities between the Spot and Futures markets of the same trading pair (e.g. BTC/USDT). The aim is to take advantage of price differences (spreads) between the two markets, while minimizing risk through dynamic position management.
[Operating principle
The strategy is based on calculating the spread between Spot and Futures prices. When this spread exceeds a certain threshold (positive or negative), reverse positions are opened simultaneously on both markets:
- i] Long Spot + Short Futures when the spread is positive.
- i] Short Spot + Long Futures when the spread is negative.
Positions are closed when the spread returns to a value close to zero or after a user-defined maximum duration.
[Strategy strengths
1. Adaptive thresholds :
- Entry/exit thresholds can be dynamic (based on moving averages and standard deviations) or fixed, offering greater flexibility to adapt to market conditions.
2. Robust data management :
- The script checks the validity of data before executing calculations, thus avoiding errors linked to missing or invalid data.
3. Risk limitation :
- A position size based on a percentage of available capital (default 10%) limits exposure.
- A time filter limits the maximum duration of positions to avoid losses due to persistent spreads.
4. Clear visualization :
- Charts include horizontal lines for entry/exit thresholds, as well as visual indicators for spread and Spot/Futures prices.
5. Alerts and logs :
- Alerts are triggered on entries and exits to inform the user in real time.
[Points for improvement or completion
Although this strategy is functional and robust, it still has a few limitations that could be addressed in future versions:
1. [Limited historical data :
- TradingView does not retrieve real-time data for multiple symbols simultaneously. This can limit the accuracy of calculations, especially under conditions of high volatility.
2. [Lack of liquidity management :
- The script does not take into account the volumes available on the order books. In conditions of low liquidity, it may be difficult to execute orders at the desired prices.
3. [Non-dynamic transaction costs :
- Transaction costs (exchange fees, slippage) are set manually. A dynamic integration of these costs via an external API would be more realistic.
4. User-dependency for symbols :
- Users must manually specify Spot and Futures symbols. Automatic symbol validation would be useful to avoid configuration errors.
5. Lack of advanced backtesting :
- Backtesting is based solely on historical data available on TradingView. An implementation with third-party data (via an API) would enable the strategy to be tested under more realistic conditions.
6. [Parameter optimization :
- Certain parameters (such as analysis period or spread thresholds) could be optimized for each specific trading pair.
[How can I contribute?
If you'd like to help improve this strategy, here are a few ideas:
1. Add additional filters:
- For example, a filter based on volume or volatility to avoid false signals.
2. Integrate dynamic costs:
- Use an external API to retrieve actual costs and adjust thresholds accordingly.
3. Improve position management:
- Implement hedging or scalping mechanisms to maximize profits.
4. Test on other pairs:
- Evaluate the strategy's performance on other assets (ETH, SOL, etc.) and adjust parameters accordingly.
5. Publish backtesting results :
- Share detailed analyses of the strategy's performance under different market conditions.
[Conclusion
This Spot-Futures arbitrage strategy is a powerful tool for exploiting price differentials between markets. Although it is already functional, it can still be improved to meet more complex trading scenarios. Feel free to test, modify and share your ideas to make this strategy even more effective!
[Thank you for contributing to this open-source community!
If you have any questions or suggestions, please feel free to comment or contact me directly.
Adaptive KDJ (MTF)Hey guys,
this is an adaptive MTF KDJ oscillator.
Pick up to 3 different timeframes, choose a weighting if you want and enjoy the beautiful signals it will show you.
The length of every timeframe is adaptive and based of the timeframe's ATR.
The plot shows the smoothed average of the 3 KDJ values.
Large triangles show KDJ crossings.
Small triangles show anticipations of possible crossings.
I found out it works best with 1m, 5m, 15m and weighting=1 for forex scalping in 1m.
Use other indicators for confluence.
Enhanced Trading Strategy with RSI, MACD, TP/SL📌 Enhanced Trading Strategy with RSI, MACD, TP/SL
This Pine Script strategy identifies high-probability trading signals using multiple confluences, including Engulfing & Pin Bar candle patterns, trend filtering with EMA, momentum confirmation with RSI & MACD, and an ATR-based risk management system.
🔹 Key Features:
1. **EMA Trend Filter (50-period EMA)**
- Helps determine market direction.
- Buy signals are valid only above EMA 50.
- Sell signals are valid only below EMA 50.
2. **Candle Pattern Detection**
- **Bullish Engulfing** & **Bearish Engulfing** confirm strong reversals.
- **Bullish Pin Bar** & **Bearish Pin Bar** indicate rejection zones.
3. **Momentum Confirmation (RSI & MACD)**
- RSI prevents overbought/oversold trades.
- MACD ensures trend momentum aligns with the trade.
4. **Risk Management (ATR-based TP & SL)**
- Take Profit and Stop Loss levels dynamically adjust based on ATR.
- Helps optimize risk-to-reward ratios.
5. **Trade Execution & Alerts**
- The script generates buy/sell orders when all conditions align.
- Alerts notify traders when a signal is triggered.
📊 Best Timeframe & Win Rate for BTC
✅ **4H (Best for Swing Trading)**
✅ **1H (Balanced for Day Trading)**
✅ **15M (Scalping Possible but More Noise)**
**Estimated Win Rate:**
- Backtesting on BTC/USD (4H timeframe) suggests a **win rate of 60-75%**, depending on market conditions.
- The strategy performs **best in trending markets** and may require additional filtering during sideways movements.
🚀 **Optimize further?** Consider adding Bollinger Bands, Volume, or Trend Strength filters.