Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //ASI///////////
- limit = input.float(title="Value", defval=10000, group = "ASI Settings")
- getSI(limit) =>
- H_C1 = math.abs(high - close[1])
- L_C1 = math.abs(low - close[1])
- H_L = math.abs(high - low)
- C1_O1 = math.abs(close[1] - open[1])
- K = math.max(H_C1, L_C1)
- R = H_C1 >= math.max(L_C1, H_L) ? H_C1 - 0.5 * L_C1 + 0.25 * C1_O1 : L_C1 >= math.max(H_C1, H_L) ? L_C1 - 0.5 * H_C1 + 0.25 * C1_O1 : H_L + 0.25 * C1_O1
- result = 50 * ((close - close[1] + 0.5 * (close - open) + 0.25 * (close[1] - open[1])) / R) * K / limit
- result
- asi = ta.cum(getSI(limit))
- asiLong = asi > asi[1] and asi[1] > asi[2] and asi[2] > asi[3]
- asiShort = asi < asi[1] and asi[1] < asi[2] and asi[2] < asi[3]
Add Comment
Please, Sign In to add comment