0% found this document useful (0 votes)
18 views2 pages

KING AMIt2

The document outlines a trading strategy using trend indicators and exponential moving averages (EMAs). It includes conditions for buy and sell signals based on trend changes, as well as visual plots for up and down trends. Additionally, it provides options to customize the lengths of EMAs and alerts for significant trading signals.

Uploaded by

Parvej Makandar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views2 pages

KING AMIt2

The document outlines a trading strategy using trend indicators and exponential moving averages (EMAs). It includes conditions for buy and sell signals based on trend changes, as well as visual plots for up and down trends. Additionally, it provides options to customize the lengths of EMAs and alerts for significant trading signals.

Uploaded by

Parvej Makandar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

rend := nz(trend[1], trend)

trend := trend == -1 and close > dn1 ? 1 : trend == 1 and close < up1 ? -1 : trend
upPlot = plot(trend == 1 ? up : na, title="Up Trend", style=plot.style_linebr,
linewidth=2, color=color.green)
buySignal = trend == 1 and trend[1] == -1
plotshape(buySignal ? up : na, title="UpTrend Begins", location=location.absolute,
style=shape.circle, size=size.tiny, color=color.green, transp=0)
plotshape(buySignal and showsignals ? up : na, title="Buy", text="Buy",
location=location.absolute, style=shape.labelup, size=size.tiny, color=color.green,
textcolor=color.white, transp=0)
dnPlot = plot(trend == 1 ? na : dn, title="Down Trend", style=plot.style_linebr,
linewidth=2, color=color.red)
sellSignal = trend == -1 and trend[1] == 1
plotshape(sellSignal ? dn : na, title="DownTrend Begins",
location=location.absolute, style=shape.circle, size=size.tiny, color=color.red,
transp=0)
plotshape(sellSignal and showsignals ? dn : na, title="Sell", text="Sell",
location=location.absolute, style=shape.labeldown, size=size.tiny, color=color.red,
textcolor=color.white, transp=0)
mPlot = plot(ohlc4, title="", style=plot.style_circles, linewidth=0)
longFillColor = highlighting ? (trend == 1 ? color.green : color.white) :
color.white
shortFillColor = highlighting ? (trend == -1 ? color.red : color.white) :
color.white
fill(mPlot, upPlot, title="UpTrend Highligter", color=longFillColor)
fill(mPlot, dnPlot, title="DownTrend Highligter", color=shortFillColor)
alertcondition(buySignal, title="SuperTrend Buy", message="SuperTrend Buy!")
alertcondition(sellSignal, title="SuperTrend Sell", message="SuperTrend Sell!")
changeCond = trend != trend[1]
alertcondition(changeCond, title="SuperTrend Direction Change", message="SuperTrend
has changed direction!")

//////////////////////////////////////////////// EMA -
5/20/50 ///////////////////////////////////////////////

EMA9_Len = input(9, minval=1, title="EMA9_Length")


//EMA5_src = input(close, title="EMA9_Source")
//EMA5_offset = input(title="EMA9_Offset", type=input.integer, defval=0, minval=-
500, maxval=500)
EMA9_out = ema(close, EMA9_Len)
plot(showEMA9 ? EMA9_out:na, title="EMA9", color=color.maroon,
offset=0,linewidth=2)

EMA20_Len = input(20, minval=1, title="EMA20_Length")


//EMA20_src = input(close, title="EMA20_Source")
//EMA20_offset = input(title="EMA20_Offset", type=input.integer, defval=0,
minval=-500, maxval=500)
EMA20_out = ema(close, EMA20_Len)
plot(showEMA20 ? EMA20_out:na, title="EMA20", color=color.olive,
offset=0,linewidth=2)

EMA50_Len = input(50, minval=1, title="EMA50_Length")


//EMA50_src = input(close, title="EMA50_Source")
//EMA50_offset = input(title="EMA50_Offset", type=input.integer, defval=0,
minval=-500, maxval=500)
EMA50_out = ema(close, EMA50_Len)
plot(showEMA50 ? EMA50_out:na, title="EMA50", color=color.blue,
offset=0,linewidth=2)

You might also like