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

期貨期權交流求教代碼問題 [MC]

  • 咨詢內容:
    ? ?? ?你好,下面是我編寫的股指期貨代碼,現在有幾個問題想請教一下。
    ? ?? ?1、以下的代碼有沒有地方可以簡化?可以減少計算時間。
    ? ?? ?2、現在運行中,setstoploss止損后,就不能自動開倉了,如果想止損后依然按條件自動開倉,應該怎么寫代碼?
    ? ???非常感謝!




    inputs:p01(9999),p02(9999),p03(9999),p04(9999);
    variables:co1(0),c02(0),c03(0),c04(0),d01(0),d02(0),d03(0),d04(0);
    begin
    co1=p01-0.2;
    c02=p02-0.2;
    c03=p03-0.2;
    c04=p04-0.2;
    d01=p01+0.2;
    d02=p02+0.2;
    d03=p03+0.2;
    d04=p04+0.2;
    if close cross above co1 and marketposition=0 then sellshort 1 contract next bar at market;
    if close cross above c02 and marketposition=0 then sellshort 1 contract next bar at market;
    if close cross above c03 and marketposition=0 then sellshort 1 contract next bar at market;
    if close cross above c04 and marketposition=0 then sellshort 1 contract next bar at market;
    if close cross under d01 and marketposition=0 then buy 1 contract next bar at market;
    if close cross under d02 and marketposition=0 then buy 1 contract next bar at market;
    if close cross under d03 and marketposition=0 then buy 1 contract next bar at market;
    if close cross under d04 and marketposition=0 then buy 1 contract next bar at market;
    if close cross above co1 and marketposition=1 then sellshort 1 contracts next bar at market;
    if close cross above c02 and marketposition=1 then sellshort 1 contracts next bar at market;
    if close cross above c03 and marketposition=1 then sellshort 1 contracts next bar at market;
    if close cross above c04 and marketposition=1 then sellshort 1 contracts next bar at market;
    if close cross above d01 and marketposition=-1 then buy 1 contract next bar at market;
    if close cross above d02 and marketposition=-1 then buy 1 contract next bar at market;
    if close cross above d03 and marketposition=-1 then buy 1 contract next bar at market;
    if close cross above d04 and marketposition=-1 then buy 1 contract next bar at market;
    if close cross under co1 and marketposition=1 then sellshort 1 contract next bar at market;
    if close cross under c02 and marketposition=1 then sellshort 1 contract next bar at market;
    if close cross under c03 and marketposition=1 then sellshort 1 contract next bar at market;
    if close cross under c04 and marketposition=1 then sellshort 1 contract next bar at market;
    if close cross under d01 and marketposition=-1 then buy 1 contracts next bar at market;
    if close cross under d02 and marketposition=-1 then buy 1 contracts next bar at market;
    if close cross under d03 and marketposition=-1 then buy 1 contracts next bar at market;
    if close cross under d04 and marketposition=-1 then buy 1 contracts next bar at market;
    if close cross above d01 and marketposition=-1 then buy 1 contracts next bar at market;
    if close cross above d02 and marketposition=-1 then buy 1 contracts next bar at market;
    if close cross above d03 and marketposition=-1 then buy 1 contracts next bar at market;
    if close cross above d04 and marketposition=-1 then buy 1 contracts next bar at market;
    setstoploss(600);
    if time>=1457 then
    sell next bar at market;
    buytocover next bar at market;
    end

    ?

  • MC技術部: 還想請問我的收盤平倉的代碼是否正確?

 

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

可聯系技術人員 QQ: 511411198  點擊這里給我發消息進行 有償 編寫!不貴!點擊查看價格!


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

相關文章

    沒有相關內容
主站蜘蛛池模板: 日韩精品www| 国产亚洲色婷婷久久99精品| 国产激情在线观看| 四虎国产精品永久地址99| 人人添人人澡人人澡人人人人 | 亚洲国产三级在线观看| 久久久亚洲欧洲日产国码农村| Aⅴ精品无码无卡在线观看| 免费看片在线观看| 绝世名器np嗯嗯哦哦粗| 欧美人和黑人牲交网站上线| 搞黄网站免费看| 国产精品自产拍在线网站| 国产一级片在线播放| 亚洲欧美日韩人成在线播放| 久久久国产精品一区二区18禁| 99久9在线|免费| 色视频色露露永久免费观看 | 伊人色院成人蜜桃视频| 久久精品国产999大香线焦| h片在线观看免费| 香港三级电影在线观看| 毛片大全免费看| 成人人观看的免费毛片 | 国产免费av片在线观看| 亚洲成年人影院| 一二三四免费观看在线电影中文 | 老熟妇仑乱视频一区二区| 欧美人与动人物牲交免费观看| 娇妻之欲海泛舟小强| 国产午夜久久精品| 亚洲国产综合在线| caoporm碰最新免费公开视频| 这里只有精品网| 欧美sss视频| 国产自无码视频在线观看| 全彩漫画口工令人垂延三尺| 久久人人爽人人爽人人片av不| **真实毛片免费观看| 特级毛片在线播放| 妇女性内射冈站HDWWWCOM|