Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
- // © JokoAji
- //@version=4
- study("KST", overlay = false)
- a1 = 10//input(10, title="Period Rate-of-Change 1")
- b1 = 15//input(15, title="Period Rate-of-Change 2")
- c1 = 20//input(20, title="Period Rate-of-Change 3")
- d1 = 30//input(30, title="Period Rate-of-Change 4")
- e1 = 10//input(10, title="Period SMA 1")
- f1 = 10//input(10, title="Period SMA 2")
- g1 = 10//input(10, title="Period SMA 3")
- h1 = 15//input(15, title="Period SMA 4")
- i1 = 9//input(9, title="KST Signal SMA Period")
- difftime = input(true, title="Show Time Frame 1 ?")
- res1 = input(title="Different Timeframe :", type=input.resolution, defval="")
- diftime = input(true, title="Show Time Frame 2 ?")
- res2 = input(title="Different Timeframe :", type=input.resolution, defval="5")
- a2 = 10//input(10, title="MTF Period Rate-of-Change 1")
- b2 = 15//input(15, title="MTF Period Rate-of-Change 2")
- c2 = 20//input(20, title="MTF Period Rate-of-Change 3")
- d2 = 30//input(30, title="MTF Period Rate-of-Change 4")
- e2 = 10//input(10, title="MTF Period SMA 1")
- f2 = 10//input(10, title="MTF Period SMA 2")
- g2 = 10//input(10, title="MTF Period SMA 3")
- h2 = 15//input(15, title="MTF Period SMA 4")
- i2 = 9//input(9, title="MTF KST Signal SMA Period")
- //backcol = input(true, title="Show Background Color Current Timeframe ?")
- //backcol2 = input(true, title="Show Background Color Different Timeframe ?")
- roc1 = sma(roc(close, a1), e1)
- roc2 = sma(roc(close, b1), f1)
- roc3 = sma(roc(close, c1), g1)
- roc4 = sma(roc(close, d1), h1)
- KST = roc1 + (roc2*2) + (roc3*3) + (roc4*4)
- KSTSignal = sma(KST, i1)
- KST_MTF_1 = difftime ? security(syminfo.tickerid, res1, KST) : na
- KSTSignal_MTF_1 = difftime ? security(syminfo.tickerid, res1, KSTSignal) : na
- roc5 = sma(roc(close, a2), e2)
- roc6 = sma(roc(close, b2), f2)
- roc7 = sma(roc(close, c2), g2)
- roc8 = sma(roc(close, d2), h2)
- KST2 = roc5 + (roc6*2) + (roc7*3) + (roc8*4)
- KSTSignal2 = sma(KST2, i2)
- KST_MTF = diftime ? security(syminfo.tickerid, res2, KST2) : na
- KSTSignal_MTF = diftime ? security(syminfo.tickerid, res2, KSTSignal2) : na
- plot(KST_MTF_1, style = plot.style_line, linewidth = 1, color=color.lime, title="KST")
- plot(KSTSignal_MTF_1, style = plot.style_line, linewidth = 1, color=color.red, title="KST Signal")
- plot(KST_MTF, style = plot.style_line, linewidth = 1, color=color.lime, title="KST Different TimeFrame")
- plot(KSTSignal_MTF, style = plot.style_line, linewidth = 1, color=color.red, title="KST Signal Different TimeFrame")
- hline(0)
- //test1 = (KST >= KSTSignal) ? lime : na
- test2 = (KST_MTF >= KSTSignal_MTF) ? color.lime : color.red
- //bgcolor(test1, transp=90)
- bgcolor(test2, transp=90)
Advertisement
Add Comment
Please, Sign In to add comment