Guest User

Untitled

a guest
Feb 17th, 2024
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. // Gunzo Sniper
  2. int ma_length = input.int(54, title="Gunzo Length", minval=1,group= "Gunzo")
  3. fn_calculate_wma_with_coefficient(source, length, coefficient) =>
  4. candle_weighted_sum = 0.0
  5. total_weight = 0.0
  6. for i = 0 to length-1
  7. candle_weight = (length - i)
  8. candle_weighted_sum := candle_weighted_sum + ((candle_weight - coefficient) * source[i])
  9. total_weight := total_weight + (candle_weight - coefficient)
  10. gunzo_line = candle_weighted_sum / total_weight
  11. gunzo_line
  12.  
  13. coefficient = ma_length / 3.0
  14. gunzo_line = fn_calculate_wma_with_coefficient(close, ma_length, coefficient)
  15. gunzolong = close > gunzo_line
  16. gunzoshort = close < gunzo_line
Advertisement
Add Comment
Please, Sign In to add comment