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
74 lines of Pine Script v4 from KS+SSL+WAE/KS+SSL+WAE.txt, published under Apache-2.0. Keep the author's credit and licence lines when you reuse it.
KS+SSL+WAE.txt
//@version=4
study(title="Kijun-Sen + SSL + WAE", shorttitle="KS + SSL + WAE", overlay=true)
// Kijun-Sen+
basePeriods = input(26, minval=1, title="Kijun-Sen Period")
donchian(len) => avg(lowest(len), highest(len))
baseLine = donchian(basePeriods)
plot(baseLine, color=color.yellow, linewidth = 2, title="Kijun-Sen")
ksLong = close > baseLine
ksShort = close < baseLine
// SSL
len=input(title="SSL Period", defval=10)
smaHigh=sma(high, len)
smaLow=sma(low, len)
var float Hlv = na
Hlv := close > smaHigh ? 1 : close < smaLow ? -1 : Hlv[1]
sslDown = Hlv < 0 ? smaHigh: smaLow
sslUp = Hlv < 0 ? smaLow : smaHigh
plot(sslDown, linewidth=2, color=color.red)
plot(sslUp, linewidth=2, color=color.lime)
sslLong = crossover(sslUp, sslDown)
sslShort = crossunder(sslUp, sslDown)
// WAE
sensitivity = input(150, title="WAE Sensitivity")
fastLength=input(20, title="WAE Fast EMA Length")
slowLength=input(40, title="WAE Slow EMA Length")
channelLength=input(20, title="BB Channel Length")
mult=input(2.0, title="BB Stdev Multiplier")
deadZone=input(20, title="No trade zone threshold")
calc_macd(source, fastLength, slowLength) =>
fastMA = ema(source, fastLength)
slowMA = ema(source, slowLength)
fastMA - slowMA
calc_BBUpper(source, length, mult) =>
basis = sma(source, length)
dev = mult * stdev(source, length)
basis + dev
calc_BBLower(source, length, mult) =>
basis = sma(source, length)
dev = mult * stdev(source, length)
basis - dev
t1 = (calc_macd(close, fastLength, slowLength) - calc_macd(close[1], fastLength, slowLength))*sensitivity
t2 = (calc_macd(close[2], fastLength, slowLength) - calc_macd(close[3], fastLength, slowLength))*sensitivity
e1 = (calc_BBUpper(close, channelLength, mult) - calc_BBLower(close, channelLength, mult))
trendUp = (t1 >= 0) ? t1 : 0
trendDown = (t1 < 0) ? (-1*t1) : 0
waeLong = trendUp > e1
waeShort = trendDown > e1
// Computing Strategy
long = ksLong and sslLong and waeLong
short = ksShort and sslShort and waeShort
if long
label.new(x = bar_index, y = na, text = "Long", yloc = yloc.abovebar, color = color.green)
if short
label.new(x = bar_index, y = na, text = "Short", yloc = yloc.abovebar, color = color.red)
// Alerts
alertcondition(long, title = "Long Signal", message = "Long @ {{timenow}}: {{ticker}} -> {{interval}}: {{close}}")
alertcondition(short, title = "Short Signal", message = "Short @ {{timenow}}: {{ticker}} -> {{interval}}: {{close}}")
Overview
The indicator plots the Kijun-Sen and SSL lines directly on the price chart. When price aligns relative to the Kijun-Sen line, an SSL crossover occurs, and WAE momentum surpasses the Bollinger Band channel threshold, the script plots Long or Short labels above price bars and triggers alert conditions.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Kijun-Sen Period
int
26
basePeriods
SSL Period
int
10
len
WAE Sensitivity
int
150
sensitivity
WAE Fast EMA Length
int
20
fastLength
WAE Slow EMA Length
int
40
slowLength
BB Channel Length
int
20
channelLength
BB Stdev Multiplier
float
2.0
mult
No trade zone threshold
int
20
deadZone
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.
ADX Strategy (original) is an overlay indicator that identifies trend-following trade signals using the Average Directional Index (ADX) combined with a Simple Moving Average filter. A long signal is generated when the ADX rises above a user-defined trend level
Double Screened Decision is a multi-timeframe trend and momentum indicator overlaid directly on the price chart. It dynamically selects a higher timeframe based on the active chart resolution to evaluate higher-timeframe MACD, Bollinger Bands, RSI, and Stochas
This indicator plots Bollinger Bands on the price chart alongside a baseline moving average to identify trend-aligned swing setups. It calculates trend bias by comparing the Bollinger Bands basis to a customizable moving average, such as a 200 EMA. Trade signa
Index Intraday Analyst overlays CBOE cash indices such as SPX, NDX, RUT, and DJX. It plots a multi-EMA ribbon, a session-anchored TWAP with standard-deviation bands, and session levels such as prior-day high, low, and close, the opening range, and the high and
RePaNoCHa V4 is an overlay alert indicator that plots a Tillson T3 moving average on the price chart and colors it by whether the line is rising or falling. It combines that slope with a range filter, ADX, parabolic SAR, RSI, and MACD to mark long and short si
This indicator plots an exponential moving average and marks momentum-based trade sessions on the price chart. It treats RSI between 45 and 55 as chop and shades the background when momentum is present. Long and short labels appear when MACD crosses its signal