Simplified Buy/Sell StrategyThis Pine Script implements a Simplified Buy/Sell Strategy based on the Moving Average Crossover technique. Here's a breakdown of the functionality:
Description:
Purpose:
The script generates Buy and Sell signals on the chart to help traders identify potential entry and exit points based on short-term and long-term price trends.
Indicators Used:
Short Moving Average (Short MA): Calculates the average closing price over a shorter period (default: 5).
Long Moving Average (Long MA): Calculates the average closing price over a longer period (default: 10).
Buy Signal:
A buy signal is generated when the Short MA crosses above the Long MA. This suggests a potential upward trend in price.
Sell Signal:
A sell signal is generated when the Short MA crosses below the Long MA. This indicates a possible downward trend.
Visualization:
Buy signals are shown as green arrows below the price bars with the label "BUY."
Sell signals are displayed as red arrows above the price bars with the label "SELL."
The Short and Long MAs are plotted on the chart for visual confirmation of trends (blue for Short MA, orange for Long MA).
Customization:
Traders can adjust the lengths of the moving averages to fit different timeframes or assets using the input fields.
Графические паттерны
Thin Liquidity Zones [PhenLabs]Thin Liquidity Zones with Volume Delta
Our advanced volume analysis tool identifies and visualizes significant liquidity zones using real-time volume delta analysis. This indicator helps traders pinpoint and monitor critical price levels where substantial trading activity occurs, providing precise volume flow measurement through lower timeframe analysis.
The tool works by leveraging the fact that hedge funds, institutions, and other large market participants strategically fill their orders in areas of thin liquidity to minimize slippage and market impact. By detecting these zones, traders gain valuable insights into potential areas of accumulation, distribution, and liquidity traps, allowing for more informed trading decisions.
🔍 Key Features
Real-time volume delta calculation using lower timeframe data
Dynamic zone creation based on volume spikes
Automatic timeframe optimization
Size-filtered zones to avoid noise
Custom delta timeframe scanning
Flexible analysis period selection
📊 Visual Demonstration
💡 How It Works
The indicator continuously scans for high-volume areas where trading activity exceeds the specified threshold (default 6.0x average volume). When detected, it creates zones that display the net volume delta, showing whether buying or selling pressure dominated that price level.
Key zone characteristics:
Size filtering prevents noise from large price swings
Volume delta shows actual buying/selling pressure
Zones automatically expire based on lookback period
Real-time updates as new volume data arrives
⚙️ Settings
Time Settings
Analysis Timeframe: 15M to 1W options
Custom Period: User-defined bar count
Delta Timeframe: Automatic or manual selection
Volume Analysis
Volume Threshold: Minimum spike multiple
Volume MA Length: Averaging period
Maximum Zone Size: Size filter percentage
Display Options
Zone Color: Customizable with transparency
Delta Display: On/Off toggle
Text Position: Left/Center/Right alignment
📌 Tips for Best Results
Adjust volume threshold based on instrument volatility
Monitor zone clusters for potential support/resistance
Consider reducing max zone size in volatile markets
Use in conjunction with price action and other indicators
⚠️ Important Notes
Requires volume data from your data provider
Lower timeframe scanning may impact performance
Maximum 500 zones maintained for optimization
Zone creation is filtered by both volume and size
🔧 Volume Delta Calculation
The indicator uses TradingView’s advanced volume delta calculation, which:
Scans lower timeframe data for precision
Measures actual buying vs selling pressure
Updates in real-time with new data
Provides clear positive/negative flow indication
This tool is ideal for traders focusing on volume analysis and order flow. It helps identify key levels where significant trading activity has occurred and provides insight into the nature of that activity through volume delta analysis.
Note: Performance may vary based on your chart’s timeframe. Adjust settings according to your trading style and the instrument’s characteristics. Past performance is not indicative of future results, DYOR.
NY Session (MST)Highlights the New York session in MST. Highlights from 730am to 200pm to get a quick visual of previous sessions or overnight data.
Candlestick and Line Chart Patterns AnalyseDas Skript generiert Kaufen und Verkaufen Signale anhand der Analyse auf die gängistetn Kerzenmuster und der gängisten Chartlinienmuster
EMA 68 with Trailing Stop-Loss 9430018561EMA 68 with Trailing Stop-Loss 9430018561
EMA Crossover ke upar buy and sell
Isme stop loss bhi hain aur traling stop loss bhi
Hourly Market Movement Pattern Indicator# Hourly Market Movement Pattern Indicator
This versatile technical analysis tool identifies the most active hours for trading by analyzing historical price movements. While it can be viewed on any timeframe chart, the indicator specifically tracks and displays which hours of the day historically show the strongest upward or downward price movements, helping traders optimize their trading schedule around these recurring hourly patterns.
## Core Features
- Tracks the best performing hours for both upward and downward movements
- Viewable on any timeframe chart while maintaining hourly analysis
- Clear visual display through a color-coded table overlay
- Real-time updates with new market data
- Works with all trading instruments (stocks, crypto, forex, futures, etc.)
## Timeframe Applications
### Chart Viewing Options
- Can be viewed on any timeframe chart (1min to Monthly)
- Maintains hourly pattern analysis regardless of chart timeframe
- Helps correlate hourly patterns with your preferred trading timeframe
- Allows detailed visualization of hourly patterns within your analysis period
### Intraday Trading
- Identify the most profitable hours for trading
- Plan trading sessions around historically strong hours
- Optimize entry and exit timing based on hourly patterns
- Structure day trading schedules around peak movement hours
### Swing Trading
- Use hourly statistics to optimize entry/exit timing
- Plan trade executions during historically strong hours
- Time position entries based on hourly success rates
- Enhance swing trading decisions with hourly pattern data
## Practical Applications
### Pattern Recognition
- Track recurring hourly market movements
- Identify institutional trading hour patterns
- Detect regular market cycle hours
- Recognize changes in hourly market behavior
### Risk Management
- Adjust position sizing based on historical hourly patterns
- Plan entries during statistically favorable hours
- Time stop loss adjustments around known volatile hours
- Scale positions according to hourly success rates
### Trade Planning
- Schedule trading sessions during optimal hours
- Plan trade executions around strong movement periods
- Structure trading day around peak hours
- Time position adjustments to favorable hours
## Setup Options
- Timeframe: View on any chart timeframe while tracking hourly patterns
- Visual Display: Non-intrusive table overlay
- Color Coding: Green for upward movements, Red for downward movements
- Hour Display: 24-hour format for global market compatibility
## Trading Strategy Integration
The indicator enhances trading approaches through:
- Optimal hour identification for trade execution
- Historical hourly pattern analysis
- Day trading session optimization
- Position timing based on hourly statistics
## Notes
This indicator proves particularly valuable for:
- Traders seeking to optimize their daily trading schedule
- Day traders focusing on peak market hours
- Swing traders optimizing entry/exit timing
- Traders adapting strategies to specific market hours
- International traders tracking hour-specific patterns across sessions
The tool's hourly pattern analysis provides crucial timing information regardless of your preferred chart timeframe or trading style, helping optimize trade execution around the most statistically favorable hours of the day.
BFX Buy and SellThe BFX Buy and Sell Strategy is a cutting-edge trading tool designed to help you navigate the markets with confidence.
This strategy simplifies decision-making by delivering precise buy and sell signals, ensuring you’re always one step ahead of market trends. Perfect for traders of all experience levels, it offers clean visuals and reliable alerts to maximize your trading potential.
Whether you’re looking to fine-tune your strategy or seeking a fresh approach to trading, the BFX Buy and Sell is your ultimate partner for smarter, more efficient trading.
Developed by
Jc Golden
BeardedFX
www.beardedfx.net
FVG DetectorA fairly flexible indicator for displaying imbalance zones. There are quite a few similar indicators, but none of them suit me, so I made my own.
Settings:
Minimum FVG size in % - Minimum imbalance size in percentage
Percentage of filling FVG - When the imbalance is filled by the specified percentage, the imbalance will be considered inactive
Show FVG - The number of FVG to be shown on the chart. If 0, all FVG are shown
FVG Long color - Color of FVG Long FVG
FVG Short color - Color of FVG Short FVG
FVG middle line - Setting the line that shows the middle of the imbalance
Filling 50% FVG - When filling the imbalance halfway, the line showing the middle of the imbalance changes type and color
When Candle Close - The rectangle showing the imbalance zone is removed only after the candle closes
History - Display all imbalance zones on history
Conclusion:
This indicator will be useful for those users who need to display imbalance zones, the middle of the imbalance, and also visually show that the price has covered half of the imbalance zone.
QuantFarming Signals v6//@version=6
indicator("QuantFarming Signals", overlay = true, max_boxes_count = 500)
// INPUT
Resolution = input.timeframe("240", title = "Resolution")
BarWidth = input.int(4, title = "Bar Width", minval = 1)
RSIRegPeriod = input.int(1000, title = "RSI Regression Period")
RSIRegFactor = input.float(1.7, title = "RSI Regression Factor")
StopLossBufferPoints = input.float(5.0, title = "Stop Loss Buffer Points")
WebhookID = input.string("", title = "Webhook ID", group = "Setup")
WebhookToken = input.string("", title = "Webhook Token", group = "Setup")
Delay = input.timeframe("240", title = "Signal Delay", group = "Setup")
BuyMovingAveragePeriod = input.int(25, title = "Buy MA Period", inline = "Buy", group = "Moving Average Period & Angle")
SellMovingAveragePeriod = input.int(25, title = "Sell MA Period", inline = "Sell", group = "Moving Average Period & Angle")
BuyAngle = input.float(+0.01, title = "Buy MA Angle", inline = "Buy", group = "Moving Average Period & Angle")
SellAngle = input.float(-0.01, title = "Sell MA Angle", inline = "Sell", group = "Moving Average Period & Angle")
RSIMax = input.float(55, title = "RSI Max", group = "Relative Strength Index Regression")
RSIMin = input.float(50, title = "RSI Min", group = "Relative Strength Index Regression")
// KR INPUT
Timeframe = input.timeframe("5", title = "Timeframe", group = "Kernel Regression for Confirmation")
Size = input.int(100, title = "Size", minval = 1, group = "Kernel Regression for Confirmation")
Bandwidth = input.float(5.0, title = "Bandwidth Parameter", minval = 1, step = 0.125, group = "Kernel Regression for Confirmation")
R = input.float(1.0, title = "R Value", minval = 0.125, step = 0.125, group = "Kernel Regression for Confirmation")
// FIBONACCI RETRACEMENT INPUT
RetracementLookback = input.int(100, title = "Retracement Lookback", group = "Fibonacci Retracement")
// POINTS IN THE BOX
BoxPoints = input.bool(true, title = "Display Points", group = "Points In The Box")
BoxWidth = input.int(10, title = "Box Width", group = "Points In The Box")
BoxHeight = input.int(10, title = "Box Height", group = "Points In The Box")
// DIRECTION ===============================================
// OFFSET
Offset = timeframe.in_seconds(Resolution) >= timeframe.in_seconds(timeframe.period) ? timeframe.in_seconds(Resolution) / timeframe.in_seconds(timeframe.period) : 0
// TRENDLINE
BuyMovingAverage = request.security(syminfo.tickerid, Resolution, ta.sma(close, BuyMovingAveragePeriod))
SellMovingAverage = request.security(syminfo.tickerid, Resolution, ta.sma(close, SellMovingAveragePeriod))
// ANGLE OF ELEVATION AND DEPRESSION
BuyMovingAverageAngle = request.security(syminfo.tickerid, Resolution, (BuyMovingAverage / BuyMovingAverage - 1) * 100)
SellMovingAverageAngle = request.security(syminfo.tickerid, Resolution, (SellMovingAverage / SellMovingAverage - 1) * 100)
// DIRECTION
var Direction = int(0)
BuyDirection = BuyMovingAverage > BuyMovingAverage and BuyMovingAverageAngle > BuyAngle ? 1 : 0
SellDirection = SellMovingAverage < SellMovingAverage and SellMovingAverageAngle < -SellAngle ? -1 : 0
Direction := BuyDirection > BuyDirection ? 1 : (SellDirection < SellDirection ? -1 : Direction)
// DRAW ANGLE OF ELEVATION AND DEPRESSION
if Direction > Direction
line.new(bar_index, BuyMovingAverage, bar_index , BuyMovingAverage , xloc.bar_index, extend.none, color.white, line.style_solid, 2)
if Direction < Direction
line.new(bar_index, SellMovingAverage, bar_index , SellMovingAverage , xloc.bar_index, extend.none, color.yellow, line.style_solid, 2)
// DRAW TRENDLINE
plot(BuyMovingAverage, title = "Buy Moving Average", color = Direction > 0 ? color.aqua : color.fuchsia, offset = -Offset + 1)
plot(SellMovingAverage, title = "Sell Moving Average", color = Direction > 0 ? color.aqua : color.fuchsia, offset = -Offset + 1)
// DRAW DIRECTION
bgcolor(color = color.new(Direction > 0 ? color.teal : color.maroon, 90), title = "Direction", offset = -Offset + 1)
// REGRESSION ============================================
// RELATIVE STRENGTH INDEX
RSI = ta.rsi(close, 14)
// RELATIVE STRENGTH INDEX REGRESSION
RSIRegression = ta.linreg(RSI, RSIRegPeriod, 0)
// RELATIVE STRENGTH INDEX DEVIATION
RSIDeviation = ta.stdev(RSI, RSIRegPeriod) * RSIRegFactor
// RSI SIGNAL
RSISell = ta.crossunder(RSI, RSIRegression + RSIDeviation) and RSI > RSIMax
RSIBuy = ta.crossover(RSI, RSIRegression - RSIDeviation) and RSI < RSIMin
// KERNEL REGRESSION ==============================================================================
// KERNEL REGRESSION
KernelRegression() =>
CurrentWeight = 0.0
CumulativeWeight = 0.0
for Count = 0 to Size
Y = close
U = math.pow(Count, 2) / (math.pow(Bandwidth, 2) * R)
W = (U >= 1) ? 0 : (3. / 4) * (1 - math.pow(U, 2))
CurrentWeight := CurrentWeight + Y * W
CumulativeWeight := CumulativeWeight + W
CurrentWeight / CumulativeWeight
// REVERSAL CONFIRMATION
Regression = request.security(syminfo.tickerid, Timeframe, KernelRegression())
// SIGNAL
Sell = RSISell and Direction < 0 and Regression > Regression
Buy = RSIBuy and Direction > 0 and Regression < Regression
// DELAY
var Track = int(0)
Active = (time - Track) >= timeframe.in_seconds(Delay) * 1000
Track := Active and (Buy or Sell) ? time : Track
plotshape(Sell and Active, title = "Sell", style = shape.triangledown, color = color.fuchsia, location = location.abovebar, size = size.tiny)
plotshape(Buy and Active, title = "Buy", style = shape.triangleup, color = color.aqua, location = location.belowbar, size = size.tiny)
// LEVEL ==========================================================================
// LEVEL
Peak = ta.highest(RetracementLookback)
Trough = ta.lowest (RetracementLookback)
// DEVIATION
Deviation = Peak - Trough
// SIDE
Side = Buy and Active ? 1 : (Sell and Active ? -1 : 0)
// FIBONACCI RETRACEMENT ==========================================================================
// FIBONACCI RETRACEMENT
var TP1 = float(na)
var TP2 = float(na)
var Stop = float(na)
F0 = (Side > 0 ? Trough : Peak) + Side * Deviation * 0.000
F1 = (Side > 0 ? Trough : Peak) + Side * Deviation * 0.236
F2 = (Side > 0 ? Trough : Peak) + Side * Deviation * 0.382
F3 = (Side > 0 ? Trough : Peak) + Side * Deviation * 0.500
F4 = (Side > 0 ? Trough : Peak) + Side * Deviation * 0.618
F5 = (Side > 0 ? Trough : Peak) + Side * Deviation * 0.786
F6 = (Side > 0 ? Trough : Peak) + Side * Deviation * 1.000
F7 = (Side > 0 ? Trough : Peak) + Side * Deviation * 1.236
F8 = (Side > 0 ? Trough : Peak) + Side * Deviation * 1.382
F9 = (Side > 0 ? Trough : Peak) + Side * Deviation * 1.500
FX = (Side != 0 ? 1 : (Side != 0 ? 2 : (Side != 0 ? 3 : 0)))
if Side > 0 and FX == 0
TP1 := (close < F1 ? F2 : (close < F2 ? F3 : (close < F3 ? F4 : (close < F4 ? F5 : (close < F5 ? F6 : (close < F6 ? F7 : na))))))
TP2 := (close < F1 ? F3 : (close < F2 ? F4 : (close < F3 ? F5 : (close < F4 ? F6 : (close < F5 ? F7 : (close < F6 ? F8 : na))))))
Stop := close - (Deviation * 0.236 + StopLossBufferPoints)
if Side < 0 and FX == 0
TP1 := (close > F1 ? F2 : (close > F2 ? F3 : (close > F3 ? F4 : (close > F4 ? F5 : (close > F5 ? F6 : (close > F6 ? F7 : na))))))
TP2 := (close > F1 ? F3 : (close > F2 ? F4 : (close > F3 ? F5 : (close > F4 ? F6 : (close > F5 ? F7 : (close > F6 ? F8 : na))))))
Stop := close + (Deviation * 0.236 + StopLossBufferPoints)
// DRAW FIBONACCI RETRACEMENT
var OpenPosition = int(0), OpenPosition := FX > 0 ? OpenPosition + 1 : 0
var Line = float(na), Line := OpenPosition == 1 ? Stop : (OpenPosition == 2 ? TP2 : Line)
plot(Line, linewidth = 1, color = FX == 0 ? na : (OpenPosition < 3 and OpenPosition > 1 ? color.lime : na))
plot(Stop, linewidth = 1, color = FX == 0 ? na : (OpenPosition < 6 and OpenPosition > 0 ? color.fuchsia : na))
plot(TP1, linewidth = 1, color = FX == 0 ? na : (OpenPosition < 6 and OpenPosition > 0 ? color.aqua : na))
plot(TP2, linewidth = 1, color = FX == 0 ? na : (OpenPosition < 6 and OpenPosition > 0 ? color.aqua : na))
// DRAW POINTS IN THE BOX
Box = array.new_box()
if Active and (Buy or Sell) and bar_index > 2 and BoxPoints
StopPoints = str.tostring(math.round(math.abs(close - Stop) / syminfo.mintick) * syminfo.mintick) + " pts"
TP1Points = str.tostring(math.round(math.abs(close - TP1) / syminfo.mintick) * syminfo.mintick) + " pts"
TP2Points = str.tostring(math.round(math.abs(close - TP2) / syminfo.mintick) * syminfo.mintick) + " pts"
array.push(Box, box.new(left = bar_index - 2, top = Stop + BoxHeight, right = bar_index + BoxWidth, bottom = Stop - BoxHeight, text = StopPoints, text_size = size.auto, text_halign = text.align_right, border_color = color.fuchsia, bgcolor = color.new(color.fuchsia, 80)))
array.push(Box, box.new(left = bar_index - 2, top = TP1 + BoxHeight, right = bar_index + BoxWidth, bottom = TP1 - BoxHeight, text = TP1Points, text_size = size.auto, text_halign = text.align_right, border_color = color.aqua, bgcolor = color.new(color.aqua, 80)))
array.push(Box, box.new(left = bar_index - 2, top = TP2 + BoxHeight, right = bar_index + BoxWidth, bottom = TP2 - BoxHeight, text = TP2Points, text_size = size.auto, text_halign = text.align_right, border_color = color.aqua, bgcolor = color.new(color.aqua, 80)))
// WEBHOOK
message = array.new_string()
array.push(message, "\"id\": \"" + WebhookID + "\"")
array.push(message, "\"token\": \"" + WebhookToken + "\"")
array.push(message, "\"ticker\": \"" + syminfo.ticker + "\"")
array.push(message, "\"action\": \"" + (Buy ? "BUY" : "SELL") + "\"")
array.push(message, "\"price\": \"" + str.tostring(close) + "\"")
array.push(message, "\"time\": \"" + str.tostring(time) + "\"")
if Active and (Buy or Sell)
alert(message = "{ " + array.join(message, ", ") + " }", freq = alert.freq_once_per_bar_close)
Scalping EMA+RSI+BB carloss//@version=5
indicator("Scalping EMA+RSI+BB", overlay=true)
// Configuración de la EMA de 20 períodos
emaLength = 20
ema20 = ta.ema(close, emaLength)
// Cambiar color de la EMA según tendencia
emaColor = ema20 > ema20 ? color.green : color.red
plot(ema20, color=emaColor, linewidth=2, title="EMA 20")
// Configuración de las Bandas de Bollinger
bbLength = 20
bbMult = 2.0
basis = ta.sma(close, bbLength)
deviation = ta.stdev(close, bbLength)
upperBB = basis + bbMult * deviation
lowerBB = basis - bbMult * deviation
fill(plot(upperBB, color=color.blue, title="Banda Superior"),
plot(lowerBB, color=color.blue, title="Banda Inferior"), color=color.new(color.blue, 90))
// Configuración del RSI
rsiLength = 14
rsiOverbought = 70
rsiOversold = 30
rsi = ta.rsi(close, rsiLength)
hline(rsiOverbought, "Sobrecompra", color=color.red, linestyle=hline.style_dotted)
hline(rsiOversold, "Sobreventa", color=color.green, linestyle=hline.style_dotted)
hline(50, "Neutral", color=color.gray, linestyle=hline.style_dotted)
// Señales de compra y venta
buySignal = rsi < rsiOversold and close < lowerBB
sellSignal = rsi > rsiOverbought and close > upperBB
// Mostrar señales en el gráfico
plotshape(series=buySignal, title="Compra", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(series=sellSignal, title="Venta", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
// Mensajes para la estrategia
alertcondition(buySignal, title="Alerta de Compra", message="Señal de compra detectada")
alertcondition(sellSignal, title="Alerta de Venta", message="Señal de venta detectada")
Scalping Indicator//@version=5
indicator("Scalping Indicator", overlay=true)
// Input parameters
fastEMA = input(9, title="Fast EMA Length")
slowEMA = input(21, title="Slow EMA Length")
signalSMA = input(9, title="Signal SMA Length")
rsiLength = input(14, title="RSI Length")
rsiOverbought = input(70, title="RSI Overbought Level")
rsiOversold = input(30, title="RSI Oversold Level")
// EMA calculations
fastEma = ta.ema(close, fastEMA)
slowEma = ta.ema(close, slowEMA)
// MACD calculations
= ta.macd(close, fastEMA, slowEMA, signalSMA)
// RSI calculation
rsi = ta.rsi(close, rsiLength)
// Entry and exit conditions
longCondition = ta.crossover(fastEma, slowEma) and macdLine > signalLine and rsi < rsiOverbought
shortCondition = ta.crossunder(fastEma, slowEma) and macdLine < signalLine and rsi > rsiOversold
// Plot buy/sell signals
plotshape(longCondition, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(shortCondition, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
// Plot EMA lines
plot(fastEma, title="Fast EMA", color=color.blue)
plot(slowEma, title="Slow EMA", color=color.orange)
// Background highlights
bgcolor(longCondition ? color.new(color.green, 90) : na, title="Long Background")
bgcolor(shortCondition ? color.new(color.red, 90) : na, title="Short Background")
Green/Red Candle Ratio - Ratiomizer V1.01🔥 Green/Red Candle Ratio Indicator 🔥
📊 Track Market Momentum Instantly!
🚀 Welcome to the Green/Red Candle Ratio Indicator! 🚀
This script dynamically calculates the ratio of green (bullish) vs. red (bearish) candles in your visible chart area, giving you a quick overview of market sentiment.
🛠 About This Script
⚡ Created with the help of ChatGPT – This is an early draft and open-source for everyone to use and improve!
⚠️ Short timeframe users (1min, 5min, etc.) – Be aware that too many candles can sometimes cause issues with calculations.
🔗 If you improve on this idea or use it in your own project, I’d love a little credit! 💙
📺 Follow My Trading Journey!
🎥 Live Trading, Insights & Market Analysis:
📌 YouTube → www.YouTube.com
📌 Kick → www.Kick.com
🙌 Support the content and join an awesome trading community!
💡 How to Use This Indicator
1️⃣ Apply it to your chart
2️⃣ See the real-time green/red candle ratio
3️⃣ Zoom in/out to dynamically adjust the calculations
4️⃣ Use it as an extra confirmation tool for trend momentum
💬 Feedback & improvements are welcome! If you run into issues or have ideas to make this script better, let me know in the community!
🔥 Happy Trading & Stay Profitable! 🔥 🏆
//@version=5
indicator("Green/Red Candle Ratio", overlay=true)
// Define the number of past bars to check (must be within TradingView limits)
maxBarsBack = math.min(500, bar_index) // Ensures we do not exceed available bars
// Initialize counters
greenCount = 0
redCount = 0
neutralCount = 0
totalBars = 0
// Loop through the last `maxBarsBack` bars
for i = 0 to maxBarsBack - 1
idx = bar_index - i
if idx >= 0
if close > open
greenCount := greenCount + 1
else if close < open
redCount := redCount + 1
else
neutralCount := neutralCount + 1
// Ensure only green + red candles contribute to the percentage calculation
validBars = greenCount + redCount
// Calculate ratios correctly so they always add up to 100%
greenRatio = validBars > 0 ? (greenCount / validBars) * 100 : na
redRatio = validBars > 0 ? (redCount / validBars) * 100 : na
// Create label text
labelText = "Green: " + str.tostring(greenRatio, "#.##") + "% Red: " + str.tostring(redRatio, "#.##")
labelColor = greenRatio > redRatio ? color.green : color.red
// Delete previous label before creating a new one
var label ratioLabel = na
if not na(ratioLabel)
label.delete(ratioLabel)
// Display only one label that updates dynamically
ratioLabel := label.new(bar_index, high, labelText, color=color.white, textcolor=labelColor, size=size.normal, style=label.style_label_down)
Protrader Unique bars Renko Chart This is a script which is used to deploy charts on Exchange Trades Platform
My script// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// © junxi6147
//@version=6
indicator("My script")
plot(close)
Moving Average Crossover Strategythis is simple moving average crossover strategy with 2 sma. on different time frames and variable sma parameters
Asia Range Breakout StrategySimple Asia Range Breakout Strategy.
Long Example:
If we are in the trading session and a candle on the current timeframe closes above the asia range we enter a buy with x number of contracts.
SL is ATR multiplied by X
TP 1: Close x number of contracts when ATR multiplied by X is reached
TP 2: Close remaining contracts when ATR multiplied by X is reached
Vice versa for shorts.
Additional, Optional Conditions/ functions (long example):
- Only buy if the current daily candle is bullish → Inputs: true/false
- Only buy if the DXY is below the EMA with length X on timeframe X → Inputs: true/false, EMA length, EMA timeframe
- Trailing SL: ATR Based trailing SL → Inputs: Use Trailing SL true/ false, Trail after X ATR in Profit, Trail SL by X ATR
- Close all open positions x minutes before session end → Inputs: true, false, time input: X minutes before session end
Intraday Leading Indicator Strategy DHRUPAL JOSHIUseful for intraday and swing trading
Use Strategy before making proper analysis
Bollinger Bands with 50 SMABollinger Band and 50 Simple Moving Average.
One has to boy when 50 SMA rising and bollinger band alltogether.
Nifty Support/Resistance with Buy/Sell//@version=5
indicator("Nifty Support/Resistance with Buy/Sell", overlay=true)
// User-defined lookback period
lookback = input(50, title="Lookback Period")
// Calculate dynamic support and resistance
highest_high = ta.highest(high, lookback)
lowest_low = ta.lowest(low, lookback)
// Plot resistance and support levels
plot(highest_high, title="Strong Resistance", color=color.red, linewidth=2, style=plot.style_line)
plot(lowest_low, title="Strong Support", color=color.green, linewidth=2, style=plot.style_line)
// Add horizontal static support/resistance lines if needed
resistance_level = input(23500, title="Static Resistance Level")
support_level = input(23100, title="Static Support Level")
hline(resistance_level, "Resistance Level", color=color.orange, linestyle=hline.style_dashed)
hline(support_level, "Support Level", color=color.blue, linestyle=hline.style_dashed)
// Display alerts when price crosses support or resistance
alertcondition(close > highest_high, title="Breakout Alert", message="Price has broken above resistance!")
alertcondition(close < lowest_low, title="Breakdown Alert", message="Price has fallen below support!")
// Buy and Sell signals when price crosses support and resistance
long_condition = close > highest_high
short_condition = close < lowest_low
// Plot buy and sell signals
plotshape(long_condition, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(short_condition, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
// Generate buy and sell alerts
alertcondition(long_condition, title="Buy Alert", message="Price has broken above resistance. Consider buying!")
alertcondition(short_condition, title="Sell Alert", message="Price has fallen below support. Consider selling!")
Wick Fake BreakoutThis indicator is designed to identify fake breakout setups with precision using EMA and RSI filters. It includes:
Signal Detection: Highlights potential long and short entries based on fake breakout conditions.
Stop Loss and Take Profit Levels: Automatically calculates dynamic SL/TP levels using a risk-reward ratio and order block analysis.
Performance Monitor: Tracks total entries, wins, losses, win rate, average profit, and total profit for both long and short trades.
Time Filter: Automatically restricts signals to specific trading hours (7:30 AM - 1:00 PM).
Customizable Parameters: Adjustable RSI length, EMA length, and risk-reward ratio.
Perfect for traders looking for a systematic approach to scalping or day trading. Clean visuals and optional debugging make it versatile for various trading styles.
Highlight Stocks by Initial Balance vs ATR (RTH)This indicators updates stocks when the IB is between 0.25 and 0.5 ATR