-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathKnowSureThingSTUDY.ts
45 lines (36 loc) · 1.49 KB
/
KnowSureThingSTUDY.ts
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
33
34
35
36
37
38
39
40
41
42
43
44
45
# KNOWSURETHING
# DREWGRIFFITH15 (C) 2014
declare lower;
input RC1_LEN = 5;
input RC1_SMA = 10;
input RC2_LEN = 5;
input RC2_SMA = 15;
input RC3_LEN = 5;
input RC3_SMA = 20;
input RC4_LEN = 5;
input RC4_SMA = 25;
input KST_SMA = 5;
input FILTER = 0.30; # SIZE of MOVEMENT
input price = close;
DEF RC1 = if price[RC1_LEN] > 0 then (price / price[RC1_LEN] - 1) * 100 else 0;
DEF RC2 = if price[RC2_LEN] > 0 then (price / price[RC2_LEN] - 1) * 100 else 0;
DEF RC3 = if price[RC3_LEN] > 0 then (price / price[RC3_LEN] - 1) * 100 else 0;
DEF RC4 = if price[RC4_LEN] > 0 then (price / price[RC4_LEN] - 1) * 100 else 0;
DEF RCMA1 = SIMPLEMOVINGAVG(RC1,RC1_SMA);
DEF RCMA2 = SIMPLEMOVINGAVG(RC2,RC2_SMA);
DEF RCMA3 = SIMPLEMOVINGAVG(RC3,RC3_SMA);
DEF RCMA4 = SIMPLEMOVINGAVG(RC4,RC4_SMA);
PLOT KST = (RCMA1 * 1) + (RCMA2 * 2) + (RCMA3 * 3) + (RCMA4 * 4);
PLOT SignalLine = SIMPLEMOVINGAVG(KST,9);
PLOT ZeroLine = 0;
PLOT RATING =
IF KST > SignalLine AND KST[1] < SignalLine[1] AND ROUND(KST-KST[1],2) >= FILTER THEN ROUND(KST-KST[1],2)
ELSE IF KST < SignalLine AND KST[1] > SignalLine[1] AND ROUND(KST-KST[1],2) <= -FILTER THEN ROUND(KST-KST[1],2)
#ELSE IF KST > ZeroLine AND KST[1] < ZeroLine AND ROUND(KST-KST[1],2) >= FILTER THEN ROUND(KST-KST[1],2)
#ELSE IF KST < ZeroLine AND KST[1] > ZeroLine AND ROUND(KST-KST[1],2) <= -FILTER THEN ROUND(KST-KST[1],2)
ELSE 0;
KST.SETDEFAULTCOLOR(COLOR.MAGENTA);
SignalLine.SETDEFAULTCOLOR(COLOR.CYAN);
ZeroLine.SETDEFAULTCOLOR(COLOR.DARK_GRAY);
RATING.HIDE();
RATING.HIDEBUBBLE();