请教为何图上可以看到信号但是不开仓呢
Params Numeric TradeVol(1); // 交易手数 Vars Bar mybar; //Vars区域声明bar结构体 series<Numeric> Highs; //存储K线最高价 series<Numeric> Lows; //存储K线最低价 series<Numeric> Opens; //存储K线开盘价 series<Numeric> Closes; //存储K线收盘价 series<Numeric> Atime; //存储K线开盘时间 series<Integer> current_barth;//当前bar的索引值 Events // 初始化事件函数 OnInit() { } // Bar更新事件函数 OnBar(ArrayRef<Integer> indexs) { // Bar数据存储-----------------上 ----------------------- GetBar(mybar, 0); //; getbar获取bar结构体数据 Highs = data0.mybar.high; // 把bar数据赋值 Lows = data0.mybar.low; // 把bar数据赋值 Opens = data0.mybar.open; // 把bar数据赋值 Closes = data0.mybar.close; // 把bar数据赋值 Atime = data0.mybar.datetime; // 把bar数据赋值 //Commentary("Highs="+text(Highs)); //输出到bar上看看 //Commentary("Lows="+text(Lows)); //输出到bar上看看 //Commentary("Atime="+text(Atime)); //输出到bar上看看 current_barth = CurrentBar();//计算当前bar的索引值 //print("当前Bar索引:"+Text(CurrentBar())); //print("current_barth:"+Text(current_barth)); Commentary("-----------当前Bar索引----------"); Commentary("当前Bar索引:" + Text(CurrentBar())); /*commentary("current_barth:" + text(current_barth));*/ // Bar数据存储-----------------下 ----------------------- if(BarStatus!=2) { if(closes[1] > opens[1]) { Buy(TradeVol, close + 5 * MinMove); } Else { SellShort(TradeVol, close - 5 * MinMove); } } }