大括号不匹配是哪里问题


/*策略设计说明----初始需求_20250326
    转指标:
N:=14;
M:=3;
TR1:=MAX(MAX((HIGH-LOW),ABS(REF(CLOSE,1)-HIGH)),ABS(REF(CLOSE,1)-LOW));
UP:=(H+L)/2+MA(TR1,N)*M;
DN:=(H+L)/2-MA(TR1,N)*M;
L1:=REF(UP,BARSLAST(UP<=REF(UP,1)));
L2:=LLV(UP,N*1.5);
LL:=IF(L2<>REF(L2,1) AND L1<REF(L1,1),L1,IF(L1=L2,L1,L2));
S1:=BARSLAST(CROSS(0.5,UP=LL))+1;
S2:=CROSS(COUNT((CROSS(C,LL) OR CROSS(C,REF(LL,2))) AND UP>LL,S1),0.5);
A6:=BARSLAST(S2);
B6:=BARSLAST(CROSS(HHV(DN,A6+1),C));
BY:=CROSS(B6,A6);
SL:=CROSS(A6,B6);
SUPERTREN:IF(B6>A6,NULL,LLV(UP,BARSLAST(SL)+1)),COLORGREEN;
IF(B6>A6,HHV(DN,BARSLAST(BY)+1),NULL),COLORRED,;



    用这指标写策略
*/


Params
    Numeric Lots(1); //版本:V1.0----手数
    
Vars
    Global Numeric jump;  //每跳多少元
    Global String tmpMSyms2; //当前的真实主力合约
    Series<Bool> cond_b; //开仓条件
    
Events
    OnInit()
    {
        print("----start_main--" + "Symbol:" + Symbol());
    
        if(1 == 1)
        {
            AddDataFlag(Enum_Data_RolloverBackWard());//设置后复权
            AddDataFlag(Enum_Data_RolloverRealPrice());//映射真实价格。
        }
    
        //当前的真实主力合约
        Array<String>  tmpMSyms; //映射集合
    
        if(GetOrderMapRelatedSymbols(tmpMSyms))
        {
            Integer i3;
    
            for i3 = 0 to GetArraySize(tmpMSyms) - 1
            {
                if(!(FindFirstOf(tmpMSyms[i3], "888") == 2  or FindFirstOf(tmpMSyms[i3], "000") == 2 or FindFirstOf(tmpMSyms[i3], "999") <= 2) and tmpMSyms[i3] != "")
                {
                    tmpMSyms2 = tmpMSyms[i3];
                    print("当前真实主力合约:" + tmpMSyms2);
                    break;
                }
            }
        }
        Else
        {
            tmpMSyms2 = symbol;
            print("当前真实主力合约:" + tmpMSyms2);
        }
    
        jump = MinMove() * PriceScale(); //每跳多少元
    
    }
    
    OnBar(ArrayRef<Integer> indexs)
    {
        //原麦语言指标---------------以下
        Numeric N:=14;
        Numeric M:=3;
        Numeric TR1:=MAX(MAX((HIGH-LOW),ABS(REF(CLOSE,1)-HIGH)),ABS(REF(CLOSE,1)-LOW));
        Numeric UP:=(H+L)/2+MA(TR1,N)*M;
        Numeric DN:=(H+L)/2-MA(TR1,N)*M;
        Numeric L1:=REF(UP,BARSLAST(UP<=REF(UP,1)));
        Numeric L2:=LLV(UP,N*1.5);
        Numeric LL:=IF(L2<>REF(L2,1) AND L1<REF(L1,1),L1,IF(L1=L2,L1,L2));
        Numeric S1:=BARSLAST(CROSS(0.5,UP=LL))+1;
        Numeric S2:=CROSS(COUNT((CROSS(C,LL) OR CROSS(C,REF(LL,2))) AND UP>LL,S1),0.5);
        Numeric A6:=BARSLAST(S2);
        Numeric B6:=BARSLAST(CROSS(HHV(DN,A6+1),C));
        Numeric BY:=CROSS(B6,A6);
        Numeric SL:=CROSS(A6,B6);
        life1 =IF(B6>A6,NULL,XAverage(UP,XAverage(SL)+1));
        life2 =IF(B6>A6,XAverage(DN,BARSLAST(BY)+1),NULL);
    
        {
            PlotNumeric("life1", life1, life1, Green);  //多
            cond_b = true;
        }
        else
        {
            PlotNumeric("life2", life2,life2, Red);  //空

            cond_b = false;
        }
    
        Commentary("life1: " + text(life));
    
        if(!cond_b[1] and cond_b)
        {
            PlotString("多", "多", H * );
        }

        Commentary("life2: " + text(life));

        Else if(cond_b[1] and !cond_b)
        {
            PlotString("空", "空", L);
        }
    
        //原麦语言指标---------------以上
    
    
        //开平仓------------------以下
        if(MarketPosition <> 1 and cond_b[2] and !cond_b[1])
        {
            buy(Lots, O);
            Commentary("开多或反手做多");
        }
        else if(MarketPosition <> -1 and !cond_b[2] and cond_b[1])
        {
            SellShort(Lots, O);
            Commentary("开空或反手做空");
        }
    
        //开平仓------------------以上
    
        //最后输出相关信息
        Commentary("当前Bar序号:" + text(CurrentBar));
        Commentary("1跳1手是多少点:" + text(jump));
        Commentary("1点1手是多少元:" + text(ContractUnit * BigPointValue));
        Commentary("浮动盈亏(以当根K线收盘价算出):" + text(PositionProfit));
        Commentary("平均建仓价(后复权):" + text(AvgEntryPrice));
        Commentary("平均建仓价(不复权):" + text(AvgEntryPrice / rollover));
        Commentary("持仓手数(多):" + text(longCurrentContracts));
        Commentary("持仓手数(空):" + text(shortCurrentContracts));
    
    }


大括号不匹配是哪里问题
大括号不匹配
显示大括号不匹配一直找不到原因
为什么会显示 小括号不匹配?
严重问题TBQ多图层信号,显示和持仓显示不匹配!
帐户净仓与信号净仓数量明显不匹配
当出现持仓与信号不匹配的情况,如何及时获知
为啥报错了 没看懂 小括号不匹配
54行显示小括号不匹配
持仓与信号不匹配,时可否跳出警示窗口

你这里写的TBL的代码块,但不是TBL语言



可以帮我改一下吗?

你这个内容太多,且没有任何说明

参考代写指南

https://bbs.tbquant.net/thread/20241205162315158864