您現在的位置:程序化交易>> 期貨公式>> 交易開拓者(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  點擊在線交流進行 有償 編寫!不貴!點擊查看價格!


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

相關文章

    沒有相關內容
主站蜘蛛池模板: 中文字幕人成乱码中国| 亚洲综合第一区| 高清无码视频直接看| 国产美女自慰在线观看| а√在线地址最新版| 挺进白嫩老师下面视频| 亚洲av之男人的天堂网站| 波多野结衣AV一区二区全免费观看| 午夜爽爽爽男女免费观看影院 | 亚洲欧美日韩专区| 看**一级**多毛片| 午夜看黄网站免费| 老扒夜夜春宵粗大好爽aa毛片| 国产大尺度吃奶无遮无挡网| 五月婷婷丁香网| 国产精品国产国产aⅴ| 91嫩草视频在线观看| 在线视频亚洲欧美| stars120| 岳一夜要我六次| 两腿之间的私密图片| 我和岳乱妇三级高清电影| 久久99精品久久久久久水蜜桃| 日本夫妇交换456高清| 久久精品国产亚洲AV香蕉| 最强yin女系统白雪| 亚洲av高清一区二区三区| 欧美日韩一区二区三区在线观看视频| 亚洲精品福利你懂| 热热色原原网站 | 久久久精品午夜免费不卡| 日韩精品专区在线影院重磅| 亚洲va中文字幕无码久久| 欧美人妻日韩精品| 亚洲伊人色欲综合网| 欧美日韩人妻精品一区二区三区 | 国产黄三级高清在线观看播放 | 国产精品21区| 美女网站在线观看视频免费的| 国产精品夜色一区二区三区| 2018天天操天天干|