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

您現在的位置:程序化交易>> 期貨公式>> 交易開拓者(TB)>> 開拓者公式>>正文內容

開拓者飛天創富系統策略源碼[開拓者公式]

 

 


  • (一)思路:1.同時交易四個品種,每個品種動用總資金的10%。
                         2.以連續合約發出信號,交易主力合約,連續合約為data0,現主力合約為data1,下一個主力合約為data2;
                         3.總資金以A_CurrentEquity 表達是否正確;
                         4.盤中達到止損,立即以止損價止損;
                         5.開盤跳空越過止損價,立即以開盤價止損,但不能因集合競價出現廢單;
                         
    (二)程序代碼:

    //------------------------------------------------------------------------
    // 簡稱: FTCF
    // 名稱: 飛天創富
    // 類別: 公式應用
    // 類型: 用戶應用
    //------------------------------------------------------------------------

    Params
            Numeric m(7);
            numeric P(1.5);
            numeric n(0.1);
    Vars
            NumericSeries a;
            NumericSeries b;
            NumericSeries e;
            numeric entrylots;
            NumericSeries dtzf;// m.weiqiv.net.cn
            NumericSeries ktdf;
    Begin
            a=(3*c+l+o+h)/6;
            b=(20*a+19*a[1]+18*a[2]+17*a[3]+16*a[4]+15*a[5]+14*a[6]+13*a[7]+12*a[8]+11*a[9]+10*a[10]+9*a[11]+8*a[12]+7*a[13]+6*a[14]+5*a[15]+4*a[16]+3*a[17]+2*a[18]+a[20])/210;//來源 m.weiqiv.net.cn
            e=average(b,m);
            dtzf=c/Close[NthCon(CrossOver(b,e),1)]-1;
            ktdf=1-c/Close[NthCon(CrossOver(e,b),1)];

    //多頭開倉
        if(crossover(b,e) and MarketPosition!=1 and ktdf<n and data1.v>data2.v and CurrentTime>=0.145955)      
               {
                  entryLots= (A_CurrentEquity *0.1)/(data1.C*ContractUnit*MarginRatio);                           
                  entryLots  = IntPart(entryLots );
                  data1.Buy(entryLots,data1.C);
               }
            if(crossover(b,e) and MarketPosition!=1 AND ktdf>=n and data1.v>data2.v and CurrentTime>=0.145955)
               {
                  entryLots= (A_CurrentEquity*0.05)/(data1.C*ContractUnit*MarginRatio);
                  entryLots  = IntPart(entryLots );
                  data1.Buy(entryLots,data1.C);
               }
            if(crossover(b,e) and MarketPosition!=1 and ktdf<n and data1.v<data2.v and CurrentTime>=0.145955)
               {
                 entryLots= (A_CurrentEquity *0.1)/(data2.C*ContractUnit*MarginRatio);
                 entryLots  = IntPart(entryLots );
                 data1.BuyToCover(0,data1.c);
                 data2.Buy(entryLots,data2.C);
               }
            if(crossover(b,e) and MarketPosition!=1 AND ktdf>=n and data1.v<data2.v and CurrentTime>=0.145955)
               {
                  entryLots= (A_CurrentEquity *0.05)/(data2.C*ContractUnit*MarginRatio);
                  entryLots  = IntPart(entryLots );
                  data1.BuyToCover(0,data1.c);
                  data2.Buy(entryLots,data2.C);
               }   
    //多頭開倉結束

    //空頭開倉        
            if(Crossover(e,b) and MarketPosition!=(-1) and dtzf<n and data1.v>data2.v and CurrentTime>=0.145955)
               {
                entryLots= (A_CurrentEquity * 0.1)/(data1.C*ContractUnit*MarginRatio);
                entryLots  = IntPart(entryLots );
                data1.SellShort(entryLots,data1.c);
               }//來源 www.chengxuhuajiaoyi.com
            if(Crossover(e,b) and MarketPosition!=(-1) and dtzf>=n and data1.v>data2.v and CurrentTime>=0.145955)
               {
                entryLots= (A_CurrentEquity* 0.05)/(data1.C*ContractUnit*MarginRatio);
                entryLots  = IntPart(entryLots );
                data1.Sellshort(entryLots,data1.c);
               }
            if(Crossover(e,b) and MarketPosition!=(-1) and dtzf<n and data1.v<data2.v and CurrentTime>=0.145955)
               {
                entryLots= (A_CurrentEquity * 0.1)/(data2.C*ContractUnit*MarginRatio);
                entryLots  = IntPart(entryLots );
                data1.Sell(0,data1.c);
                data2.SellShort(entryLots,data2.c);
               }
            if(Crossover(e,b) and MarketPosition!=(-1) and dtzf>=n and data1.v<data2.v and CurrentTime>=0.145955)
               {
                entryLots= (A_CurrentEquity * 0.05)/(data2.C*ContractUnit*MarginRatio);
                entryLots  = IntPart(entryLots );
                data1.Sell(0,data1.c);
                data2.Sellshort(entryLots,data2.c);
               }   
    //空頭開倉結束

    //多頭止損
          If(marketposition==1 and data1.l<=A_BuyAvgPrice*(1-p/100) and date>lastEntryDate AND currenttime>0.090000)
                    {
                     data1.Sell(0,A_BuyAvgPrice*(1-p/100));
                    }
              If(marketposition==1 and data1.o<=A_BuyAvgPrice*(1-p/100) and date>lastEntryDate AND currenttime>0.090000)
                    {
                     data1.Sell(0,o);
                    }
    //多頭止損結束

    //空頭止損
          If(marketposition==(-1) and data1.h>=A_sellAvgPrice*(1+p/100) and date>lastEntryDate AND currenttime>0.090000)
                    {
                     data1.BuyToCover(0,A_sellAvgPrice*(1+p/100));
                    }
              If(marketposition==(-1) and data1.o>=A_sellAvgPrice*(1+p/100) and date>lastEntryDate AND currenttime>0.090000)
                    {
                     data1.BuyToCover(0,o);
                    }
    //空頭止損結束        

    End





    //------------------------------------------------------------------------
    // 編譯版本        GS2010.12.08
    // 用戶版本        2013/01/29 13:58
    // 版權所有        
    // 更改聲明        TradeBlazer Software保留對TradeBlazer平臺
    //                每一版本的TrabeBlazer公式修改和重寫的權利
    //------------------------------------------------------------------------

     

 

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

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

 


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

