線性回歸函數畫線為什么不能用?
作者:開拓者 TB 來源:cxh99.com 發布時間:2020年11月23日
-
咨詢內容:
Vars
Numeric Length2(2);
Numeric Length3(3);
NumericSeries x2;
NumericSeries x3;
? ? ? ?
Begin
x2 = LinearReg(Close,Length2);
x3 = LinearReg(Close,Length3);
PlotNumeric("X2",x2);
PlotNumeric("X3",x3);
end
編譯時出現錯誤提示:
被調用函數的引用參數不能使用默認值。
這是什么原因?如何解決?
?
?來源:CXH99.COM
-
TB技術人員:
因為LinearReg()的返回值是Bool變量。
Bool LinearReg(NumericSeries Price,Numeric Length,Numeric TgtBar,NumericRef LRSlope,NumericRef LRAngle,NumericRef LRIntercept,NumericRef LRValue)
可以通過后四個變量取得需要的數值。