getprice 和price在期权中不能取数,如下,可以取到is,不能取到c,用getprice,也是一样的结果。
Data
datafm1809:"m1809";
datam1809c3050:"m1809-c-3050";
Vars
numeric is;
NumericSeries c;
Begin
ls=datafm1809.Price("new");
c=datam1809c3050.Price("new");
PlotNumeric("测试",Is);
PlotNumeric("测试1",c);
End
数据区的改为C大写就可以,参考:
Data
datafm1809:"m1809";
datam1809c3050:"m1809-C-3050";
Vars
numeric is;
NumericSeries c;
Begin
is=datafm1809.Price("new");
c=datam1809c3050.Price("new");
PlotNumeric("测试",is);
PlotNumeric("测试1",c);
End
以下代码,为什么要很求才能有计算结果显示?
Data
datafm1809:"m1809";
datam1809c3050:"m1809-c-3050";
Vars
numeric is;
NumericSeries c;
Begin
ls=datafm1809.Price("new");
c=datam1809c3050.Price("new");
PlotNumeric("测试",Is);
PlotNumeric("测试1",c);
End
您的指标是输出合约的最新价,
Price是实时返回最新价的,不能使用于历史测试,仅适用于实时行情交易
所以只有盘中换线时才会有返回值的,您了解下
