套利策略指标中,显示错误,代码问题在哪里了呢?

下图方框中的时间区域,不需要输出线型,空白就好。代码中写了需要输出的月份,但为何没不需要输出的月份,总是显示出来呢?请帮忙看一下代码问题在哪里?

Params
    //此处添加参数

Vars
    //此处添加变量
    Numeric spr;//价差
    
Events
    //此处实现事件函数

    //Bar更新事件函数,参数indexs表示变化的数据源图层ID数组
    OnBar(ArrayRef<Integer> indexs)
    {
        spr = Data0.Close - Data1.Close;
        If(month >=6 and month <=12);
        {
            PlotNumeric("spread",spr);
        }
        if (month >=6 And MarketPosition==0)
        {
            data0.Buy(1,close);
            data1.SellShort(1,Close);
        }
        if(Month == 1 And MarketPosition>0)
        {
            data0.Sell(0,close);
            data1.BuyToCover(1,Close);
        }
        
    }

评论区
顶部