如何计算从当前柱线范围到最后 50 根柱线的平均交易量

How to calculate average volume from range of current bar to last 50 bars

是否可以为 calc_avg_volume = math.avg(volume, volume[1], volume[2], ... volume[50]) 编写更短的代码?

您可以使用 ta.sma()

avg = ta.sma(vol, 50)