danucante

Untitled

Nov 15th, 2023
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. //ASI///////////
  2. limit = input.float(title="Value", defval=10000, group = "ASI Settings")
  3.  
  4. getSI(limit) =>
  5. H_C1 = math.abs(high - close[1])
  6. L_C1 = math.abs(low - close[1])
  7. H_L = math.abs(high - low)
  8. C1_O1 = math.abs(close[1] - open[1])
  9. K = math.max(H_C1, L_C1)
  10. 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
  11. result = 50 * ((close - close[1] + 0.5 * (close - open) + 0.25 * (close[1] - open[1])) / R) * K / limit
  12. result
  13.  
  14.  
  15. asi = ta.cum(getSI(limit))
  16.  
  17. asiLong = asi > asi[1] and asi[1] > asi[2] and asi[2] > asi[3]
  18. asiShort = asi < asi[1] and asi[1] < asi[2] and asi[2] < asi[3]
  19.  
  20.  
  21.  
Add Comment
Please, Sign In to add comment