Skip to content

Know Sure Thing ​

Know Sure Thing: weighted sum of four smoothed rates of change.

Kind indicator · Drawn in its own pane

Try it ​

On the chart, press / and choose Know Sure Thing under Oscillators. To change it, copy the source below into the AlphaScript editor.

Inputs ​

InputTypeDefault
ROC length #1int10
ROC length #2int15
ROC length #3int20
ROC length #4int30
SMA length #1int10
SMA length #2int10
SMA length #3int10
SMA length #4int15
Signal line lengthint9
KST colorcolor"#089981"
Signal colorcolor"#F23645"

Source ​

From packages/alphascript/indicators/kst.as.js.

js
indicator({ name: "Know Sure Thing", shortTitle: "KST", overlay: false, precision: 4 });
const roc1 = input.int("ROC length #1", 10, { min: 1 }), roc2 = input.int("ROC length #2", 15, { min: 1 });
const roc3 = input.int("ROC length #3", 20, { min: 1 }), roc4 = input.int("ROC length #4", 30, { min: 1 });
const sma1 = input.int("SMA length #1", 10, { min: 1 }), sma2 = input.int("SMA length #2", 10, { min: 1 });
const sma3 = input.int("SMA length #3", 10, { min: 1 }), sma4 = input.int("SMA length #4", 15, { min: 1 });
const signalLength = input.int("Signal line length", 9, { min: 1 });
const c = candle.close;
const kst = ta.calc([ta.sma(ta.roc(c, roc1), sma1), ta.sma(ta.roc(c, roc2), sma2), ta.sma(ta.roc(c, roc3), sma3), ta.sma(ta.roc(c, roc4), sma4)],
  (a, b, d, e) => a + 2 * b + 3 * d + 4 * e);
plot(kst, { title: "KST", color: input.color("KST color", "#089981", { group: "Style" }) });
plot(ta.sma(kst, signalLength), { title: "Signal", color: input.color("Signal color", "#F23645", { group: "Style" }) });
hline(0, { title: "Zero", color: "rgba(120,123,134,0.5)", style: "dashed" });

AlphaScript language v0.1 · runtime 0.2.0