OPEN-SOURCE SCRIPT

Breakout Stock Identifier

//version=5
indicator("Breakout Stock Identifier", overlay=true)

// Input parameters
lookback = input.int(20, "Lookback Period", minval=1)
volume_threshold = input.float(1.5, "Volume Threshold", minval=1.0, step=0.1)
breakout_percentage = input.float(2.0, "Breakout Percentage", minval=0.1, step=0.1)

// Calculate moving averages
sma20 = ta.sma(close, 20)
sma50 = ta.sma(close, 50)
sma200 = ta.sma(close, 200)

// Identify trend
uptrend = sma20 > sma50 and sma50 > sma200
downtrend = sma20 < sma50 and sma50 < sma200

// Calculate average volume
avg_volume = ta.sma(volume, lookback)

// Identify volume spike
volume_spike = volume > (avg_volume * volume_threshold)

// Calculate price range
highest_high = ta.highest(high, lookback)
lowest_low = ta.lowest(low, lookback)

// Detect breakout
breakout_up = close > highest_high * (1 + breakout_percentage / 100) and uptrend
breakout_down = close < lowest_low * (1 - breakout_percentage / 100) and downtrend

// Combine conditions for final breakout signal
breakout_signal = (breakout_up or breakout_down) and volume_spike

// Plot signals
plotshape(breakout_signal and breakout_up, title="Bullish Breakout", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small)
plotshape(breakout_signal and breakout_down, title="Bearish Breakout", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.small)

// Plot moving averages
plot(sma20, color=color.blue, title="SMA 20")
plot(sma50, color=color.green, title="SMA 50")
plot(sma200, color=color.red, title="SMA 200")

// Alert condition
alertcondition(breakout_signal, title="Breakout Detected", message="Potential breakout detected!")
Chart patternseducationalTrend Analysis

Open-source Skript

Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun das Script auch andere Trader verstehen und prüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden. Die Nutzung dieses Codes in einer Veröffentlichung wird in unseren Hausregeln reguliert. Sie können es als Favoriten auswählen, um es in einem Chart zu verwenden.

Möchten Sie dieses Skript auf einem Chart verwenden?

Haftungsausschluss