Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Gunzo Sniper
- int ma_length = input.int(54, title="Gunzo Length", minval=1,group= "Gunzo")
- fn_calculate_wma_with_coefficient(source, length, coefficient) =>
- candle_weighted_sum = 0.0
- total_weight = 0.0
- for i = 0 to length-1
- candle_weight = (length - i)
- candle_weighted_sum := candle_weighted_sum + ((candle_weight - coefficient) * source[i])
- total_weight := total_weight + (candle_weight - coefficient)
- gunzo_line = candle_weighted_sum / total_weight
- gunzo_line
- coefficient = ma_length / 3.0
- gunzo_line = fn_calculate_wma_with_coefficient(close, ma_length, coefficient)
- gunzolong = close > gunzo_line
- gunzoshort = close < gunzo_line
Advertisement
Add Comment
Please, Sign In to add comment