设为首页收藏本站

 找回密码
 注册
查看: 917|回复: 1
打印 上一主题 下一主题

线性回归函数画线为什么不能用? [复制链接]

Rank: 1

精华
0
UID
115519
积分
41
帖子
19
主题
11
阅读权限
10
注册时间
2013-2-13
最后登录
2020-5-22
跳转到指定楼层
1#
发表于 2020-5-17 23:12:34 |只看该作者 |倒序浏览
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

编译时出现错误提示:
被调用函数的引用参数不能使用默认值。


这是什么原因?如何解决?

Rank: 4

精华
0
UID
110114
积分
380
帖子
314
主题
16
阅读权限
50
注册时间
2012-4-20
最后登录
2021-12-29
2#
发表于 2020-5-18 09:37:12 |只看该作者
因为LinearReg()的返回值是Bool变量。
Bool LinearReg(NumericSeries Price,Numeric Length,Numeric TgtBar,NumericRef LRSlope,NumericRef LRAngle,NumericRef LRIntercept,NumericRef LRValue)
可以通过后四个变量取得需要的数值。

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

bottom

静态版|手机版|联系我们|交易开拓者 ( 粤ICP备07044698   

GMT+8, 2024-5-4 07:49

Powered by Discuz! X2 LicensedChrome插件扩展

© 2011-2012 交易开拓者 Inc.

回顶部