大伊人青草狠狠久久-大伊香蕉精品视频在线-大伊香蕉精品一区视频在线-大伊香蕉在线精品不卡视频-大伊香蕉在线精品视频75-大伊香蕉在线精品视频人碰人

您現(xiàn)在的位置:程序化交易>> 期貨公式>> 交易開(kāi)拓者(TB)>> 開(kāi)拓者知識(shí)>>正文內(nèi)容

開(kāi)拓者突破型日內(nèi)交易策略源碼 [開(kāi)拓者 TB]

  • 源碼:


    Params   
            Numeric endTime(14.55);                    //結(jié)束交易時(shí)間
           Numeric RiskRatio(1);                       //風(fēng)險(xiǎn)率(0-100)
           Numeric boLength(18);                       //突破周期
           Numeric ATRLength(20);                      //平均波動(dòng)周期
            Numeric Quitlength(10);                     //離市周期
            Numeric weightnumber(1);                    //加權(quán)參數(shù)
            Numeric Limitednumber(3);                   //交易限制次數(shù)(能交易的次數(shù)為limitednumber+1次)
        Bool Filtercondition(True);                 //入市過(guò)濾條件
    Vars
        Numeric Minpoint;                           //最小變動(dòng)單位
            NumericSeries AvgTR;                        //ATR
            Numeric F;                                  //表示市場(chǎng)波動(dòng)性的F值
            Numeric Capital;                            //入市資本
            Numeric scale;                              //買(mǎi)賣(mài)規(guī)模
            NumericSeries Passwayhi;                    //通道上軌{程序化交易}
            NumericSeries Passwaylo;                    //通道下軌
            NumericSeries quithighprice;                //離市時(shí)判斷需要的離市周期最高價(jià)
            NumericSeries quitlowprice;                 //離市時(shí)判斷需要的離市周期最低價(jià)
            Numeric myEntryPrice;                       //開(kāi)倉(cāng)價(jià)格
            Numeric myExitPrice;                        //平倉(cāng)價(jià)格
            NumericSeries tempnum(0);                   //臨時(shí)計(jì)數(shù)器
            Bool Sendorderthisbar(False);               //當(dāng)前Bar是否有過(guò)交易
            NumericSeries preEntryprice(0);             //前一次開(kāi)倉(cāng)的價(jià)格
    Begin
            Minpoint=Minmove*PriceScale;
            AvgTR=XAverage(TrueRange,ATRlength);
            F=weightnumber*AvgTR[1];
            Capital=Portfolio_CurrentCapital()+Portfolio_UsedMargin();
            scale=(Capital*RiskRatio/100)/(F*ContractUnit()*BigPointValue());
            scale=IntPart(scale);
            
            Passwayhi=HighestFC(High[1],boLength);
            Passwaylo=LowestFC(Low[1],boLength);
            
            quitlowprice=LowestFC(Low[1],Quitlength);
            quithighprice=HighestFC(High[1],Quitlength);
            
            Commentary("scale="+Text(scale));
            Commentary("preEntryprice="+Text(preEntryprice));
                   
            
            If(Date!=currentdate)                       //只限于當(dāng)日交易{程序化交易}
            {return;}                                 
            If((Date!=Date[1])or(CurrentBar==0))
            {
            //當(dāng)日的第一個(gè)Bar
            preEntryprice=InvalidNumeric;
            tempnum=Limitednumber;
            return;
            }
            
            If(tempnum[1]<1)
            {
            tempnum=limitednumber;
            }
            
            //開(kāi)倉(cāng)
    If(time<endtime/100)
    {        
            If(MarketPosition==0 And Filtercondition)
            {
                If(High>Passwayhi And scale>=1)
                    {
                    myEntryPrice=Min(high,passwayhi+minpoint);
                    myentryprice=IIF(myentryprice<open,open,myentryprice);
                    preentryprice=myentryprice;
                    Buy(scale,myentryprice);
                    sendorderthisbar=True;
                    }
                   
                    If(Low<passwaylo And scale>=1)
                    {
                    myentryprice=Max(low,passwaylo-Minpoint);
                    myentryprice=IIF(myentryprice>open,open,myentryprice);
                    preentryprice=myentryprice;
                    SellShort(scale,myentryprice);
                    sendorderthisbar=True;
                    }
            }
            
            
            If(Marketposition==1)
            {
                Commentary("quitlowprice="+Text(quitlowprice));
                    If(Low<quitlowprice)
                    {
                        myexitprice=Max(low,quitlowprice-Minpoint);
                            myexitprice=IIF(myexitprice>open,open,myexitprice);
                            Sell(0,myexitprice);
                            tempnum=limitednumber;
                    }Else
                    {
                        tempnum=tempnum[1];
                            If(preentryprice!=Invalidnumeric And scale>=1)
                            {
                                If((open>=preentryprice+0.5*F) And (tempnum>=1))
                                    {
                                        myentryprice=open;
                                            preentryprice=myentryprice;
                                            Buy(scale,myentryprice);
                                            sendorderthisbar=True;
                                            tempnum=tempnum-1;
                                    }
                                    
                                    While((High>=preentryprice+0.5*F) And (tempnum>=1))
                                    {
                                        myentryprice=preentryprice+0.5*F;
                                            preentryprice=myentryprice;
                                            Buy(scale,myentryprice);
                                            sendorderthisbar=true;
                                            tempnum=tempnum-1;
                                    }
                            }
                            
                            If(low<=preentryprice-2*F And sendorderthisbar==false)
                            {
                            myexitprice=preentryprice-2*F;
                            Sell(0,myexitprice);
                            tempnum=limitednumber;
                            }
                    }
            }Else If(marketposition==-1)
            {
                Commentary("quithighprice="+Text(quithighprice));
                    If(high>quithighprice)
                    {
                        myexitprice=Min(High,quithighprice+Minpoint);
                            myexitprice=IIF(myexitprice<open,open,myexitprice);
                            BuyToCover(0,myexitprice);
                            tempnum=limitednumber;
                    }Else
                    {   tempnum=tempnum[1];
                        If(preentryprice!=Invalidnumeric And scale>=1)
                            {
                                If((open<=preentryprice-0.5*F) And (tempnum>=1))
                                    {
                                        myentryprice=Open;
                                            preentryprice=myentryprice;
                                            SellShort(scale,myentryprice);
                                            sendorderthisbar=True;
                                            tempnum=tempnum-1;
                                    }
                                    
                                    While((Low<=preentryprice-0.5*F) And (tempnum>=1))
                                    {
                                        myentryprice=preentryprice-0.5*F;
                                            preentryprice=myentryprice;
                                            SellShort(scale,myentryprice);
                                            sendorderthisbar=True;
                                            tempnum=tempnum-1;
                                    }
                            }
                            
                            
                            If(High>=preentryprice+2*F And sendorderthisbar==False)
                            {
                                myexitprice=preentryprice+2*F;
                                    BuyToCover(0,myexitprice);
                                    tempnum=limitednumber;
                            }
                    }
            }
    }


            If(Time==0.145500 && /*CurrentTime>0.145800 &&*/ MarketPosition<>0)  //收盤(pán)平倉(cāng)用于5Min
            {
                    Sell(0,Close);
                    BuyToCover(0,Close);
            
            }
            


    End

     

 

