用TB_SettlePrice获取结算价,得到的结果始终是0,怎么回事,谁有示例代码,我参数一下
我的代码如下:
Vars
Dic<Array<Numeric>> mysettleprice(\"TB_SettlePrice\"); //结算价
Dic<Array<Numeric>> mypricelimit(\"TB_PriceLimit\"); //停板比例
Series<Numeric> myuplimit; //涨停价
Series<Numeric> mydnlimit; //跌停价
OnBar(ArrayRef<Integer> indexs)
{
.........................................
//计算涨跌停价格
If(ExchangeCode==\"CZCE\")
{
myuplimit=RoundUp(mysettleprice[0][0]*(1+0.01*mypricelimit[0][0])/MinPoint,0)*MinPoint;
mydnlimit=RoundDown(mysettleprice[0][0]*(1-0.01*mypricelimit[0][0])/MinPoint,0)*MinPoint;
}Else If(ExchangeCode==\"DCE\")
{
myuplimit=RoundDown(mysettleprice[0][0]*(1+0.01*mypricelimit[0][0])/MinPoint,0)*MinPoint;
mydnlimit=RoundUp(mysettleprice[0][0]*(1-0.01*mypricelimit[0][0])/MinPoint,0)*MinPoint;
}Else If(ExchangeCode==\"SHFE\" or ExchangeCode==\"INE\")
{
myuplimit=RoundDown(mysettleprice[0][0]*(1+0.01*mypricelimit[0][0])/MinPoint,0)*MinPoint;
mydnlimit=RoundDown(mysettleprice[0][0]*(1-0.01*mypricelimit[0][0])/MinPoint,0)*MinPoint;
}Else If(ExchangeCode==\"CFFEX\")
{
myuplimit=RoundDown(mysettleprice[0][0]*(1+0.01*mypricelimit[0][0])/MinPoint,0)*MinPoint;
mydnlimit=RoundUp(mysettleprice[0][0]*(1-0.01*mypricelimit[0][0])/MinPoint,0)*MinPoint;
}
Commentary(\"myuplimit:\"+Text(myuplimit));
}
最后输出的myuplimit一直是0是怎么回事呢
这个在指数上面不支持吗
看看合约是不是连续