人人爽天天爽夜夜爽qc-人人爽天天爽夜夜爽曰-人人天天爱天天做天天摸-人人天天夜夜-色网站在线-色网站在线看

您現(xiàn)在的位置:程序化交易>> 期貨公式>> (MC)multicharts>> MC知識>>正文內(nèi)容

期貨期權(quán)交流趨勢策略-三均線利劍 [MC]

  • 咨詢內(nèi)容: 近來歐美股市的波動非常大啊,伊波拉病毒也蠢蠢欲動.....不知道會不會影響到咱們中國,也因此,策略天地在此介紹一個(gè)趨勢型的策略,讓讀者們試試,策略優(yōu)點(diǎn)主要在動態(tài)出場,進(jìn)場隨意寫的,需要靠用戶優(yōu)化
    策略適用商品:趨勢性較好的商品。下圖測試商品IF,3 min周期。
    原理如下:此策略是根據(jù)短期及中長期均線確認(rèn)行情方向,然后當(dāng)行情突破近期高低點(diǎn)時(shí)進(jìn)行趨勢性開倉。
    出場停利用常用的三條均線作為出場條件,根據(jù)進(jìn)場后的行情創(chuàng)新高跟新低的次數(shù)控制用哪條均線出場,好處是防止剛剛進(jìn)場后激活短期均線,容易錯(cuò)失大的行情。
    input:x(30),y(120),m(20),n(15);var:ma1(close),ma2(close);
    ma1=Average(close,x);ma2=Average(close,y);
    condition1=close>ma1 and ma1>ma2;condition2=close<ma1 and ma1<ma2;condition3=high > highest(high,m)[1];condition4=low <lowest(low,n)[1];//以上定義變量跟參數(shù),對進(jìn)場條件進(jìn)行定義
    if marketposition=0 and condition1 and condition3 then buy next bar at market;//判斷進(jìn)場條件
    //////////////////////input:f1(10),f2(20),f3(30),stp(11);var:av1(0),av2(0),av3(0),position(0),stH(0),Hct(0),stl(0),lct(0);av1 = average(close, f1);av2 = average(close, f2);av3 = average(close, f3);position = marketposition;//定義常用的三條移動平均線
    if position =1 and position[1] =0 then beginstH = high;Hct =0;end;//進(jìn)場后對第一個(gè)bar高點(diǎn)賦值
    if position =1 and close > stH then beginstH = high;Hct = Hct[1] +1;end;//后面對創(chuàng)新高時(shí)進(jìn)行累加計(jì)算
    if position =1 then beginif Hct <3 then sell("begin stop") next bar at entryprice - stp stop;if Hct >=3 and Hct <6 then sell("30stop") next bar at av3 stop;if Hct >=6 and Hct <9 then sell("20stop") next bar at av2 stop;if Hct >=9 then sell ("10stop") next bar at av1 stop;end;//當(dāng)有持倉時(shí),累加值作為激活某條均線的出場條件,有長期均線激活開始,這樣可以防止進(jìn)場后快速被洗出來。
    ////////////////////////if marketposition=0 and condition2 and condition4 then sellshort next bar at market;if position =-1 and position[1] =0 then beginstl = low;lct =0;end;if position =-1 and close < stl then beginstl = low;lct = lct[1] +1;end;if position =-1 then beginif lct <3 then buytocover("begin stop1") next bar at entryprice + stp stop;if lct >=3 and lct <6 then buytocover("30stop1") next bar at av3 stop;if lct >=6 and lct <9 then buytocover("20stop1") next bar at av2 stop;if lct >=9 then buytocover ("10stop1") next bar at av1 stop;end;//原理跟上面的多單進(jìn)場出場條件判斷一致,方向相反操作
    此策略參數(shù)未做優(yōu)化處理,都是常用的數(shù)值,可以按照此思路作為之后策略的出場判斷。
    展示圖如下:





    three_sword.pla

    2014-10-21 10:00 上傳

    點(diǎn)擊文件名下載附件

    4.94 KB, 下載次數(shù): 12

    售價(jià): 10 金錢  [記錄]

    源代碼下載

     

  • MC技術(shù)部: 學(xué)習(xí)了,不錯(cuò)的思路

 

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

可聯(lián)系技術(shù)人員 QQ: 511411198  點(diǎn)擊這里給我發(fā)消息進(jìn)行 有償 編寫!不貴!點(diǎn)擊查看價(jià)格!


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

相關(guān)文章

    沒有相關(guān)內(nèi)容
主站蜘蛛池模板: 狠狠色噜噜狠狠狠狠色综合网 | 国产激情视频在线播放 | 99国产超薄丝袜足j在线观看 | 牛牛热在线视频 | 国产中文在线 | 天天操国产 | 黄色三级毛片网站 | 91久久免费视频 | 日韩三级| 97免费在线| 欧美乱人伦中文在线观看不卡 | 一级一级毛片免费播放 | 黑人videos巨大hd粗暴 | 日日摸夜夜欧美一区二区 | 欧美午夜激情影院 | 亚洲欧美激情精品一区二区 | 在线涩涩 | 在线精品国产导航 | 亚洲毛片在线免费观看 | 波多野吉衣中文字幕 | 国产一区二区在线看 | 亚洲精品免费在线视频 | 特黄特a级特别特级特毛片 特黄特黄aaaa级毛片免费看 | 日本全身露裸无遮挡黄漫画 | 大杳蕉伊人狼人久久一本线 | 青青青在线视频播放 | 欧美网站在线看 | 国内精品 大秀视频 日韩精品 | 高清不卡日本v在线二区 | 日本三级黄色片 | 国产农村精品一级毛片视频 | 日韩三级中文字幕 | 欧美精品一区二区三区免费观看 | 免看一级a一片成人123 | 日本高清xxxxx | 亚洲成在人色婷婷 | 韩国一级做a爰片性色毛片 韩国一级黄色大片 | 成人午夜在线 | 日韩久久精品 | 狠狠色狠狠色综合人人 | 黄色免费影视 |