根本运行不了Average1函数脚本,帮助文档有问题
https://tbq.tbquant.net/helper?product_id=999&keyword=440&content_id=262&type=article#3%E3%80%81%E5%87%BD%E6%95%B0%E7%9A%84%E7%BC%96%E5%86%99 3)点击工具栏的编译公式按钮编译保存当前函数。Average1函数脚本如下:Params Series<Numeric> Price(1); Numeric Length(10); Vars Numeric AvgValue; Events OnBar(ArrayRef<Integer> indexs) { AvgValue = Summation(Price, Length) / Length; Return AvgValue; } 本例只有一个返回值,即最后求得的平均值,在函数中直接使用Return 语句返回即可。