Params
Vars
Series<Bool> ZT10; //10%
Series<Bool> ZT20; //20%
Series<Bool> ZTB; //涨停板
Series<Bool> HHC; //高=收
Series< Bool > pickcond;
Series< Bool >XG;
Events
OnBar(ArrayRef<Integer> indexs)
{
Integer i = 0 ;
Range[i=0:datacount-1]
{
String pickinfo;
If(!GetBarVar("截面",pickinfo))pickinfo="否";
If(PICKINFO == "是")
{
pickcond = IsAllPickCondition();
}
}
//计算涨跌停价格
Numeric dest = Value(Left(symbol , 2));
HHC = Close==High;
If(dest == 00 OR dest == 60)
{
ZT10 = (Close - Close[1]) / Close[1]>=0.095 And HHC;
}
If(dest == 30 OR dest == 68)
{
ZT20 = (Close - Close[1]) / Close[1]>=0.195 And HHC;
}
ZTB = ZT10 OR ZT20;
If(NthCon(ZTB)<=10)
{
plotauto("涨停",Close,Open,Red,Enum_BAR,Enum_Fill,Enum_1Pix);//画出K线
SetPickCondition();//条件选股
}
}
//问1: 用,If(ZTB) ,选出涨停股,截面指定日期,选出为 空,原因是什么?
//问2:If(NthCon(ZTB)<=10,如果要选过去N天内所有的涨停股,这里的10调整为参数,要怎么修改?
//问3: 不复权选出来的个股在选股结果内的开盘价好像不正确,要如何设置?如下图
不复权选出来的个股在选股结果内的开盘价好像不正确,要如何设置?如下图
你确定你是没复权?我没复权跑出来的价格是正确的
肯定,一定,确定,试验多次。所以想找原因。
我这里也是多次重选都是正常的。
请完整的录制选股的全过程,把视频发给邮箱404851506@qq.com
我会转发给开发人员处理
邮件已经回了,你如果有好好地检查每个板块的设置,这就不是问题。
If(NthCon(ZTB)<=10,如果要选过去N天内所有的涨停股,这里的10调整为参数,要怎么修改?
nthcon函数,回溯10天范围内能找到
问1: 用,If(ZTB) ,选出涨停股,截面指定日期,选出为 空,原因是什么?
你的选股公式有问题
这是官网的选股案例,要用range把判断代码包起来
但是你的代码明显没有
这是用range包起来以后的测试结果
包起来是怎么样的,明示行吗,借鉴一次,下次没这类问题
Params
Vars
Series<Bool> ZT10; //10%
Series<Bool> ZT20; //20%
Series<Bool> ZTB; //涨停板
Series<Bool> HHC; //高=收
Series< Bool > pickcond;
Series< Bool >XG;
Events
OnBar(ArrayRef<Integer> indexs)
{
Integer i = 0 ;
Range[i=0:datacount-1]
{
String pickinfo;
If(!GetBarVar("截面",pickinfo))pickinfo="否";
If(PICKINFO == "是")
{
pickcond = IsAllPickCondition();
}
}
//计算涨跌停价格
Numeric dest = Value(Left(symbol , 2));
HHC = Close==High;
If(dest == 00 OR dest == 60)
{
ZT10 = (Close - Close[1]) / Close[1]>=0.095 And HHC;
}
If(dest == 30 OR dest == 68)
{
ZT20 = (Close - Close[1]) / Close[1]>=0.195 And HHC;
}
ZTB = ZT10 OR ZT20;
If(NthCon(ZTB)<=10)
{
plotauto("涨停",Close,Open,Red,Enum_BAR,Enum_Fill,Enum_1Pix);//画出K线
SetPickCondition();//条件选股
}
}
示例代码里不是有吗....就三行也看不明白吗