forked from bingit2/TradingView-to-ThinkorSwim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CL Trend Visualization
30 lines (26 loc) · 894 Bytes
/
CL Trend Visualization
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
# CL Trend Visualization
# Assembled by BenTen at useThinkScript.com
# Converted from https://www.tradingview.com/script/J9sIKczO-CL-Trend-Visualization/
declare lower;
input length1 = 14;
input length2 = 50;
input length3 = 100;
input length4 = 200;
input length5 = 500;
input src = close;
def ma1 = simpleMovingAvg(src, length1);
def cci1 = (src - ma1) / (0.015 * stdev(src, length1));
def ma2 = simpleMovingAvg(src, length2);
def cci2 = (src - ma2) / (0.015 * stdev(src, length2));
def ma3 = simpleMovingAvg(src, length3);
def cci3 = (src - ma3) / (0.015 * stdev(src, length3));
def ma4 = simpleMovingAvg(src, length4);
def cci4 = (src - ma4) / (0.015 * stdev(src, length4));
def ma5 = simpleMovingAvg(src, length5);
def cci5 = (src - ma5) / (0.015 * stdev(src, length5));
plot ZeroLine = 0;
plot line1 = cci1;
plot line2 = cci2;
plot line3 = cci3;
plot line4 = cci4;
plot line5 = cci5;