有思路,想編寫(xiě)各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友

可聯(lián)系技術(shù)人員 QQ: 262069696  點(diǎn)擊在線交流進(jìn)行 有償 編寫(xiě)!不貴!點(diǎn)擊查看價(jià)格!


【字體: 】【打印文章】【查看評(píng)論

相關(guān)文章

    沒(méi)有相關(guān)內(nèi)容
主站蜘蛛池模板: 欧美一级毛片欧美毛片视频 | 国内精品久久久久不卡 | 欧美经典人人爽人人爽人人片 | 色图综合网 | 香蕉精品高清在线观看视频 | 日本自己的私人影院 | 国产精品欧美一区二区三区不卡 | 免费播放欧美毛片 | 在线播放国产区 | 成人观看网站a | 亚洲精品久久久久久久网站 | 国产无套免费网站 | 97se亚洲综合在线 | 久久99精品九九九久久婷婷 | 亚洲狠狠色丁香婷婷综合 | 久青草视频免费观看青 | 999热视频 | 日韩欧美亚洲综合 | 国产精品免费大片 | 精品一区二区三区在线视频观看 | 天堂一区二区三区在线观看 | 久久狠狠色狠狠色综合 | 四影虎库最新2021 | 久久国产精品久久久久久 | 中文字幕亚洲综合久久菠萝蜜 | 五月婷婷丁香在线视频 | 欧美精品中文字幕手机免费视频 | 国产精品香蕉成人网在线观看 | 曰韩三级 | 日韩在线视频免费播放 | 欧美aaaa在线观看视频免费 | 欧美三级毛片 | 国产精品久久久久久久久齐齐 | 亚洲免费高清 | 精品成人 | 午夜国产精品久久久久 | 国产精品美女久久久久久 | 天天久久综合 | 欧美亚洲综合另类型色妞 | 99爱视频99爱在线观看免费 | 成人激情在线视频 |