开拓者trad交易模型源码-开拓者公式 -程序化交易(grahamobil.com) - 365bet送体验金
您现在的位置:程序化交易>> 期货公式>> 交易开拓者(TB)>> 开拓者公式>>正文内容

365bet送体验金

  • 源码内容:


    //------------------------------------------------------------------------
    // 简称: t_trad
    // 名称:
    // 类别: 公式应用
    // 类型: 用户应用
    // 输出:
    //------------------------------------------------------------------------


    Vars
        Numeric cnt;
            Numeric llon;
            Numeric starttime;
            Numeric price;
          //程序化交易 www.cxh99.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.cxh99.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.grahamobil.com
    // 版权所有        wumujusha
    // 更改声明        TradeBlazer Software保留对TradeBlazer平台
    //                        每一版本的TrabeBlazer公式修改和重写的权利
    //------------------------------------------------------------------------


     

 

有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友

可联系技术人员 QQ: 262069696  点击在线交流进行 有偿 编写!不贵!点击查看价格!

 


【字体: 】【打印文章】【查看评论

相关文章

    没有相关内容