Message 6
Message 6
Message 6
if na(rangec[1])
direction := 1
else if prevSuperTrend == prevUpperBand
direction := close > upperBand ? -1 : 1
else
direction := close < lowerBand ? 1 : -1
superTrend := direction == -1 ? lowerBand : upperBand
[superTrend, direction]
// Get Components
ema1 = ta.ema(high, 9)
ema2 = ta.ema(high, 12)
ema3 = ta.ema(high, 15)
ema4 = ta.ema(high, 18)
ema5 = ta.ema(high, 21)
ema6 = ta.ema(high, 24)
ema7 = ta.ema(high, 27)
ema8 = ta.ema(high, 30)
ema9 = ta.ema(high, 33)
ema10 = ta.ema(high, 36)
ema11 = ta.ema(high, 39)
ema12 = ta.ema(high, 42)
ema13 = ta.ema(high, 45)
ema14 = ta.ema(high, 48)
ema15 = ta.ema(high, 51)
// Colors
green = #2BBC4D, red = #C51D0B
emaEnergyColor(ma) => emaEnergy ? (close >= ma ? green : red) : na
// Plots
//plot(ema1, "", emaEnergyColor(ema1), editable=false)
//plot(ema2, "", emaEnergyColor(ema2), editable=false)
plot(ema3, "", emaEnergyColor(ema3), editable=false)
plot(ema4, "", emaEnergyColor(ema4), editable=false)
plot(ema5, "", emaEnergyColor(ema5), editable=false)
plot(ema6, "", emaEnergyColor(ema6), editable=false)
plot(ema7, "", emaEnergyColor(ema7), editable=false)
plot(ema8, "", emaEnergyColor(ema8), editable=false)
plot(ema9, "", emaEnergyColor(ema9), editable=false)
plot(ema10, "", emaEnergyColor(ema10), editable=false)
plot(ema11, "", emaEnergyColor(ema11), editable=false)
plot(ema12, "", emaEnergyColor(ema12), editable=false)
plot(ema13, "", emaEnergyColor(ema13), editable=false)
plot(ema14, "", emaEnergyColor(ema14), editable=false)
plot(ema15, "", emaEnergyColor(ema15), editable=false)
[supertrend, direction] = supertrend(close, sensitivity, 11, keltner_length)
bull = ta.crossover(close, supertrend)
bear = ta.crossunder(close, supertrend)
y1 = low - (ta.atr(30) * 2)
y2 = high + (ta.atr(30) * 2)
// Braid Filter
//-- Inputs
maType = input.string('McGinley', 'Filter', options=['EMA', 'DEMA', 'TEMA', 'WMA',
'VWMA', 'SMA', 'SMMA', 'HMA', 'LSMA', 'Kijun', 'McGinley', 'RMA'])
Period1 = 3
Period2 = 7
Period3 = 20
PipsMinSepPercent = input(60, 'Filter Strength')
//-- Plots
BraidColor = ma01 > ma02 and dif > filter ? color.green : ma02 > ma01 and dif >
filter ? color.red : color.gray
buy = bull and ma01 > ma02 and dif > filter ? label.new(bar_index, y1, "BUY",
xloc.bar_index, yloc.price, green, label.style_label_up, color.white,
size.normal) : na
sell = bear and ma02 > ma01 and dif > filter ? label.new(bar_index, y2, "SELL",
xloc.bar_index, yloc.price, red, label.style_label_down, color.white,
size.normal) : na
colorsr = 'DARK'
bullcolorr = colorsr == 'DARK' ? color.rgb(0, 255, 8) : #00DBFF
bearcolorr = colorsr == 'DARK' ? color.rgb(255, 0, 0) : #E91E63
rsiLengthInput = 22
rsiSourceInput = close
maTypeInput = ta.sma(close, 14)
up66 = ta.rma(math.max(ta.change(rsiSourceInput), 0), rsiLengthInput)
downw = ta.rma(-math.min(ta.change(rsiSourceInput), 0), rsiLengthInput)
rsi66 = downw == 0 ? 100 : up66 == 0 ? 0 : 100 - (100 / (1 + up66 / downw))
rsiMA = maTypeInput
// SHORT
short1 = ta.crossunder(rsi66, 70)
short2 = ta.crossunder(rsi66, 80)
short3 = ta.crossunder(rsi66, 85)
//short4 = ta.crossunder(rsi66, 90)
// LONG
plotshape(long1 and ShowTEX and TE1, "GO LONG 1", style=shape.circle,
location=location.belowbar,size=size.tiny, color = color.new(bullcolorr , 60) ,
text="Sell TP" , textcolor = bullcolorr , editable = false)
plotshape(long2 and ShowTEX and TE2, "GO LONG 2", style=shape.circle,
location=location.belowbar,size=size.tiny, color = color.new(bullcolorr , 50),
text="Sell TP" , textcolor = bullcolorr , editable = false)
plotshape(long3 and ShowTEX and TE3, "GO LONG 3", style=shape.circle,
location=location.belowbar,size=size.tiny, color = color.new(bullcolorr , 10),
text="Sell TP", textcolor = bullcolorr , editable = false)
//plotshape(long4 and ShowTEX, "GO LONG 4", style=shape.circle,
location=location.belowbar,size=size.tiny, color=color.gray, text="4")
// SHORT
plotshape(short1 and ShowTEX and TE1, "GO SHORT 1", style=shape.circle,
location=location.abovebar,size=size.tiny, color = color.new(bearcolorr , 60) ,
text="Buy TP" , textcolor = bearcolorr , editable = false)
plotshape(short2 and ShowTEX and TE2, "GO SHORT 2", style=shape.circle,
location=location.abovebar,size=size.tiny, color = color.new(bearcolorr , 50) ,
text="Buy TP" , textcolor = bearcolorr , editable = false)
plotshape(short3 and ShowTEX and TE3, "GO SHORT 3", style=shape.circle,
location=location.abovebar,size=size.tiny, color = color.new(bearcolorr , 10) ,
text="Buy TP" , textcolor = bearcolorr , editable = false)
//plotshape(short4 and ShowTEX, "GO SHORT 4", style=shape.circle,
location=location.abovebar,size=size.tiny, color=color.gray, text="4")
import protradingart/pta_plot/6 as pp
pp.peakprofit(bull and ma01 > ma02 and dif > filter, bear and ma02 > ma01 and dif >
filter)