相關文章

    沒有相關內容
  主站蜘蛛池模板: 一区二区三区网站在线免费线观看 | 黄视频网站观看 | 韩国女主播一区二区三区视频 | 日韩字幕无线乱码 | 国产一级一片免费播放 | 好吊色青青青国产欧美日韩 | 久久国产精品一区二区 | 亚洲欧美日韩精品久久亚洲区 | 久久天天躁夜夜躁狠狠85麻豆 | 草草影院国产第一页 | 中国免费毛片 | 日韩色区 | 四虎国产在线观看 | 免费国产成人 | 午夜国产精品影院在线观看 | 一级特黄特黄毛片欧美的 | 精品一区二区三区影片 | 中文字幕免费在线看线人动作大片 | 天天插天天插天天插 | 香蕉视频精品 | 在线免费精品视频 | 日韩福利影院 | 国产精品一区二区资源 | 波多野结衣视频一区 | 免费观看毛片视频 | a亚洲视频 | 久草久草在线 | 天天成人 | 国产福利在线免费观看 | 欧美大片在线观看成人 | 日本天天谢天天要天天爱 | 国产无套乱子伦精彩是白视频 | 亚洲美女激情 | 99精品免费久久久久久久久日本 | 亚洲一区二区三区免费观看 | 亚洲欧美综合一区 | 天天躁夜夜躁狂狂躁综合 | 欧美精品亚洲精品日韩经典 | 欧日韩不卡在线视频 | 成人午夜视频在线 | 国产真实自拍 |