1Copy the scriptPress Copy script above, or the copy button on the code below.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.
Source Code
121 lines of Pine Script v5 from indicators/JR/jra.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.
jra.pine
//@version=5
indicator("Jens Rabe Academy - Indicator 1", overlay=true, shorttitle="JRA 1")
// Common Inputs
showDDayAndLabel = input(true, "Show D-Day Marker and Label")
showClimaxes = input(true, "Show Buying/Selling Climaxes")
show52WeekHighLow = input(true, "Show 52-Week High/Low")
showEma10 = input(true, "Show 10 EMA")
showEma21 = input(true, "Show 21 EMA")
showSma30 = input(true, "Show 30 SMA")
showSma40 = input(true, "Show 40 SMA")
showSma50 = input(true, "Show 50 SMA")
showSma150 = input(true, "Show 150 SMA")
showSma200 = input(true, "Show 200 SMA")
var float weekly_ema21 = na
var float prev_weekly_close = na
var bool allowDDays = true
var float dday_count = 0.0
var float dday_count_temp = 0.0 // Neue Zeile hier
weekly_ema21 := request.security(syminfo.tickerid, "W", ta.ema(close, 21), lookahead=barmerge.lookahead_on)
prev_weekly_close := request.security(syminfo.tickerid, "W", close[1], lookahead=barmerge.lookahead_on)
if (ta.change(time("W")) != 0)
allowDDays := prev_weekly_close > weekly_ema21
// D-Day Logik
is_dday = close < close[1] * 0.998 and volume > volume[1] and timeframe.isdaily and allowDDays
// Zustand aktualisieren und math.sum aufrufen
dday_count_temp := math.sum(is_dday ? 1 : 0, 25) // Aktualisierung hier
if (allowDDays)
dday_count := dday_count_temp
else
dday_count := 0
// Zeichnet den D-Day Marker, wenn D-Days erlaubt sind
plotchar(is_dday and showDDayAndLabel, title="D-Day Marker", char="D", location=location.abovebar, color=color.black, size=size.tiny)
// EMA Logic
length21 = 21
ema21 = ta.ema(close, length21)
var float counterAbove = 0.0
var float counterBelow = 0.0
if (barstate.isconfirmed)
if (close > ema21)
counterAbove := counterAbove + 1
counterBelow := 0
else
counterBelow := counterBelow + 1
counterAbove := 0
// Additional MAs
ema10 = ta.ema(close, 10)
sma30 = ta.sma(close, 30)
sma40 = ta.sma(close, 40)
sma50 = ta.sma(close, 50)
sma150 = ta.sma(close, 150)
sma200 = ta.sma(close, 200)
// Climax Logic
length52 = 52
highestHigh = ta.highest(high, length52)
lowestLow = ta.lowest(low, length52)
highestHighPrev = ta.highest(high[1], length52)
lowestLowPrev = ta.lowest(low[1], length52)
buyingClimax = high > highestHighPrev and close < open and timeframe.isweekly
sellingClimax = low < lowestLowPrev and close > open and timeframe.isweekly
// 52-Week High/Low Logic für den Tageschart
length52Weeks = 260 // 52 Wochen * 5 Tage
highestHigh52 = ta.highest(high, length52Weeks)
lowestLow52 = ta.lowest(low, length52Weeks)
short_length = 40
// Hole die Werte vom Tageschart
highestHigh52_daily = request.security(syminfo.tickerid, "D", highestHigh52)
lowestLow52_daily = request.security(syminfo.tickerid, "D", lowestLow52)
// Zeichnet kürzere Linien für das 52-Wochen-Hoch und -Tief auf dem aktuellen Chart
if (barstate.islast and show52WeekHighLow)
line.new(x1=bar_index-short_length, y1=highestHigh52_daily, x2=bar_index, y2=highestHigh52_daily, color=color.red, width=2)
line.new(x1=bar_index-short_length, y1=lowestLow52_daily, x2=bar_index, y2=lowestLow52_daily, color=color.green, width=2)
// Combined Label
var label labelID = na
if (na(labelID) == false)
label.delete(labelID)
labelText = ""
if (counterAbove > 0)
labelText := "über EMA: +" + str.tostring(counterAbove)
if (counterBelow > 0)
labelText := "unter EMA: -" + str.tostring(counterBelow)
if (timeframe.isdaily)
labelText := labelText + "\nD-Days: " + str.tostring(dday_count)
var color labelColor = na
labelColor := counterAbove > 0 ? color.green : (counterBelow > 0 ? color.red : na)
if (showDDayAndLabel and labelText != "")
labelID := label.new(x=bar_index +1, y=close, text=labelText, color=labelColor, textcolor=color.white, xloc=xloc.bar_index, yloc=yloc.price, size=size.normal, style=label.style_label_left)
// Plotting
plot(showEma10 ? ema10 : na, color=color.black, title="10 EMA", linewidth=2)
plot(showEma21 ? ema21 : na, color=color.green, title="21 EMA", linewidth=2)
plot(showSma30 ? sma30 : na, color=color.blue, title="30 SMA", linewidth=2)
plot(showSma40 ? sma40 : na, color=color.yellow, title="40 SMA", linewidth=2)
plot(showSma50 ? sma50 : na, color=color.orange, title="50 SMA", linewidth=2)
plot(showSma150 ? sma150 : na, color=color.purple, title="150 SMA", linewidth=2)
plot(showSma200 ? sma200 : na, color=color.red, title="200 SMA", linewidth=2)
plotchar(is_dday and showDDayAndLabel, title="D-Day Marker", char="D", location=location.abovebar, color=color.black, size=size.tiny)
plotchar(buyingClimax and showClimaxes, title="Buying Climax", char="B", location=location.abovebar, color=color.red, size=size.tiny)
plotchar(sellingClimax and showClimaxes, title="Selling Climax", char="S", location=location.belowbar, color=color.green, size=size.tiny)
Overview
Jens Rabe Academy - Indicator 1 calculates exponential moving averages (10, 21) and simple moving averages (30, 40, 50, 150, 200), identifies distribution days (D-Days) based on volume and price drops, detects buying and selling climaxes, and plots current 52-week high and low lines. A dynamic chart label tracks consecutive bars trading above or below the 21 EMA. Note that the script uses lookahead in higher-timeframe security calls.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Show D-Day Marker and Label
bool
true
showDDayAndLabel
Show Buying/Selling Climaxes
bool
true
showClimaxes
Show 52-Week High/Low
bool
true
show52WeekHighLow
Show 10 EMA
bool
true
showEma10
Show 21 EMA
bool
true
showEma21
Show 30 SMA
bool
true
showSma30
Show 40 SMA
bool
true
showSma40
Show 50 SMA
bool
true
showSma50
Show 150 SMA
bool
true
showSma150
Show 200 SMA
bool
true
showSma200
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.
This indicator plots two Hull moving averages on the price chart, one of the selected price and one of close, and optionally smooths both with a Kahlman filter. It fills the space between them and marks buy and sell labels when they cross, provided scaled volu
This indicator plots a fixed lookback Volume Profile alongside 20, 50, and 200 Simple Moving Averages directly on the price chart. It highlights trend changes via moving average crosses and marks Point of Control reactions, High Volume Nodes, and Value Area bo
This indicator calculates a Variable Index Dynamic Average (VIDYA) by dynamically adjusting a moving average according to Chande Momentum Oscillator values and smoothing the result. It plots directly on the main price chart to help traders evaluate current tre
This indicator unifies Price Volume Spread Analysis (PVSRA) with a suite of moving averages and VWAP. It calculates volume classifications—flagging climax, above-average, and regular bars—and projects synchronized candle coloring, six customizable EMAs, three
This overlay indicator marks call and put setups from EMAs, RSI, MACD, and a SPY volume ratio. A call needs higher highs, RSI above its minimum, rising MACD, above-average proxy volume, and a rising trend EMA; a put reverses those tests. Early markers use an E