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

開拓者 TB KD2號交易策略模型源碼 [開拓者 TB]

  • 咨詢內容: 本帖最后由 woomin1985 于 2013-2-19 23:52 編輯

    //------------------------------------------------------------------------
    // 簡稱: kd2
    // 名稱:
    // 類別: 公式應用
    // 類型: 用戶應用
    // 輸出://程序化交易 www.tumamayizhan.com
    //------------------------------------------------------------------------
    Params
             Numeric Length1(16);
             Numeric Length2(35);
             Numeric Length3(9);
             Numeric Lots(1);
    Vars
             NumericSeries Value1;
             NumericSeries Value2;
             NumericSeries LowestValue;
             NumericSeries Value5;
             NumericSeries RSV;
             NumericSeries KValue;
             NumericSeries DValue;
             NumericSeries AvgVol5;
             NumericSeries CloseTmp1;
             NumericSeries CloseTmp2;
             NumericSeries RSIValue;
             NumericSeries PreLow;
             NumericSeries PreKValue;
             NumericSeries Lowest33Value;
             NumericSeries VarTmp1;
             NumericSeries VarTmp2;
             NumericSeries ZL;
             NumericSeries SH;
    Begin
             Value1 =XAverage(Close,Length1);
             Value2 =XAverage(Close,Length2);
             //取兩條均線的值
             LowestValue = Lowest(Low,Length3);
             //取最低值
             Value5= (CLOSE-LowestValue)/(Highest(High,Length3)-LowestValue)*100;
             RSV =XAverage(Value5,3);
             KValue = XAverage(RSV,3);
             DValue =Average(KValue,3);
             PreKValue =KValue[1];
             PreLow =Low[1];
             AvgVol5 =Average(Vol,5);
             Lowest33Value= Lowest(Low,33);
             VarTmp1=((2*CLOSE+HIGH+LOW)/4 - Lowest33Value )/(Highest(High,33) - Lowest33Value) *100;
             ZL =XAverage(VarTmp1,17);
             VarTmp2 =0.667*ZL[1] + 0.333*ZL;
             SH =XAverage(VarTmp2,2);
             CloseTmp1 =Max(Close - Close[1], 0);
             CloseTmp2 =Abs(Close - Close[1]);
             RSIValue =WAverage(CloseTmp1,6)/WAverage(CloseTmp2,6) *100;
             //以上為KD部分只要如何換書寫方式就可了,,higest ==hhv lowest==llv   xAverager=ma      
             // Buy什么時做買入動作,條件
                     
                     
             If((Close[1]>Value1[1] and Close[2]<Value1[2]  && KValue[1] > DValue[1] && ZL[1]>SH[1]) or
                 (Value1[1]>Value2[1] and Value1[2]<Value2[2]  && ZL[1]>SH[1] && Vol[1]> 1.25 * AvgVol5[1] && KValue[1] > DValue[1]) Or
                 (KValue[1]>DValue[1] and KValue[2]<DValue[2] && Close[1] > Value1[1] && ZL[1]>SH[1]) Or
                 (RSIValue[1]>70 and RSIValue[2]<70))//條件
             {
                    Buy(Lots,open+MinMove*PriceScale);
             }
             
             //SellShort 什么作賣出動作
             If((PreLow[1]>Close[1] and PreLow[2]<Close[2] && KValue[1] > DValue[1]  && SH>ZL) Or
                 (DValue[1]>KValue[1] and DValue[2]<KValue[2] && Close[1] < Value1[1] && Value1[1] < Value2[1]) Or
                 (PreKValue[1]>KValue[1] and PreKValue[2]<KValue[2] && SH[1]>ZL[1]))//條件
             {
                    SellShort(Lots,open-MinMove*PriceScale);
             }
             
             // Sell 什么做多平倉動作
             If((DValue[1]>KValue[1] and DValue[2]<KValue[2]) or Close[1] < Value1 [1]* 1.001)//條件
             {
                    Sell(Lots,open-MinMove*PriceScale);;
             }
             
             //BuyToCover什么做空平倉動作
             If((KValue[1]>DValue[1] and KValue[2]<DValue[2]) or Close[1] > Value1[1] * 1.001)//條件
             {
                    BuyToCover(Lots,open+MinMove*PriceScale);
             }
    End



     

 

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

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


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

相關文章

    沒有相關內容
主站蜘蛛池模板: 亚洲成a人一区二区三区| 国产成人AV区一区二区三| 中文字幕在线免费视频| 最近免费中文字幕完整7| 亚洲熟妇久久精品| mm131美女爽爽爽作爱视频| 日本人69视频jzzij| 亚洲videosbestsex日本| 毛片网站免费在线观看| 免费国产高清视频| 美女的尿口免费看软件| 国产乱子精品免费视观看片| 黄页网址在线免费观看| 国产精品免费一区二区三区| 久久99国产这里有精品视 | 老子影院在线观看| 国产精品无码无片在线观看| 中文字幕精品亚洲无线码二区 | 亚洲热妇无码av在线播放| 男女一进一出猛进式抽搐视频| 可播放的gαy片男男| 色88久久久久高潮综合影院| 国产乱子伦农村叉叉叉| 颤声娇是什么意思| 国产在线精品一区二区不卡麻豆 | 无码av岛国片在线播放| 久久久精品人妻一区二区三区蜜桃| 晚上看b站直播软件| 亚洲AV香蕉一区区二区三区| 欧美xxxx网站| 亚洲人成网亚洲欧洲无码| 欧美多人性受xxxx喷水| 亚洲国产精品成人精品软件| 欧美毛多水多肥妇| 亚洲欧美成aⅴ人在线观看| 毛片a级三毛片免费播放| 亚洲综合精品香蕉久久网| 玩肥熟老妇BBW视频| 伊人久久无码中文字幕| 男人j放进女人p全黄| 人妻尝试又大又粗久久|