大伊人青草狠狠久久-大伊香蕉精品视频在线-大伊香蕉精品一区视频在线-大伊香蕉在线精品不卡视频-大伊香蕉在线精品视频75-大伊香蕉在线精品视频人碰人

您現在的位置:程序化交易>> 期貨公式>> 金字塔等>> 其他期貨軟件知識>>正文內容

[原創]完整策略交易模型模版源碼 [金字塔]

  • 咨詢內容:

    以下內容為程序代碼:

    1 variable:maxprofit=0;
    2 win:=0;
    3 win2:=0;
    4
    5 if holding=0 then begin
    6     //多頭開倉
    7     if tradingtime and enlongcond then begin
    8         buy(1,1,limitr,close);
    9         maxprofit:=0;
    10     end
    11     
    12     //空頭開倉
    13     if tradingtime and enshortcond then begin
    14         buyshort(1,1,limitr,close);
    15         maxprofit:=0;
    16     end
    17 end
    18
    19 if holding>0 then begin
    20     //多頭平倉
    21     if exlongcond then
    22         sell(1,holding,limitr,close);
    23
    24     //多頭收盤平倉
    25     if not(tradingtime) then
    26         sell(1,holding,limitr,close);
    27
    28     //盈虧計算
    29     if enterbars>0 then begin
    30         win:=(c-enterprice)/enterprice*100;
    31         if win>maxprofit then
    32             maxprofit:=win;
    33         win2:=(maxproift-win)/maxprofit*100;
    34     end
    35
    36     //多頭初始止損
    37     if win<-2 then
    38         sell(1,holding,limitr,close);
    39
    40     //多頭利潤止盈
    41     if win>4 then
    42         sell(1,holding,limitr,close);
    43     
    44     //多頭回撤止盈
    45     if win2>60 and openprofit>0 then
    46         sell(1,holding,limitr,close);
    47 end
    48
    49 if holding<0 then begin
    50     //空頭平倉
    51     if exshortcond then
    52         sellshort(1,holding,limitr,close);
    53
    54     //空頭收盤平倉
    55     if not(tradingtime) then
    56         sellshort(1,holding,limitr,close);
    57     
    58     //盈虧計算
    59     if enterbars>0 then begin
    60         win:=(enterprice-c)/enterprice*100;
    61         if win>maxprofit then
    62             maxprofit:=win;
    63         win2:=(maxprofit-win)/maxprofit*100;
    64     end
    65
    66     //空頭初始止盈
    67     if win<-2 then
    68         sellshort(1,holding,limitr,close);
    69
    70     //空頭利潤止盈
    71     if win>4 then
    72         sellshort(1,holding,limitr,close);
    73     
    74     //空頭回撤止盈
    75     if win2>60 and openprofit>0 then
    76         sellshort(1,holding,limitr,close);
    77 end
    78
    79

    [此貼子已經被作者于2010-8-24 11:01:40編輯過]

     

  • 金字塔客服: 呵呵 義務奉獻了

     

  • 用戶回復: 經典的模板 真的不錯 收藏了 Thanks

     

  • 網友回復:

     

  • 網友回復:

    公式測試不過去 樓主請看看原因

     

    編譯錯誤:無法判斷該表達式的意圖

     

    箭頭---        sell(1,holding,limitr,close);

 

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

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


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

相關文章

    沒有相關內容
主站蜘蛛池模板: 美女久久久久久 | 日日噜噜夜夜狠狠久久aⅴ 日日噜噜夜夜狠狠久久丁香 | 亚洲欧美一区二区三区二厂 | 亚洲欧美日韩高清在线看 | 国产一级精品高清一级毛片 | 亚洲精品久久 | 久操免费 | 999久久久精品视频在线观看 | 日本免费小视频 | 久久婷婷久久一区二区三区 | 国产720刺激i在线视频 | 国产日韩精品视频一区二区三区 | 午夜一级毛片不卡 | 色啦啦影院 | 色88888久久久久久影院 | 不卡午夜视频 | 又黄又爽又成人免费视频 | 欧美天堂在线视频 | 华人亚洲欧美精品国产 | 久久九九有精品国产56 | 日日噜噜夜夜躁躁狠狠 | 全免费毛片在线播放 | 五月综合色 | 久久亚洲综合网 | 欧美性视频在线激情 | 久久精品国产eeuss | 久久99热66这里只有精品一 | 久青草青综合在线视频 | 爱唯侦察1024入口地址 | 精品久久久久久中文字幕专区 | 在线观看视频中文字幕 | 中文字幕最新在线 | 亚洲欧美精品中文字幕 | 日本不卡视频 | 国产免费成人在线视频 | 性生活免费视频网站 | 99久久免费国产精品特黄 | 四虎影视884a精品国产四虎 | 成人欧美一区二区三区视频 | 成人亚洲视频 | 一级黄色网 |