Created
September 27, 2021 06:34
-
-
Save kyob/707f06e2be5904cd01c8d3aa5d184517 to your computer and use it in GitHub Desktop.
Revisions
-
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)