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

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

這個需求怎么實現? [MC]

  • MC用戶求助:

    ”節假日及周末前“,這個節假日及周末的日期需要您手動輸入,然后在代碼中實時的與當前的日期時間進行比較判斷,下面分別提供螺紋和滬金的例子,僅供參考:

    //rb
    input: endtime(2300);
    var: tt(""),t1(""), t_date(0);

    tt=txt_read("F:\test25.txt");??
    {這里使用了從外部讀取信息,因為這樣可以在程序運行過程中,對外部讀取的文件進行人工更改,而不需要停止自動交易然后再重新輸入參數或者更改代碼了;輸入節假日的第一天的日期即可}

    t1=midstr(tt,1,7);//見附件內容,只是一個簡單的模板,更復雜的數據需要清洗
    t_date=strtonum(t1);??//將字符轉化為數值

    condition1=juliantodate(datetojulian(t_date)-1)=date and time>=minutestotime(timetominutes(endtime)-5);
    {juliantodate(datetojulian(t_date)-1)=date這個條件判斷當天是否為節假日前的第一天; time>=minutestotime(timetominutes(endtime)-5)這個條件判斷當根bar是否處在收盤前的5分鐘內}

    if condition1 and marketposition<>0 then begin
    ? ? ? ? sell next bar at market;
    ? ? ? ? buytocover next bar at market;
    end;

    //au
    input: endtime(230);
    var: tt(""),t1(""), t_date(0);

    tt=txt_read("F:\test25.txt");

    t1=midstr(tt,1,7);
    t_date=strtonum(t1);

    condition1=juliantodate(datetojulian(t_date))=date and time>=minutestotime(timetominutes(endtime)-5) and time<900;
    if condition1 and marketposition<>0 then begin
    ? ? ? ? sell next bar at market;
    ? ? ? ? buytocover next bar at market;
    end;

    代碼見鏈接:

    http://dl.icetech.com.cn/download/forums/test25.txt

    ?

  • MC回復討論一:

    ”節假日及周末前“,這個節假日及周末的日期需要您手動輸入,然后在代碼中實時的與當前的日期時間進行比較判斷,下面分別提供螺紋和滬金的例子,僅供參考:

    //rb
    input: endtime(2300);
    var: tt(""),t1(""), t_date(0);

    tt=txt_read("F:\test25.txt");??
    {這里使用了從外部讀取信息,因為這樣可以在程序運行過程中,對外部讀取的文件進行人工更改,而不需要停止自動交易然后再重新輸入參數或者更改代碼了;輸入節假日的第一天的日期即可}

    t1=midstr(tt,1,7);//見附件內容,只是一個簡單的模板,更復雜的數據需要清洗
    t_date=strtonum(t1);??//將字符轉化為數值

    condition1=juliantodate(datetojulian(t_date)-1)=date and time>=minutestotime(timetominutes(endtime)-5);
    {juliantodate(datetojulian(t_date)-1)=date這個條件判斷當天是否為節假日前的第一天; time>=minutestotime(timetominutes(endtime)-5)這個條件判斷當根bar是否處在收盤前的5分鐘內}

    if condition1 and marketposition<>0 then begin
    ? ? ? ? sell next bar at market;
    ? ? ? ? buytocover next bar at market;
    end;

    //au
    input: endtime(230);
    var: tt(""),t1(""), t_date(0);

    tt=txt_read("F:\test25.txt");

    t1=midstr(tt,1,7);
    t_date=strtonum(t1);

    condition1=juliantodate(datetojulian(t_date))=date and time>=minutestotime(timetominutes(endtime)-5) and time<900;
    if condition1 and marketposition<>0 then begin
    ? ? ? ? sell next bar at market;
    ? ? ? ? buytocover next bar at market;
    end;

    代碼見鏈接:

    http://dl.icetech.com.cn/download/forums/test25.txt

 

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

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


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

相關文章

    沒有相關內容
主站蜘蛛池模板: 麻豆大豆行情一区 | 免费观看成人羞羞视频网站观看 | 欧美另类tv | 欧美在线一二三区 | 黄色永久免费 | 天天干天天骑 | 精品xxxxxbbbb欧美中文 | 亚洲精品一二三区 | 香蕉视频久久久 | 2015小明台湾永久区域免费 | 黄色网在线免费观看 | 精品国语国产在线对白 | 一区二区三区在线视频播放 | 美女18黄| 久久久久久综合成人精品 | 手机看片1204国内基地在线 | 国产区在线免费观看 | 国产精品一区高清在线观看 | 手机在线免费观看毛片 | xxxx日本69xxxxx| 亚洲精选在线 | 色综合色综合色综合 | 国产剧情乱偷 | 欧美高清成人videosex | 婷婷色综合成人成人网小说 | 狠狠综合久久综合88亚洲日本 | 一级黄色录像视频 | 国产高清精品自在久久 | 成人免费国产gav视频在线 | 亚洲区一二三四区2021 | 欧美日本一 | 热久久视久久精品18国产 | 免费国产不卡午夜福在线观看 | 一本大道在线观看 | 日韩综合nv一区二区在线观看 | 国产亚洲sss在线播放 | 日韩在线无 | 久操视频网 | 激情成人综合网 | 国产黄在线观看 | 国产二区精品视频 |