多空
多空
// srflip2011
// --- inputs
source = close
TITLE = input(false, title='Turn on Alerts & Enable Background Color options are
based on EMA1 & EMA2 Crossovers, (This button does nothing)')
turnon2 = input(true, title='Turn on Alerts?')
colorbars = input(true, title = "Color Bars?")
colorbars2 = input(true,title = "Color Bar when price closes under / above Ema 1 &
2?" , inline = "1")
barc1 = input (color.rgb(0, 38, 255), "", inline = "1")
barc2 = input(color.orange, "", inline ="1")
turnon = input(true, title='Turn on Ema 1 & 2?')
backgroundcolor = input(false, title='Enable Background Color?')
// Dashboard
showTable = input.bool(defval=false, title='Display Ema Dashboard', group='EMA
Dashboard🤖')
tablePosition = input.string(title='Dashboard Position?', defval=position.top_right,
options=[position.bottom_left, position.top_left, position.bottom_right,
position.top_right], group='Trend Dashboard🤖', tooltip = "Allows you to change the
position of the dashboard on the chart.")
tableTextSize = input.string(title='Dashboard Size?', defval=size.small,
options=[size.auto, size.tiny, size.small, size.normal, size.large, size.huge],
group='Trend Dashboard🤖', tooltip = "Use Tiny if on Mobile, Use Small if on Web
browser.")
//Ema 1 & 2
len1 = input.int(10, minval=1, title='EMA1')
len2 = input.int(21, minval=1, title='EMA2')
ema1 = ta.ema(source, len1)
ema2 = ta.ema(source, len2)
//---
//Ema 4
turnon4 = input(false, title='Turn on EMA4')
len4 = input.int(8, minval=1, title='EMA4')
ema4 = ta.ema(source, len4)
plot(turnon4 ? ema4 : na, 'Ema 4', style=plot.style_line, linewidth=2,
color=color.new(color.orange, 0))
//Ema 5
turnon5 = input(false, title='Turn on EMA5?')
len5 = input.int(34, minval=1, title='EMA5')
ema5 = ta.ema(source, len5)
plot(turnon5 ? ema5 : na, 'Ema 5', style=plot.style_line, linewidth=2,
color=color.new(color.yellow, 0))
//Ema 6
turnon6 = input(false, title='Turn on EMA6?')
len6 = input.int(55, minval=1, title='EMA6')
ema6 = ta.ema(source, len6)
plot(turnon6 ? ema6 : na, 'Ema 6', style=plot.style_line, linewidth=2,
color=color.new(color.purple, 0))
//Ema 7
turnon7 = input(false, title='Turn on EMA7?')
len7 = input.int(89, minval=1, title='EMA7')
ema7 = ta.ema(source, len7)
plot(turnon7 ? ema7 : na, 'Ema 7', style=plot.style_line, linewidth=2,
color=color.new(color.fuchsia, 0))
//Ema 8
turnon8 = input(false, title='Turn on EMA8?')
len8 = input.int(144, minval=1, title='EMA8')
ema8 = ta.ema(source, len8)
plot(turnon8 ? ema8 : na, 'Ema 8', style=plot.style_line, linewidth=2,
color=color.new(color.teal, 0))
// Ema 9
turnon9 = input(false, title='Turn on EMA9?')
len9 = input.int(200, minval=1, title='EMA9')
ema9 = ta.ema(source, len9)
plot(turnon9 ? ema9 : na, 'Ema 9', style=plot.style_line, linewidth=2,
color=color.new(color.aqua, 0))
// Ema Cross
mylong = ta.crossover(ema1, ema2)
myshort = ta.crossunder(ema1, ema2)
// Calculations
last_long = float(na)
last_short = float(na)
last_long := mylong ? time : nz(last_long[1])
last_short := myshort ? time : nz(last_short[1])
condlongx = in_long
condlong = ta.crossover(condlongx, 1.9)
condlongclose = ta.crossunder(condlongx, 1.9)
condshortx = in_short
condshort = ta.crossover(condshortx, 1.9)
condshortclose = ta.crossover(condshortx, 1.9)
// Color Fill
fcolor = first > sec ? #0aff68 : first < sec ? #ff0a5a : #cccccc
// Ema Output
F1 = plot(turnon ? first : na, color=fcolor, linewidth=2)
S2 = plot(turnon ? sec : na, color=fcolor, linewidth=2)
fill(F1, S2, title='Channel Fill', color=fcolor, transp=60)
// Plots
plotshape(turnon2 ? condlong : na, title='Breakout', color=color.rgb(19, 236, 56),
location=location.belowbar, style=shape.labelup, text='多',
textcolor=color.new(color.white, 0), size=size.small, offset=1)
plotshape(turnon2 ? condshort : na, title='Breakdown', color=color.new(#9d0d0d, 0),
style=shape.labeldown, text='空', textcolor=color.new(color.white, 0), size=size.small,
offset=1)
// Background Color
bgcolor(backgroundcolor ? fcolor : na, transp=67)
// Start Ema Dashboard inputs
// Signal Crossover
Dema1 = ema1 > ema2 ? "Above" : "Below"
Dema11 = ema1 > ema2 ? color.rgb(47, 78, 48) : color.rgb(255, 0, 0)
// Start Emas
// len1
Dema2 = close > ema1 ? "Above" : "Below"
Dema22 = close > ema1 ? color.rgb(47, 78, 48) : color.rgb(255, 0, 0)
//
// len2
Dema3 = close > ema2 ? "Above" : "Below"
Dema33 = close > ema2 ? color.rgb(47, 78, 48) : color.rgb(255, 0, 0)
//
Dema4 = close > ema3 ? "Above" : "Below"
Dema44 = close > ema3 ? color.rgb(47, 78, 48) : color.rgb(255, 0,0)
//
Dema5 = close > ema4 ? "Above" : "Below"
Dema55 = close > ema4 ? color.rgb(47, 78, 48) : color.rgb(255, 0, 0)
//
Dema6 = close > ema5 ? "Above" : "Below"
Dema66 = close > ema5 ? color.rgb(47, 78, 48) : color.rgb(255, 0,0)
//
Dema7 = close > ema6 ? "Above" : "Below"
Dema77 = close > ema6 ? color.rgb(47, 78, 48) : color.rgb(255, 0,0)
//
Dema8 = close > ema7 ? "Above" : "Below"
Dema88 = close > ema7 ? color.rgb(47, 78, 48) : color.rgb(255, 0,0)
//
Dema9 = close > ema8 ? "Above" : "Below"
Dema99 = close > ema8 ? color.rgb(47, 78, 48) : color.rgb(255, 0,0)
//
Dema10 = close > ema9 ? "Above" : "Below"
Dema101 = close > ema9 ? color.rgb(47, 78, 48) : color.rgb(255, 0,0)