-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSF-TrendRibbon-OnlyPierre.txt
32 lines (25 loc) · 1.11 KB
/
SF-TrendRibbon-OnlyPierre.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//@version=5
indicator(title="TrendribbonP", shorttitle="TrendribbonP", overlay=false)
M_or_D = input.string("Mono", title="Mono or Dual color", options=["Mono", "Dual"])
Mono_or_Dual_select(type) =>
switch type
"Mono" => 1
"Dual" => 0
// slow ema
slowEmaSource = input(defval = close)
slowEmaLength = input.int(defval = 30, minval = 1)
// fast ema
fastEmaSource = input(defval = close)
fastEmaLength = input.int(defval = 13, minval=1)
// declare EMAs
fastEma = ta.ema(fastEmaSource, fastEmaLength)
slowEma = ta.ema(slowEmaSource, slowEmaLength)
// draw lines
//transparencySetting=0 // visible outline
transparencySetting=100 // invisible outline
p1=plot(series=fastEma, title="FastEMA", color=color.new(#00FFFF, transparencySetting), linewidth=1, display=display.none)
p2=plot(series=slowEma, title="SlowEMA", color=color.new(color.blue, transparencySetting), linewidth=1, style=plot.style_stepline, display=display.none)
//fillColor = Krill_Pierre_select(K_or_P)
Mono = Mono_or_Dual_select(M_or_D)
fillColor = (fastEma > slowEma) ? #00BFFF : (Mono ? #00BFFF : color.red)
fill(p1, p2, fillColor)