-
-
Save Toeron/8562affb4c6cd62a0e73ce59a895f394 to your computer and use it in GitHub Desktop.
Revisions
-
Toeron revised this gist
Dec 6, 2022 . 1 changed file with 23 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ //@version=4 study(title="CTO Line", shorttitle="CTO", overlay=true, resolution="1440") smma(src, length) => smma = 0.0 smma := na(smma[1]) ? sma(src, length) : (smma[1] * (length - 1) + src) / length @@ -11,7 +11,27 @@ v2 = smma(hl2, 29) p2 = v1<m1 != v1<v2 or m2<v2 != v1<v2 p3 = not p2 and v1<v2 p1 = not p2 and not p3 c = p1 ? color.yellow : p2 ? color.silver : color.blue line1 = plot(v1, "Line 1", color=c) line2 = plot(v2, "Line 2", color=c) fill(line1, line2, color=c) //add buy signal when color.silver turns to yellow cond1 = p2[1] and p1 cond2 = p2 and p1 g = cond1 ? color.yellow : cond2 ? color.yellow : na //plot(close, "Close", color=g, style=plot.style_circles, linewidth=2, transp=80) plotshape(cond1 or cond2, title="", style=shape.circle, size=size.small, location=location.abovebar, color=g, text="BUY") //add sell signal when color.silver turns to blue cond3 = p2[1] and p3 cond4 = p2 and p3 r = cond3 ? color.blue : cond4 ? color.blue : na //plot(close, "Close", color=r, style=plot.style_circles, linewidth=2, transp=80) plotshape(cond3 or cond4, title="", style=shape.circle, size=size.small, location=location.belowbar, color=r, text="SELL") //add bullish alert when color.silver turns to yellow alertcondition(cond1 or cond2, title='Golden Line Buy Alert', message='Golden Line Buy Alert') //add bearish alert when color.silver turns to blue alertcondition(cond3 or cond4, title='Golden Line Sell Alert', message='Golden Line Sell Alert') -
tobia revised this gist
May 20, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ //@version=4 study(title="CTO Line", shorttitle="CTO", overlay=true, resolution="") smma(src, length) => smma = 0.0 smma := na(smma[1]) ? sma(src, length) : (smma[1] * (length - 1) + src) / length -
tobia created this gist
May 19, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ //@version=4 study(title="CTO Line", shorttitle="CTO", overlay=true, resolution="240") smma(src, length) => smma = 0.0 smma := na(smma[1]) ? sma(src, length) : (smma[1] * (length - 1) + src) / length smma v1 = smma(hl2, 15) m1 = smma(hl2, 19) m2 = smma(hl2, 25) v2 = smma(hl2, 29) p2 = v1<m1 != v1<v2 or m2<v2 != v1<v2 p3 = not p2 and v1<v2 p1 = not p2 and not p3 c = p1 ? color.orange : p2 ? color.silver : color.navy line1 = plot(v1, "Line 1", color=c) line2 = plot(v2, "Line 2", color=c) fill(line1, line2, color=c)