Login Page - Create Account

Support Board


Date/Time: Sat, 20 Apr 2024 02:47:44 +0000



Post From: Ackin's indicators (SCH users requests for studies) - Update list

[2022-04-27 18:30:35]
User628616 - Posts: 132
I have the TTM Scalper writing, I just don't know how to create a study with it for sierra chart. Heres the writing:

study(title="TTM scalper indicator", overlay = true)
width = input(2, minval=1)
triggerSell = iff(iff(close[1] < close,1,0) and (close[2] < close[1] or close[3] <close[1]),1,0)
triggerBuy = iff(iff(close[1] > close,1,0) and (close[2] > close[1] or close[3] > close[1]),1,0)
buySellSwitch = iff(triggerSell, 1, iff(triggerBuy, 0, nz(buySellSwitch[1])))
SBS = iff(triggerSell and buySellSwitch[1] == false, high, iff(triggerBuy and buySellSwitch[1], low, nz(SBS[1])))
clr_s = iff(triggerSell and buySellSwitch[1] == false, 1, iff(triggerBuy and buySellSwitch[1], 0, nz(clr_s[1])))
clr = iff(clr_s == 0 , green , red)
plot(SBS, color=clr, title="TTM", style = circles, linewidth = width)