数组应用
tbquant在编写下面语言的过程中,alpha本身想求的数组myalpha的平均值,但是显示只显示第一个图标的值 Params Numeric length(20); Vars Array<Numeric> MyAlpha(0); Global Numeric Alpha; Numeric i; Events OnBar(ArrayRef<Integer> indexs) { Range[0:DataCount-1] { MyAlpha[i]=Average(Abs(Close[1]-Open[1]),length)/Average(High[1]-Low[1],length); } Alpha=AverageArray(MyAlpha); Range[0:DataCount-1] { Commentary("Alpha="+Text(Alpha)); Commentary("MyAlpha="+Text(MyAlpha[i])); } }