9/21 EMA_DSWThe 9 and 21 EMA strategy involves using the 9-day and 21-day exponential moving averages to identify potential buy and sell signals. A buy signal is generated when the 9 EMA crosses above the 21 EMA, and a sell signal is generated when the 9 EMA crosses below the 21 EMA.
Индикаторы и стратегии
9/21 EMA_DSWThe 9 and 21 Exponential Moving Average (EMA) crossover is a popular technical indicator used by traders to identify potential buy and sell signals in the market. The 9 EMA is a shorter-term moving average, which responds more quickly to recent price movements, while the 21 EMA is a longer-term moving average that smooths out price action over a longer period. A bullish signal occurs when the 9 EMA crosses above the 21 EMA, suggesting upward momentum and a potential buying opportunity. Conversely, a bearish signal occurs when the 9 EMA crosses below the 21 EMA, indicating downward momentum and a potential selling opportunity. Traders often use this crossover in combination with other indicators, such as volume or RSI, to confirm the strength of the trend. The strategy is commonly applied in various time frames, from intraday charts to longer-term setups, and is widely used for trend-following strategies. However, it’s essential to keep in mind that the EMA crossover strategy can produce false signals in choppy or sideways markets.
EMA & MA Crossover StrategyEMA & MA Crossover Strategy
The EMA & MA Crossover Strategy is a comprehensive and versatile trading strategy designed to capture trend-following opportunities in the market. This script combines several advanced features, such as moving averages, percentage-based thresholds, swing lookbacks, and adaptive conditions, to provide reliable buy and sell signals. Key features of the strategy include:
Key Highlights:
Dual Moving Averages:
The strategy uses a Simple Moving Average (SMA) and an Exponential Moving Average (EMA) for crossover signals to determine trend direction and momentum.
Hull Moving Average (HMA) Ribbon:
Integrated HMA conditions enhance trend identification by ensuring alignment with momentum.
Dynamic Entry Filtering:
Incorporates a run-up threshold to exclude high-volatility candles and ignores the initial candles of a new day, reducing false signals in volatile markets.
Percentage-Based Calculations:
Utilizes the Williams %R indicator for dynamic upper and lower price levels, enhancing precision in overbought and oversold zones.
Swing High/Low Analysis:
Detects recent swing highs and lows within a customizable lookback period, adding flexibility for different trading styles.
Daily High/Low Monitoring:
Tracks and updates the intraday high and low levels in real time for added context to market conditions.
Buy & Sell Conditions:
Buy: Conditions include price above moving averages, bullish candle patterns, %R improvement, and alignment of EMA ribbons.
Sell: Triggered when prices fall below moving averages or %R hits oversold levels.
Customizable Parameters:
Adjustable lengths for moving averages, percentage thresholds, and swing lookback ensure adaptability to various market conditions and trading preferences.
Visual Enhancements:
Bar Colors: Green bars indicate potential buy zones, while red bars highlight sell zones, aiding quick visual recognition.
Dynamic Levels: Plots higher and lower lines based on %R calculations to provide dynamic support and resistance insights.
This script is a powerful tool for traders seeking a balance between technical indicators and adaptive filtering for improved signal reliability. It can be applied to a wide range of markets, including equities, forex, and cryptocurrencies. Experiment with the customizable settings to tailor the strategy to your trading style!
2-Candle Breakout StrategyTrade on buy sell signal works on 30min ...hourly timeframe... buy next candle of signal candle corssing high ...opposite for Sell
Bollinger Bands, Williams Alligator & RSI StrategyCombined Bollinger Bands, Williams Alligator & RSI Strategy
EMA DSWThis Pine Script indicator implements a trading strategy based on the crossover of 5-period and 9-period Exponential Moving Averages (EMA). It generates entry signals when the 5 EMA crosses above the 9 EMA, and exit signals when the 5 EMA crosses below the 9 EMA. The script also calculates and displays stop-loss and target levels for each trade. Users can customize the EMA periods, stop-loss percentage, and target percentage through input parameters. The indicator plots the EMAs on the chart and displays entry and exit markers for visual reference
Jinx Systems - AdvancedWorking solution to the question, "Hey, where the heck is the market going?"
Run this script on as many securities as one can manage.
Simple MA Crossover StrategyThe Simple Moving Average Crossover Strategy is a trend-following strategy that uses two moving averages—a fast moving average (shorter period) and a slow moving average (longer period)—to identify potential buy and sell opportunities.
Buy Signal: When the fast moving average crosses above the slow moving average, indicating upward momentum.
Sell Signal: When the fast moving average crosses below the slow moving average, signaling potential downward momentum.
This strategy works best in trending markets, aiming to capture profits during sustained price movements while avoiding false signals in ranging conditions.
BTC/USD Gaussian Channel 1 Day Chart - Foneysmiles v1.0 Cryptocurrency trading strategy specifically designed for BTC/USD on a daily timeframe.
Strategy Framework:
Initial capital: $10,000
Position size: 60% of equity per trade
Commission: 0.1%
Slippage: 4 points
Time range: From January 2018 to end of 2069 (effectively no end date)
Gaussian Channel: The primary technical indicator that creates an adaptive channel around price
Uses a complex Gaussian filter with customizable poles (default 4)
Sampling period of 144 days
True Range multiplier of 1.414
Options for reduced lag and fast response modes
Price source defaults to HLC3 (High + Low + Close / 3)
Stochastic RSI with:
RSI length: 21 periods
Stochastic length: 200 periods
K smoothing: 1 period
D smoothing: 4 periods
Entry Conditions:
A long position is entered when ALL of these conditions are met:
The Gaussian filter is trending up (finalFilter > finalFilter )
Price is above the upper Gaussian channel band (close > hband)
Stochastic RSI is in extreme territory (k > 80 or k < 20)
Within the specified date range
Exit Conditions:
Positions are closed when price crosses below the upper band of the Gaussian channel
The visualization includes:
A color-coded Gaussian filter line (green when rising, red when falling)
Upper and lower bands forming a channel
The channel is filled with a semi-transparent version of the same color
This is a trend-following strategy that aims to catch strong upward moves in Bitcoin while using the Stochastic RSI as an additional filter. The strategy only takes long positions and doesn't include any short trades.
foneysmiles@gmail.com if you have any questions or have other use cases
Donchian Breakout StrategyOverview
The Donchian Breakout Strategy is a trend-following system that identifies potential long trade opportunities based on price breakouts from a specified range (Donchian Channel). This script enhances the traditional Donchian breakout strategy by adding an optional volume filter and integrating the Supertrend indicator for additional confirmation.
This indicator is particularly effective on daily or weekly charts of indices like Nifty and BankNifty, but it can also be used on other instruments with strong trending characteristics.
Key Features
Donchian Channel:
Calculates the highest high and lowest low over a user-defined period.
Provides visual cues for price breakouts (upper band) and breakdowns (lower band).
Optional Volume Filter:
Filters buy signals by requiring volume to exceed its 20-period moving average (enabled/disabled via a toggle).
Supertrend Indicator:
Confirms the trend direction.
Plots a green line for bullish trends and a red line for bearish trends.
Configurable Exit Options:
Multiple exit strategies, including lower Donchian band, mid-band (basis line), or Supertrend.
Trailing stop-loss option to lock in profits.
Backtest Date Range:
Specify the start and end dates for backtesting the strategy.
Inputs and Settings
1. Donchian Channel
Length: The number of bars used to calculate the highest high and lowest low (default: 21).
2. Volume Filter
Enable Volume Filter: Toggles the volume filter on or off. When enabled, long entries require the volume to exceed its 20-period moving average.
3. Supertrend
Multiplier: Adjusts the sensitivity of the Supertrend indicator (default: 1).
Length: Defines the period for the Supertrend calculation (default: 10).
4. Exit Options
Exit Option:
Option 1: Exit when the price crosses below the lower Donchian band.
Option 2: Exit when the price crosses below the mid-band (basis line).
Option 3: Exit when the price crosses below the Supertrend line.
Option 4: Use a trailing stop-loss (default percentage: 3%).
5. Backtesting Range
Start/End Date: Define the period for backtesting trades. Entries and exits will only occur within this range.
How to Use
Step 1: Add the Indicator
Apply this script to your TradingView chart.
Use it on instruments with strong trending characteristics, such as indices or trending stocks.
Step 2: Configure Inputs
Adjust the Donchian length based on your preferred timeframe and market conditions (e.g., 21 for daily, 52 for weekly charts).
Toggle the volume filter to filter false signals during low-volume periods.
Customize the Supertrend multiplier and length to align with your risk tolerance.
Step 3: Interpret Signals
Long Entry:
Triggered when the price closes above the upper Donchian band.
(Optional) Volume must exceed its 20-period moving average if the filter is enabled.
Exit:
Select an exit strategy that matches your trading style:
Trend-following: Use the Supertrend line.
Range-bound: Use the lower Donchian band or mid-band.
Example Usage Scenarios
Trending Markets:
Apply on indices like Nifty or BankNifty with daily/weekly timeframes.
Enable the volume filter to confirm strong breakouts.
Use the Supertrend for trend direction and trailing stops.
Swing Trading:
Use shorter Donchian lengths (e.g., 10) to capture smaller price movements.
Disable the volume filter for highly liquid instruments.
Best Practices
Combine with higher timeframes (e.g., weekly chart) for trend confirmation.
Use the Supertrend indicator to stay in trades during trending markets.
Backtest with various settings to identify optimal parameters for your preferred instruments.
Warnings
This strategy works best in trending markets; performance may degrade in choppy or range-bound conditions.
The volume filter might reduce the number of signals, which could limit opportunities in low-volume instruments.
Always combine this indicator with proper risk management practices.
Visualization
Donchian Channel:
Upper band: Represents breakout levels.
Lower band: Represents breakdown levels.
Mid-band (orange): Average of the upper and lower bands.
Supertrend:
Green line: Bullish trend.
Red line: Bearish trend.
Volume Filter:
Ensure volume exceeds the 20-period moving average for valid long entries (when enabled).
VWAP + Fibo + Chandelier ExitOpis funkcji i integracji
VWAP i Fibo:
Oblicza poziomy Fibonacciego na podstawie VWAP.
Dodaje sygnały kupna/sprzedaży w oparciu o przecięcia cen z poziomami Fibo.
Chandelier Exit:
Działa niezależnie od VWAP.
Generuje sygnały na podstawie zmiany kierunku trendu.
Wizualizacja:
Poziomy VWAP i Fibo są oznaczone różnymi kolorami.
Poziomy Chandelier Exit są widoczne jako linie wsparcia/oporu.
Sygnały są oznaczone etykietami na wykresie.
Zlecenia:
Strategie otwierają i zamykają pozycje w oparciu o oba wskaźniki.Opis funkcji i integracji
VWAP i Fibo:
Oblicza poziomy Fibonacciego na podstawie VWAP.
Dodaje sygnały kupna/sprzedaży w oparciu o przecięcia cen z poziomami Fibo.
Chandelier Exit:
Działa niezależnie od VWAP.
Generuje sygnały na podstawie zmiany kierunku trendu.
Wizualizacja:
Poziomy VWAP i Fibo są oznaczone różnymi kolorami.
Poziomy Chandelier Exit są widoczne jako linie wsparcia/oporu.
Sygnały są oznaczone etykietami na wykresie.
Zlecenia:
Strategie otwierają i zamykają pozycje w oparciu o oba wskaźniki.
Yash Zones Strategy v6Modern strategy declaration syntax
Proper commission settings
barmerge.gaps_off for security calls
Color management with color.new()
Null-coalescing operator (?:) removed in favor of ternary
Cleaner position sizing calculation
Improved visual plotting syntax
Full TypeScript-style type safety
Enhanced error handling for edge cases
Strategy Features:
Complete backtesting capability
Real-time trading alerts
Automatic position sizing
Trailing stop functionality
Multi-timeframe confirmation
Volume liquidity filters
Professional risk management parameters
Clear visual signal markers
This version includes all the latest Pine Script v6 features while maintaining the original Yash logic with enhanced reliability and performance.
Double Screen Backtest Strategy//@version=5
indicator(shorttitle="BB", title="Bollinger Bands", overlay=true, timeframe="", timeframe_gaps=true)
length = input.int(20, minval=1)
maType = input.string("SMA", "Basis MA Type", options = )
src = input(close, title="Source")
mult = input.float(2.0, minval=0.001, maxval=50, title="StdDev")
ma(source, length, _type) =>
switch _type
"SMA" => ta.sma(source, length)
"EMA" => ta.ema(source, length)
"SMMA (RMA)" => ta.rma(source, length)
"WMA" => ta.wma(source, length)
"VWMA" => ta.vwma(source, length)
basis = ma(src, length, maType)
dev = mult * ta.stdev(src, length)
upper = basis + dev
lower = basis - dev
offset = input.int(0, "Offset", minval = -500, maxval = 500)
plot(basis, "Basis", color=#FF6D00, offset = offset)
p1 = plot(upper, "Upper", color=#2962FF, offset = offset)
p2 = plot(lower, "Lower", color=#2962FF, offset = offset)
fill(p1, p2, title = "Background", color=color.rgb(33, 150, 243, 95))
Adaptive Trend SignalsTry to give accurate signals for buying and selling using FAV and price movement
MACD-Based Strategy inspired by Saud and ShakyaThis strategy uses the classic MACD crossover approach to generate buy and sell signals:
- Buy Signal: Triggered when the MACD Line crosses above the Signal Line, indicating bullish momentum.
- Sell Signal: Triggered when the MACD Line crosses below the Signal Line, signaling bearish momentum.
The strategy is based on research by Arjun Singh Saud and Subarna Shakya (2024), which highlights the MACD's effectiveness in predicting trading signals. Their work explores enhancing classical MACD signals using machine learning models to reduce false signals and improve decision-making accuracy. While this implementation focuses on the traditional crossover logic, it serves as a solid foundation for both beginners and experienced traders.
I will enhance the strategy in the future, adding a Stop-Loss management as well as the possibility to take Short positions as their is some potential in it.
This Strategy is the first of a series of strategies I want to publish based on research papers, so if you are interested in seeing more scientificaly researched strategies being brought into day light give me a follow.
RSI 5min Cross StrategyA short-term mean-reversion strategy that capitalizes on RSI oscillations in volatile markets.
Core Logic:
Entry Signal:
Triggers LONG position when 14-period RSI crosses above 35 on 5-minute charts
Indicates emerging momentum from oversold territory
Exit Signal:
Closes position when 14-period RSI crosses below 65
Captures profit before potential overbought reversal
Key Features:
Designed for high-liquidity markets (FX, crypto, large-cap stocks)
Optimized for ranging/sideways markets
Default 0.1% transaction cost included
Non-repainting signals for reliable backtesting
Rationale:
Uses wider RSI thresholds (35/65 vs standard 30/70) to avoid false signals
Exploits short-term price mean-reversion in 5-minute timeframes
Automated exit prevents emotional decision-making
Ideal For:
Day traders seeking frequent opportunities (6-12 trades/day)
Markets with clear oscillation patterns (e.g., indices, major currency pairs)
Risk Management:
⚠️ Requires strict stop-loss (not included in base script)
⚠️ Performs best when combined with:
Volume confirmation
Support/resistance alignment
Volatility filters (ATR/BB Width)
Strengths ➔ Quick turnaround trades, simple ruleset
Limitations ➔ Choppy markets cause whipsaws, needs trend confirmation
Crypto Strategy: Pattern Retest + EMA/RSI//@version=5
strategy("Crypto Strategy: Pattern Retest + EMA/RSI", overlay=true, margin_long=100, margin_short=100)
// ~~~~~~~~~~~~~~ INPUTS ~~~~~~~~~~~~~~
emaLength = input.int(50, "EMA Length")
rsiLength = input.int(14, "RSI Length")
overbought = input(70, "RSI Overbought Level")
oversold = input(30, "RSI Oversold Level")
patternLookback = input.int(20, "Pattern Lookback")
// ~~~~~~~~~~~~~~ INDICATORS ~~~~~~~~~~~~~~
ema = ta.ema(close, emaLength)
rsi = ta.rsi(close, rsiLength)
// ============== BULLISH PATTERN (Double Bottom Retest) ==============
var float necklineBullish = na
var bool breakoutBullish = false
// Detect Double Bottom
swingLow = ta.lowest(low, 5)
swingLowPrev = ta.lowest(low, 5)
swingHighBetween = ta.highest(high, 5)
isDoubleBottom = swingLow >= swingLowPrev * 0.99 and swingLow <= swingLowPrev * 1.01 and swingHighBetween > swingLow
// Update neckline on pattern detection
if isDoubleBottom
necklineBullish := swingHighBetween
breakoutBullish := false
// Breakout and Retest Logic
breakoutBullish := close > necklineBullish and not breakoutBullish
retestBullish = breakoutBullish and low <= necklineBullish and close > necklineBullish and rsi < oversold
// ============== BEARISH PATTERN (Double Top Retest) ==============
var float necklineBearish = na
var bool breakoutBearish = false
// Detect Double Top
swingHigh = ta.highest(high, 5)
swingHighPrev = ta.highest(high, 5)
swingLowBetween = ta.lowest(low, 5)
isDoubleTop = swingHigh <= swingHighPrev * 1.01 and swingHigh >= swingHighPrev * 0.99 and swingLowBetween < swingHigh
// Update neckline on pattern detection
if isDoubleTop
necklineBearish := swingLowBetween
breakoutBearish := false
// Breakdown and Retest Logic
breakoutBearish := close < necklineBearish and not breakoutBearish
retestBearish = breakoutBearish and high >= necklineBearish and close < necklineBearish and rsi > overbought
// ~~~~~~~~~~~~~~ BUY/SELL CONDITIONS ~~~~~~~~~~~~~~
// BUY Signal: Bullish retest OR EMA crossover + RSI oversold
buyCondition = retestBullish or (ta.crossover(close, ema) and rsi < oversold)
// SELL Signal: Bearish retest OR EMA crossunder + RSI overbought
sellCondition = retestBearish or (ta.crossunder(close, ema) and rsi > overbought)
// ~~~~~~~~~~~~~~ EXECUTE ORDERS ~~~~~~~~~~~~~~
if (buyCondition)
strategy.entry("BUY", strategy.long)
alert("BUY Signal: Price Retest + RSI/EMA Confirmation", alert.freq_once_per_bar)
if (sellCondition)
strategy.close("BUY")
alert("SELL Signal: Price Retest + RSI/EMA Confirmation", alert.freq_once_per_bar)
// ~~~~~~~~~~~~~~ PLOTTING ~~~~~~~~~~~~~~
plot(ema, "EMA", color=color.blue)
plot(necklineBullish, "Bullish Neckline", color=color.green, linewidth=2)
plot(necklineBearish, "Bearish Neckline", color=color.red, linewidth=2)
// Plot BUY/SELL labels on chart
plotshape(buyCondition, title="BUY", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(sellCondition, title="SELL", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
Nitin Strategy: Patterns + EMA/RSI Retest//@version=5
strategy("Crypto Strategy: Patterns + EMA/RSI Retest", overlay=true, initial_capital=1000, default_qty_type=strategy.percent_of_equity, default_qty_value=90)
// Inputs
emaLength = input.int(50, "EMA Length")
rsiLength = input.int(14, "RSI Length")
overbought = input(70, "RSI Overbought")
oversold = input(30, "RSI Oversold")
patternLookback = input.int(20, "Pattern Lookback")
// Indicators
ema = ta.ema(close, emaLength)
rsi = ta.rsi(close, rsiLength)
// 1. BULLISH PATTERN (Double Bottom + Retest)
// -------------------------------------------
var float necklineBullish = na
var bool breakoutBullish = false
// Detect Double Bottom (two lows with a peak in between)
swingLow = ta.lowest(low, 5)
swingLowPrev = ta.lowest(low, 5)
swingHighBetween = ta.highest(high, 5)
isDoubleBottom = swingLow >= swingLowPrev * 0.99 and swingLow <= swingLowPrev * 1.01 and swingHighBetween > swingLow and swingHighBetween > swingLowPrev
// Update neckline on pattern detection
if isDoubleBottom
necklineBullish := swingHighBetween
breakoutBullish := false
// Check breakout above neckline
if not breakoutBullish and close > necklineBullish
breakoutBullish := true
// Retest after breakout (price returns to neckline and bounces)
retestBullish = breakoutBullish and low <= necklineBullish and close > necklineBullish and rsi < oversold
// 2. BEARISH PATTERN (Double Top + Retest)
// -------------------------------------------
var float necklineBearish = na
var bool breakoutBearish = false
// Detect Double Top (two highs with a trough in between)
swingHigh = ta.highest(high, 5)
swingHighPrev = ta.highest(high, 5)
swingLowBetween = ta.lowest(low, 5)
isDoubleTop = swingHigh <= swingHighPrev * 1.01 and swingHigh >= swingHighPrev * 0.99 and swingLowBetween < swingHigh and swingLowBetween < swingHighPrev
// Update neckline on pattern detection
if isDoubleTop
necklineBearish := swingLowBetween
breakoutBearish := false
// Check breakout below neckline
if not breakoutBearish and close < necklineBearish
breakoutBearish := true
// Retest after breakout (price returns to neckline and rejects)
retestBearish = breakoutBearish and high >= necklineBearish and close < necklineBearish and rsi > overbought
// 3. EMA + RSI Conditions
// -----------------------
emaBuy = ta.crossover(close, ema) and rsi < oversold
emaSell = ta.crossunder(close, ema) and rsi > overbought
// Final Buy/Sell Signals (Combine Retest & EMA/RSI)
buySignal = retestBullish or emaBuy
sellSignal = retestBearish or emaSell
// Execute Orders
strategy.entry("Buy", strategy.long, when=buySignal)
strategy.close("Buy", when=sellSignal)
// Plotting
plot(ema, "EMA", color=color.blue)
plot(necklineBullish, "Bullish Neckline", color=color.green, linewidth=2)
plot(necklineBearish, "Bearish Neckline", color=color.red, linewidth=2)
plotshape(buySignal, title="Buy", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(sellSignal, title="Sell", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
RSI Strategyris stratgy if buy or sell signal rsi is above 60 if rsi is above 6o momentum is high soo
Adaptive Fractal Grid Scalping StrategyThis Pine Script v6 component implements an "Adaptive Fractal Grid Scalping Strategy" with an added volatility threshold feature.
Here's how it works:
Fractal Break Detection: Uses ta.pivothigh and ta.pivotlow to identify local highs and lows.
Volatility Clustering: Measures volatility using the Average True Range (ATR).
Adaptive Grid Levels: Dynamically adjusts grid levels based on ATR and user-defined multipliers.
Directional Bias Filter: Uses a Simple Moving Average (SMA) to determine trend direction.
Volatility Threshold: Introduces a new input to specify a minimum ATR value required to activate the strategy.
Trade Execution Logic: Places limit orders at grid levels based on trend direction and fractal levels, but only when ATR exceeds the volatility threshold.
Profit-Taking and Stop-Loss: Implements profit-taking at grid levels and a trailing stop-loss based on ATR.
How to Use
Inputs: Customize the ATR length, SMA length, grid multipliers, trailing stop multiplier, and volatility threshold through the input settings.
Visuals: The script plots fractal points and grid levels on the chart for easy visualization.
Trade Signals: The strategy automatically places buy/sell orders based on the detected fractals, trend direction, and volatility threshold.
Profit and Risk Management: The script includes logic for taking profits and setting stop-loss levels to manage trades effectively.
This strategy is designed to capitalize on micro-movements during high volatility and avoid overtrading during low-volatility trends. Adjust the input parameters to suit your trading style and market conditions.
Smoothed Heikin-Ashi Trend Strategy with SignalsbbSmoothed Heikin-Ashi Trend Strategy with Signalsbb