[SHORT ONLY] Consecutive Bars Above MA Strategy█ STRATEGY DESCRIPTION
The "Consecutive Bars Above MA Strategy" is a contrarian trading system aimed at exploiting overextended bullish moves in stocks and ETFs. It monitors the number of consecutive bars that close above a chosen short-term moving average (which can be either a Simple Moving Average or an Exponential Moving Average). Once the count reaches a preset threshold and the current bar’s close exceeds the previous bar’s high within a designated trading window, a short entry is initiated. An optional EMA filter further refines entries by requiring that the current close is below the 200-period EMA, helping to ensure that trades are taken in a bearish environment.
█ HOW ARE THE CONSECUTIVE BULLISH COUNTS CALCULATED?
The strategy utilizes a counter variable, `bullCount`, to track consecutive bullish bars based on their relation to the short-term moving average. Here’s how the count is determined:
Initialize the Counter
The counter is initialized at the start:
var int bullCount = na
Bullish Bar Detection
For each bar, if the close is above the selected moving average (either SMA or EMA, based on user input), the counter is incremented:
bullCount := close > signalMa ? (na(bullCount) ? 1 : bullCount + 1) : 0
Reset on Non-Bullish Condition
If the close does not exceed the moving average, the counter resets to zero, indicating a break in the consecutive bullish streak.
█ SIGNAL GENERATION
1. SHORT ENTRY
A short signal is generated when:
The number of consecutive bullish bars (i.e., bars closing above the short-term MA) meets or exceeds the defined threshold (default: 3).
The current bar’s close is higher than the previous bar’s high.
The signal occurs within the specified trading window (between Start Time and End Time).
Additionally, if the EMA filter is enabled, the entry is only executed when the current close is below the 200-period EMA.
2. EXIT CONDITION
An exit signal is triggered when the current close falls below the previous bar’s low, prompting the strategy to close the short position.
█ ADDITIONAL SETTINGS
Threshold: The number of consecutive bullish bars required to trigger a short entry (default is 3).
Trading Window: The Start Time and End Time inputs define when the strategy is active.
Moving Average Settings: Choose between SMA and EMA, and set the MA length (default is 5), which is used to assess each bar’s bullish condition.
EMA Filter (Optional): When enabled, this filter requires that the current close is below the 200-period EMA, supporting entries in a downtrend.
█ PERFORMANCE OVERVIEW
This strategy is designed for stocks and ETFs and can be applied across various timeframes.
It seeks to capture mean reversion by shorting after a series of bullish bars suggests an overextended move.
The approach employs a contrarian short entry by waiting for a breakout (close > previous high) following consecutive bullish bars.
The adjustable moving average settings and optional EMA filter allow for further optimization based on market conditions.
Comprehensive backtesting is recommended to fine-tune the threshold, moving average parameters, and filter settings for optimal performance.
Indicatori e strategie
Chi Bao KulaChỉ báo kết hợp nến Heikin Ashi và Ichimoku Cloud để xác định xu hướng thị trường. Hỗ trợ phân tích và tìm điểm vào lệnh hiệu quả
Previous/Current Day High-Low Breakout Strategy//@version=5
strategy("Previous/Current Day High-Low Breakout Strategy", overlay=true)
// === INPUTS ===
buffer = input(10, title="Buffer Points Above/Below Day High/Low") // 0-10 point buffer
atrMultiplier = input.float(1.5, title="ATR Multiplier for SL/TP") // ATR-based SL & TP
// === DETECT A NEW DAY CORRECTLY ===
dayChange = ta.change(time("D")) != 0 // Returns true when a new day starts
// === FETCH PREVIOUS DAY HIGH & LOW CORRECTLY ===
var float prevDayHigh = na
var float prevDayLow = na
if dayChange
prevDayHigh := high // Store previous day's high
prevDayLow := low // Store previous day's low
// === TRACK CURRENT DAY HIGH & LOW ===
todayHigh = ta.highest(high, ta.barssince(dayChange)) // Highest price so far today
todayLow = ta.lowest(low, ta.barssince(dayChange)) // Lowest price so far today
// === FINAL HIGH/LOW SELECTION (Whichever Happens First) ===
finalHigh = math.max(prevDayHigh, todayHigh) // Use the highest value
finalLow = math.min(prevDayLow, todayLow) // Use the lowest value
// === ENTRY CONDITIONS ===
// 🔹 BUY (LONG) Condition: Closes below final low - buffer
longCondition = close <= (finalLow - buffer)
// 🔻 SELL (SHORT) Condition: Closes above final high + buffer
shortCondition = close >= (finalHigh + buffer)
// === ATR STOP-LOSS & TAKE-PROFIT ===
atr = ta.atr(14)
longSL = close - (atr * atrMultiplier) // Stop-Loss for Long
longTP = close + (atr * atrMultiplier * 2) // Take-Profit for Long
shortSL = close + (atr * atrMultiplier) // Stop-Loss for Short
shortTP = close - (atr * atrMultiplier * 2) // Take-Profit for Short
// === EXECUTE LONG (BUY) TRADE ===
if longCondition
strategy.entry("BUY", strategy.long, comment="🔹 BUY Signal")
strategy.exit("SELL TP", from_entry="BUY", stop=longSL, limit=longTP)
// === EXECUTE SHORT (SELL) TRADE ===
if shortCondition
strategy.entry("SELL", strategy.short, comment="🔻 SELL Signal")
strategy.exit("BUY TP", from_entry="SELL", stop=shortSL, limit=shortTP)
// === PLOT LINES FOR VISUALIZATION ===
plot(finalHigh, title="Breakout High (Prev/Today)", color=color.new(color.blue, 60), linewidth=2, style=plot.style_stepline)
plot(finalLow, title="Breakout Low (Prev/Today)", color=color.new(color.red, 60), linewidth=2, style=plot.style_stepline)
// === ALERT CONDITIONS ===
alertcondition(longCondition, title="🔔 Buy Signal", message="BUY triggered 🚀")
alertcondition(shortCondition, title="🔔 Sell Signal", message="SELL triggered 📉")
Chi Bao KulaChỉ báo kết hợp nến Heikin Ashi và Ichimoku Cloud để xác định xu hướng thị trường. Hỗ trợ phân tích và tìm điểm vào lệnh hiệu quả
Customizable MACD Without SmootingThis MACD indicator shows you the distance between the fast and slow EMA's, which you can adjust to your preference. I removed the smoothing so that it is just a true representation of the distance between the two EMA's. The Zero line is where the two EMA's cross.
The idea with this indicator is to either look for expansion from the Zero Line, or extremes leading to reversals.
Longs Above 200 SMA & Shorts Belowuse this if the vwap is either above or below 200 sma till we get there, also have the vwap signal indicator as well put these both and turn on and off depending on where we are anytime of the day, one should be turned off for not getting too many signals , good luck just changed the chart
Pin Bar - BTC/USDT//@version=6
strategy("Estratégia Aprimorada - Pullback c/ RSI, MACD, ATR, Volume e Pin Bar - BTC/USDT", overlay=true, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=2)
// === 1. Confirmação de Tendência em Multi-Timeframe ===
// Usamos o timeframe diário para confirmar que o preço está acima da MA200
dailyClose = request.security(syminfo.tickerid, "D", close)
dailyMA200 = request.security(syminfo.tickerid, "D", ta.sma(close, 200))
trendUpHigherTF = dailyClose > dailyMA200
// === 2. Indicadores no Timeframe Atual ===
ma5 = ta.sma(close, 5)
rsiValue = ta.rsi(close, 14)
= ta.macd(close, 12, 26, 9)
atrValue = ta.atr(14)
avgVolume = ta.sma(volume, 20)
volumeFilter = volume > avgVolume
// === 3. Detecção de Pullback ===
// Conta candles consecutivos com fechamento menor que o anterior
var int consecDown = 0
if close < close
consecDown += 1
else
consecDown := 0
pullback = (consecDown >= 3)
// === 4. Padrão de Reversão (Bullish Pin Bar) ===
body = math.abs(close - open)
lowerWick = math.min(open, close) - low
bullishPinBar = (lowerWick > 2 * body) and (close > open)
// === 5. Condições Técnicas Adicionais ===
rsiCond = rsiValue < 30
macdCrossover = ta.crossover(macdLine, signalLine)
// Para maior confirmação, exige que o fechamento esteja acima de uma MA curta
shortMACond = close > ma5
// === 6. Condição de Entrada ===
entryCond = trendUpHigherTF and pullback and volumeFilter and rsiCond and macdCrossover and bullishPinBar and shortMACond
// === 7. Plotagens para Visualização ===
plot(ma5, color=color.orange, title="MA5")
dailyMAPlot = request.security(syminfo.tickerid, "D", ta.sma(close,200))
plot(dailyMAPlot, color=color.blue, title="Daily MA200")
hline(30, color=color.red, title="RSI 30")
plotshape(entryCond, title="Sinal de Compra", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY", size=size.small)
// === 8. Execução da Estratégia com Gestão de Risco ===
if entryCond
// Define o nível inicial do stop loss usando ATR (1.5x ATR abaixo do preço de entrada)
stopLevel = close - atrValue * 1.5
strategy.entry("Long", strategy.long)
// Saída com trailing stop: o stop se ajusta conforme o preço sobe, com distância de 1.5x ATR
strategy.exit("Exit Long", "Long", stop=stopLevel, trail_points=atrValue * 1.5)
Cumulative DeltaCumulative delta mostafa trader sefrou
Two calculation methods:
CloseChange: Compares current close with previous close
BarUpDown: Compares close with open of the same bar
Mr Huk Strategy-Coral Trend with Bollinger Bands
This strategy, named "Mr Huk Strategy-Coral Trend with Bollinger Bands," combines the Coral Trend indicator and Bollinger Bands as a technical analysis tool. Written in Pine Script (v5), it is overlaid on the chart. Below is a summary of the strategy:
Key Components
MA 13 (Orange Line):
13-period Simple Moving Average (SMA).
Used as a reference for exit signals.
Plotted in red with a thickness of 3.
Coral Trend Indicator:
Smooths price movements to determine trend direction.
Generates buy-sell signals:
Buy: Coral Trend rises (green circles).
Sell: Coral Trend falls (red circles).
Plotted as circles with a thickness of 3.
Smoothing period (default: 8) and constant coefficient (default: 0.4) are customizable.
Bollinger Bands:
Uses a 20-period SMA (basis) and 2 standard deviations (deviation).
Upper and lower bands are plotted in purple, basis in blue.
The area between bands is filled with semi-transparent purple.
Used to measure volatility and analyze price movements.
Buy-Sell and Exit Rules
Buy Signal: Coral Trend gives a buy signal (green circles).
Sell Signal: Coral Trend gives a sell signal (red circles).
Exit Signals:
First exit: Coral Trend points fall below the line.
Second exit: Price falls below MA 13 (orange line).
Additional Recommendations
Heikin Ashi candles can be used.
When using Heikin Ashi, the "Ha Color Change And Alert" indicator is recommended.
The strategy is described as simple but profitable.
Purpose and Usage
Suitable for trend-following and volatility-based trades.
Parameters (smoothing period, Bollinger period, standard deviation) can be customized by the user.
Clearly displays buy-sell signals and exit points graphically.
This strategy aims to support trading decisions by analyzing trend direction and volatility.
14-Bar High/Low Close ChannelA twist on the Donchian Channels, instead of measuring the highs and lows, we're measuring the closes over a 14-day period
Pro 100x Futures StrategySingle-Line Calls: Having each strategy.exit call on a single line reduces the chance of Pine Script misinterpreting line breaks.
Removed Trailing Parameters: By removing trail_points and trail_offset, the function call is simpler. You can reintroduce them once it compiles without error.
Consistent Indentation: Pine Script can be picky about indentation, especially after if statements.
EMA365 Cross// Einfacher EMA-Cross Indikator mit Indikation der Crosses auf EMA-Linie und am Chart-Bottom
ema_01_len = input.int(10, title='Ema 1', minval=1)
ema_02_len = input.int(20, title='Ema 2', minval=1)
ema_03_len = input.int(50, title='Ema 3', minval=1)
ADX with Moving AverageADX with Moving Average is a powerful indicator that enhances trend analysis by combining the standard Average Directional Index (ADX) with a configurable moving average.
The ADX helps traders identify the strength of a trend. In general:
ADX 0-20 – Absent or Weak Trend
ADX 25-50 – Strong Trend
ADX 50-75 – Very Strong Trend
ADX 75-100 – Extremely Strong Trend
By adding a moving average we can judge if the ADX itself is trending upwards or downwards, i.e. if a new trend is emerging or an existing one is weakening.
This combination allows traders to better confirm strong trends and filter out weak or choppy market conditions.
Key Features & Customization:
✔ Configurable DI & ADX Lengths – Adjust how quickly the ADX reacts to price movements (default: 14, 14).
✔ Multiple Moving Average Options – Choose between SMA, EMA, WMA, VWMA, or T3 for trend confirmation.
✔ Custom MA Length – Fine-tune the sensitivity of the moving average to match your strategy.
🔹 Use this indicator to confirm strong trends before entering trades, filter out false signals, or refine existing strategies with a dynamic trend-strength component. 🚀
BTC Trend analysis 4H EMA 21 on 1H ChartBTC Trend Analysis Using EMA-21 on a 4H Timeframe & Plot on 1H Chart
This indicator:
✅ Calculates the EMA-21 from a 4-hour chart
✅ Plots the 4H EMA-21 on a 1-hour chart
✅ Colors price bars based on trend direction (Above EMA = Green, Below EMA = Red)
1️⃣ Calculates the 21-period EMA from the 4-hour timeframe.
2️⃣ Plots it on a 1-hour chart.
3️⃣ Colors candles based on trend direction:
Green if price is above 4H EMA-21 (Bullish)
Red if price is below 4H EMA-21 (Bearish)
DTFT 1### **Ichimoku Cloud Combined with SMA Indicator**
The **Ichimoku Cloud** (Ichimoku Kinko Hyo) is a comprehensive technical analysis tool that provides insights into trend direction, momentum, and potential support and resistance levels. It consists of five main components:
- **Tenkan-sen (Conversion Line):** A short-term trend indicator (9-period average).
- **Kijun-sen (Base Line):** A medium-term trend indicator (26-period average).
- **Senkou Span A & B (Leading Spans):** These form the "cloud" (Kumo), indicating support and resistance zones.
- **Chikou Span (Lagging Line):** A trend confirmation tool based on past price action.
When combined with the **Simple Moving Average (SMA)**, traders can enhance their strategy by integrating a widely used trend-following indicator with Ichimoku’s comprehensive view. The SMA smooths price action and helps confirm trends indicated by the Ichimoku Cloud.
### **Trading Strategy: Ichimoku + SMA**
1. **Trend Confirmation:** If the price is above the cloud and the SMA, it confirms an uptrend; if below both, a downtrend.
2. **Entry Signals:** A bullish signal occurs when price breaks above the SMA and the Ichimoku cloud turns bullish. A bearish signal happens when price drops below the SMA and the cloud turns bearish.
3. **Support & Resistance:** The SMA and Ichimoku cloud act as dynamic support/resistance levels. A bounce from these levels can provide trade opportunities.
4. **Crossovers:** If the SMA crosses the Kijun-sen (Base Line), it may indicate a shift in momentum.
By combining Ichimoku Cloud and SMA, traders can gain a more robust understanding of market trends, improving decision-making for both short-term and long-term trades.
US Session for Bitcointo easily differentiate between different time zones, and effective in backtesting in your preffered time zone.
Candle Coloring by Volumecolor candles if volume is times 3 of previous volume
orange bullish
purple bearish
Arbitrage SpreadThis indicator was originally published by I_Leo_I
The moving average was modified from EMA to SMA. EMA responds more quickly to recent price changes. It captures short price movements. If you are a day trader or using quick scalping strategies, the EMA tends to be more effective as it provides faster signals.
This indicator helps to find spreads between cryptocurrencies, assess their correlation, spread, z score and atr z score.
The graphs are plotted as a percentage. Because of the limitation in pine tradingview for 5000 bars a period was introduced (after which a new starting point of the graph construction will be started), if you want it can be disabled
The multiplier parameter affects only the construction of the joint diagram on which z score and atr z score are calculated (construction of the diagram is done by dividing one pair by another and multiplying by the multiplier parameter) is shown with a red line
To create a notification you have to specify the data for parameters other than zero which you want to monitor. For parameters z score and atr z score data are counted in both directions
The data can be tracked via the data window
Link to image of the data window prnt.sc/93fKELKSQOhB
Arbitrage SpreadThis indicator was originally published by I_Leo_I
The moving average was modified from EMA to SMA. EMA responds more quickly to recent price changes. It captures short price movements. If you are a day trader or using quick scalping strategies, the EMA tends to be more effective as it provides faster signals.
This indicator helps to find spreads between cryptocurrencies, assess their correlation, spread, z score and atr z score.
The graphs are plotted as a percentage. Because of the limitation in pine tradingview for 5000 bars a period was introduced (after which a new starting point of the graph construction will be started), if you want it can be disabled
The multiplier parameter affects only the construction of the joint diagram on which z score and atr z score are calculated (construction of the diagram is done by dividing one pair by another and multiplying by the multiplier parameter) is shown with a red line
To create a notification you have to specify the data for parameters other than zero which you want to monitor. For parameters z score and atr z score data are counted in both directions
The data can be tracked via the data window
Link to image of the data window prnt.sc/93fKELKSQOhB
Arbitrage SpreadThis indicator was originally published by I_Leo_I
The moving average was modified from EMA to SMA. EMA responds more quickly to recent price changes. It captures short price movements. If you are a day trader or using quick scalping strategies, the EMA tends to be more effective as it provides faster signals.
This indicator helps to find spreads between cryptocurrencies, assess their correlation, spread, z score and atr z score.
The graphs are plotted as a percentage. Because of the limitation in pine tradingview for 5000 bars a period was introduced (after which a new starting point of the graph construction will be started), if you want it can be disabled
The multiplier parameter affects only the construction of the joint diagram on which z score and atr z score are calculated (construction of the diagram is done by dividing one pair by another and multiplying by the multiplier parameter) is shown with a red line
To create a notification you have to specify the data for parameters other than zero which you want to monitor. For parameters z score and atr z score data are counted in both directions
The data can be tracked via the data window
Link to image of the data window prnt.sc/93fKELKSQOhB
4 ema by victo help you read the trend.
this is 4 exponential moving average.
ema 20, ema 50, ema 100, and ema 200.
hope you enjoy it.
~vic
Overnight High and Low for Indices, Metals, and EnergySimple script for ploting overnight high and low on metal, indices and Energy (mostly traded) instrument