• <em id="n4cqa"><acronym id="n4cqa"></acronym></em>

    <tbody id="n4cqa"></tbody>

    <tbody id="n4cqa"></tbody>

      <progress id="n4cqa"><track id="n4cqa"><video id="n4cqa"></video></track></progress>
      您現在的位置:程序化交易>> 期貨公式>> 交易開拓者(TB)>> 開拓者公式>>正文內容

      開拓者trad交易模型源碼[開拓者公式]

      • 源碼內容:


        //------------------------------------------------------------------------
        // 簡稱: t_trad
        // 名稱:
        // 類別: 公式應用
        // 類型: 用戶應用
        // 輸出:
        //------------------------------------------------------------------------


        Vars
            Numeric cnt;
                Numeric llon;
                Numeric starttime;
                Numeric price;
              //程序化交易 www.miao-tiao.com
        Begin
            /*
                GlobalVar(1) llon
                GlobalVar(3) starttime
                */
            llon=GetGlobalVar(1);
              
            If(llon==InvalidNumeric)
                {
                    llon=0;
                        SetGlobalVar(1,llon);
                        starttime=Date+time;
                        SetGlobalVar(3,starttime);
                        FileAppend("E:\\TB\\t_trad.txt","llon="+Text(llon));
                }
                FileAppend("E:\\TB\\time.txt","starttime="+DateTimeToString(GetGlobalVar(3))+"  time="+DateTimeToString(date+time));
                If(llon == 0 && A_GetOpenOrderCount()==0)
                {
                    price=open;
                        A_SendOrder(Enum_Buy,Enum_Entry,1,price);              
                        FileAppend("E:\\TB\\t_trad.txt","llon="+Text(llon));
                        FileAppend("E:\\TB\\t_trad.txt","Datetime= "+DateTimeToString(Date+time)+" Open= "+Text(Open)+" High= "+Text(High)
                        +" Low= "+Text(Low)+" Close="+Text(Close)+" CurrentBar= "+Text(CurrentBar)+" Barstatus= "+Text(BarStatus));
                        FileAppend("E:\\TB\\t_trad.txt","賬號 "+A_AccountID()+" 合同號 "+A_OrderContractNo(0)+" 商品 IF1303"+" 多開倉"
                        +" 數量 "+Text(A_OrderLot(0))+" 狀態 "+Text(A_OrderStatus(0))+" 委托價格 "+Text(A_OrderPrice(0))
                        +" 委托時間 "+DateTimeToString(A_OrderTime(0))+ "平開倉狀態 "+Text(A_OrderEntryOrExit(0)));              
                }
              
              
                If(llon>0)
                {
                    price=open;
                        A_SendOrder(Enum_Buy,Enum_Exit,1,price);              
                        FileAppend("E:\\TB\\t_trad.txt","llon="+Text(llon));
                        FileAppend("E:\\TB\\t_trad.txt","Datetime= "+DateTimeToString(Date+time)+" Open= "+Text(Open)+" High= "+Text(High)
                        +" Low= "+Text(Low)+" Close="+Text(Close)+" CurrentBar= "+Text(CurrentBar)+" Barstatus= "+Text(BarStatus));
                        FileAppend("E:\\TB\\t_trad.txt","賬號 "+A_AccountID()+" 合同號 "+A_OrderContractNo(0)+" 商品 IF1303"+" 多開平"
                        +" 數量 "+Text(A_OrderLot(0))+" 狀態 "+Text(A_OrderStatus(0))+" 委托價格 "+Text(A_OrderPrice(0))
                        +" 委托時間 "+DateTimeToString(A_OrderTime(0))+ "平開倉狀態 "+Text(A_OrderEntryOrExit(0)));      
                }// www.miao-tiao.com
              
                If(A_OrderFilledLot(0)<>0)
                {
                    llon=llon+A_OrderFilledLot(0);
                        SetGlobalVar(1,llon);
                        FileAppend("E:\\TB\\t_trad.txt","llon="+Text(llon));
                        FileAppend("E:\\TB\\t_trad.txt","Datetime= "+DateTimeToString(Date+time)+" Open= "+Text(Open)+" High= "+Text(High)
                        +" Low= "+Text(Low)+" Close="+Text(Close)+" CurrentBar= "+Text(CurrentBar)+" Barstatus= "+Text(BarStatus));
                        FileAppend("E:\\TB\\t_trad.txt","賬號 "+A_AccountID()+" 合同號 "+A_OrderContractNo(0)+" 商品 IF1303"+" 多開倉"
                        +" 數量 "+Text(A_OrderLot(0))+" 狀態 "+Text(A_OrderStatus(0))+" 委托價格 "+Text(A_OrderPrice(0))
                        +" 委托時間 "+DateTimeToString(A_OrderTime(0))+" 成交數量 "+Text(A_OrderFilledLot(0))
                        +" 成交價格 "+Text(A_OrderFilledPrice(0))+" 滑價 "+Text(A_OrderFilledPrice(0)-A_OrderPrice(0))
                        +" 獲利 "+Text(A_PositionProfitLoss()));
                }

        End


        //------------------------------------------------------------------------
        // 編譯版本        GS2010.12.08
        // 用戶版本        www.miao-tiao.com
        // 版權所有        wumujusha
        // 更改聲明        TradeBlazer Software保留對TradeBlazer平臺
        //                        每一版本的TrabeBlazer公式修改和重寫的權利
        //------------------------------------------------------------------------


         

       

      有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友

      可聯系技術人員 QQ: 262069696  點擊在線交流進行 有償 編寫!不貴!點擊查看價格!

       


      【字體: 】【打印文章】【查看評論

      相關文章

        沒有相關內容
        国产高潮流白浆免费观看
    1. <em id="n4cqa"><acronym id="n4cqa"></acronym></em>

      <tbody id="n4cqa"></tbody>

      <tbody id="n4cqa"></tbody>

        <progress id="n4cqa"><track id="n4cqa"><video id="n4cqa"></video></track></progress>