OptionsComplex返回值oOptPrice可以在Commentary取到,plot划线失败
Vars Global Integer id(0); Global Bool subFlag(False);Events OnReady() { if(!subFlag) { id = SubscribeBar(RelativeSymbol, "1d", BeginDateTime); subFlag = True; } } OnBar(ArrayRef<Integer> indexs) { Numeric volty = Volatility(data[id].Close); Numeric oOptPrice(0); Numeric oDelta(0); Numeric oGamma(0); Numeric oVega(0); Numeric oTheta(0); Numeric oRho(0); Numeric ret = OptionsComplex(1, TradingDayLeft, StrikePrice, data[id].Close, 5, 0, 0, volty, OptionType, OptionStyle, oOptPrice, oDelta, oGamma, oVega, oTheta, oRho); //Print("OptionsComplex:" + Text(ret) + ",oOptPrice:" + Text(oOptPrice) + ",oDelta:" + Text(oDelta) + ",oGamma:" + Text(oGamma) + ",oVega:" + Text(oVega) + ",oTheta:" + Text(oTheta) + ",oRho:" + Text(oRho)); Commentary("oOptPrice"+Text(oOptPrice)); PlotNumeric("oOptPrice",oOptPrice); }