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

幫忙看下這有一段撤單指令的編寫問題 [開拓者 TB]

  • 咨詢內容: 本帖最后由 fushengchenken 于 2016-1-29 16:02 編輯

    這段程序代碼是在1分鐘的K線上運行的平倉指令,請幫我看下這段撤單和從新平倉的指令的問題

    If(A_TotalPosition>0 And A_GetOpenOrderCount!=0)
    {
      A_DeleteOrder();
      MyExitDelete=MyExitDelete+1;
      SetGlobalVar(14,MyExitDelete);
      If(MyExitDelete>0)
      {
      A_SendOrder(Enum_Sell,Enum_Exit,A_BuyPosition(),Close-ExitSlippage*MinMove*PriceScale);
      MyBuyExit=MyBuyExit+1;
      SetGlobalVar(8,MyBuyExit);
      MyExitTime=Time;
      SetGlobalVar(11,MyExitTime);
      }
      If(A_GetLastOpenOrderIndex(Enum_Sell,Enum_Exit)==InvalidInteger)
      {
      MyEntryTime=0;
      SetGlobalVar(10,MyEntryTime);
      }
    }

    我想實現的目標是:
    1.一但有多單持倉并且有未成交的多單就立刻撤單,并將 MyExitDelete+1做為全局變量做一個記錄。
    2.如果一但有過一次撤單以后立刻再次平倉多單,并且用A_GetLastOpenOrderIndex(Enum_Buy,Enum_Exit)==InvalidInteger指令來判斷平倉指令是否成功。一旦確認平倉成功了,再將MyEntryTime清0.
    3.我要讓這個指令重復運行,以達到不斷的平倉撤單,再平倉再撤單直到平倉成功,這樣一個效果。

    目前遇到一些始終解決不掉,又找不到問題的原因的地方,希望TB的技術人員幫忙看看:
    問題1:我咨詢過你們TB的服務人員,他們告訴我TB的運行機制是會在一分鐘的K線的最后一個TICK合并下一個1分鐘的K線合并計算?我不知道這個敘述清楚沒有。這里面有個問題我下面截取一張圖表來咨詢。遇到的問題是為什么在賬戶都完全沒有持倉的情況下,程序總會在每個1分鐘的最后一個TICK上面撤單一次?(見下圖1紅色加粗數據)

    問題2:
    QQ截圖20160129143856.png (6.58 KB, 下載次數: 0) 2016-1-29 14:38:41 上傳

     

  • TB技術人員: 圖1見紅色加粗部分
    Time=0.1124 MyTimeSecondValue=58 MyBuyEntry=0 MySellEntry=0 MyEntryTime=0 MyEntryDelete=0 MyBuyExit=0 MySellExit=0 MyExitTime=0 MyExitDelete=0 Date=2016-01-29
    Time=0.1124 MyTimeSecondValue=58 MyBuyEntry=0 MySellEntry=0 MyEntryTime=0 MyEntryDelete=0 MyBuyExit=0 MySellExit=0 MyExitTime=0 MyExitDelete=0 Date=2016-01-29
    Time=0.1124 MyTimeSecondValue=0 MyBuyEntry=0 MySellEntry=0 MyEntryTime=0 MyEntryDelete=0 MyBuyExit=1 MySellExit=0 MyExitTime=0.1124 MyExitDelete=1 Date=2016-01-29

     

  • TB客服:
    圖1見紅色加粗部分
    Time=0.1125 MyTimeSecondValue=57 MyBuyEntry=0 MySellEntry=0 MyEntryTime=0 MyEntryDelete=0 MyBuyExit=0 MySellExit=0 MyExitTime=0 MyExitDelete=0 Date=2016-01-29
    Time=0.1125 MyTimeSecondValue=57 MyBuyEntry=0 MySellEntry=0 MyEntryTime=0 MyEntryDelete=0 MyBuyExit=0 MySellExit=0 MyExitTime=0 MyExitDelete=0 Date=2016-01-29
    Time=0.1125 MyTimeSecondValue=58 MyBuyEntry=0 MySellEntry=0 MyEntryTime=0 MyEntryDelete=0 MyBuyExit=0 MySellExit=0 MyExitTime=0 MyExitDelete=0 Date=2016-01-29
    Time=0.1125 MyTimeSecondValue=58 MyBuyEntry=0 MySellEntry=0 MyEntryTime=0 MyEntryDelete=0 MyBuyExit=0 MySellExit=0 MyExitTime=0 MyExitDelete=0 Date=2016-01-29
    Time=0.1125 MyTimeSecondValue=59 MyBuyEntry=0 MySellEntry=0 MyEntryTime=0 MyEntryDelete=0 MyBuyExit=0 MySellExit=0 MyExitTime=0 MyExitDelete=0 Date=2016-01-29
    Time=0.1125 MyTimeSecondValue=59 MyBuyEntry=0 MySellEntry=0 MyEntryTime=0 MyEntryDelete=0 MyBuyExit=1 MySellExit=0 MyExitTime=0.1125 MyExitDelete=1 Date=2016-01-29

     

  • 網友回復: 圖1見紅色加粗部分
    Time=0.1126 MyTimeSecondValue=53 MyBuyEntry=0 MySellEntry=0 MyEntryTime=0 MyEntryDelete=0 MyBuyExit=0 MySellExit=0 MyExitTime=0 MyExitDelete=0 Date=2016-01-29
    Time=0.1126 MyTimeSecondValue=54 MyBuyEntry=0 MySellEntry=0 MyEntryTime=0 MyEntryDelete=0 MyBuyExit=0 MySellExit=0 MyExitTime=0 MyExitDelete=0 Date=2016-01-29
    Time=0.1126 MyTimeSecondValue=55 MyBuyEntry=0 MySellEntry=0 MyEntryTime=0 MyEntryDelete=0 MyBuyExit=0 MySellExit=0 MyExitTime=0 MyExitDelete=0 Date=2016-01-29
    Time=0.1126 MyTimeSecondValue=56 MyBuyEntry=0 MySellEntry=0 MyEntryTime=0 MyEntryDelete=0 MyBuyExit=0 MySellExit=0 MyExitTime=0 MyExitDelete=0 Date=2016-01-29
    Time=0.1126 MyTimeSecondValue=58 MyBuyEntry=0 MySellEntry=0 MyEntryTime=0 MyEntryDelete=0 MyBuyExit=0 MySellExit=0 MyExitTime=0 MyExitDelete=0 Date=2016-01-29
    Time=0.1126 MyTimeSecondValue=59 MyBuyEntry=0 MySellEntry=0 MyEntryTime=0 MyEntryDelete=0 MyBuyExit=1 MySellExit=0 MyExitTime=0.1126 MyExitDelete=1 Date=2016-01-29

     

  • 網友回復: 本帖最后由 fushengchenken 于 2016-2-1 11:05 編輯

    圖2見紅色加粗部分
    Time=0.1333 MyTimeSecondValue=31 MyBuyEntry=0 MySellEntry=0 MyEntryTime=0 MyEntryDelete=0 MyBuyExit=0 MySellExit=0 MyExitTime=0 MyExitDelete=0 Date=2016-01-29
    Time=0.1333 MyTimeSecondValue=31 MyBuyEntry=0 MySellEntry=0 MyEntryTime=0 MyEntryDelete=0 MyBuyExit=0 MySellExit=0 MyExitTime=0 MyExitDelete=0 Date=2016-01-29
    Time=0.1333 MyTimeSecondValue=31 MyBuyEntry=0 MySellEntry=0 MyEntryTime=0 MyEntryDelete=0 MyBuyExit=0 MySellExit=0 MyExitTime=0 MyExitDelete=0 Date=2016-01-29
    Time=0.1333 MyTimeSecondValue=32 MyBuyEntry=0 MySellEntry=0 MyEntryTime=0 MyEntryDelete=0 MyBuyExit=0 MySellExit=0 MyExitTime=0 MyExitDelete=0 Date=2016-01-29
    Time=0.1333 MyTimeSecondValue=32 MyBuyEntry=1 MySellEntry=0 MyEntryTime=0.1333 MyEntryDelete=0 MyBuyExit=0 MySellExit=0 MyExitTime=0 MyExitDelete=0 Date=2016-01-29
    Time=0.1333 MyTimeSecondValue=33 MyBuyEntry=1 MySellEntry=0 MyEntryTime=0.1333 MyEntryDelete=0 MyBuyExit=0 MySellExit=0 MyExitTime=0 MyExitDelete=0 Date=2016-01-29
    Time=0.1333 MyTimeSecondValue=33 MyBuyEntry=1 MySellEntry=0 MyEntryTime=0.1333 MyEntryDelete=0 MyBuyExit=0 MySellExit=0 MyExitTime=0 MyExitDelete=0 Date=2016-01-29
    Time=0.1333 MyTimeSecondValue=34 MyBuyEntry=1 MySellEntry=0 MyEntryTime=0.1333 MyEntryDelete=0 MyBuyExit=0 MySellExit=0 MyExitTime=0 MyExitDelete=0 Date=2016-01-29
    Time=0.1333 MyTimeSecondValue=35 MyBuyEntry=1 MySellEntry=0 MyEntryTime=0.1333 MyEntryDelete=0 MyBuyExit=0 MySellExit=0 MyExitTime=0 MyExitDelete=0 Date=2016-01-29
    Time=0.1333 MyTimeSecondValue=35 MyBuyEntry=1 MySellEntry=0 MyEntryTime=0.1333 MyEntryDelete=0 MyBuyExit=0 MySellExit=0 MyExitTime=0 MyExitDelete=0 Date=2016-01-29
    Time=0.1333 MyTimeSecondValue=36 MyBuyEntry=1 MySellEntry=0 MyEntryTime=0.1333 MyEntryDelete=0 MyBuyExit=0 MySellExit=0 MyExitTime=0 MyExitDelete=0 Date=2016-01-29
    Time=0.1333 MyTimeSecondValue=36 MyBuyEntry=1 MySellEntry=0 MyEntryTime=0.1333 MyEntryDelete=0 MyBuyExit=0 MySellExit=0 MyExitTime=0 MyExitDelete=0 Date=2016-01-29
    Time=0.1333 MyTimeSecondValue=37 MyBuyEntry=1 MySellEntry=0 MyEntryTime=0 MyEntryDelete=0 MyBuyExit=1 MySellExit=0 MyExitTime=0.1333 MyExitDelete=0 Date=2016-01-29
    Time=0.1333 MyTimeSecondValue=38 MyBuyEntry=1 MySellEntry=0 MyEntryTime=0 MyEntryDelete=0 MyBuyExit=2 MySellExit=0 MyExitTime=0.1333 MyExitDelete=1 Date=2016-01-29

    Time=0.1333 MyTimeSecondValue=39 MyBuyEntry=1 MySellEntry=0 MyEntryTime=0 MyEntryDelete=0 MyBuyExit=2 MySellExit=0 MyExitTime=0.1333 MyExitDelete=1 Date=2016-01-29
    Time=0.1333 MyTimeSecondValue=39 MyBuyEntry=1 MySellEntry=0 MyEntryTime=0 MyEntryDelete=0 MyBuyExit=2 MySellExit=0 MyExitTime=0.1333 MyExitDelete=1 Date=2016-01-29
    Time=0.1333 MyTimeSecondValue=40 MyBuyEntry=1 MySellEntry=0 MyEntryTime=0 MyEntryDelete=0 MyBuyExit=2 MySellExit=0 MyExitTime=0.1333 MyExitDelete=1 Date=2016-01-29
    Time=0.1333 MyTimeSecondValue=41 MyBuyEntry=1 MySellEntry=0 MyEntryTime=0 MyEntryDelete=0 MyBuyExit=2 MySellExit=0 MyExitTime=0.1333 MyExitDelete=1 Date=2016-01-29
    Time=0.1333 MyTimeSecondValue=41 MyBuyEntry=1 MySellEntry=0 MyEntryTime=0 MyEntryDelete=0 MyBuyExit=2 MySellExit=0 MyExitTime=0.1333 MyExitDelete=1 Date=2016-01-29
    Time=0.1333 MyTimeSecondValue=44 MyBuyEntry=1 MySellEntry=0 MyEntryTime=0 MyEntryDelete=0 MyBuyExit=2 MySellExit=0 MyExitTime=0.1333 MyExitDelete=1 Date=2016-01-29
    Time=0.1333 MyTimeSecondValue=46 MyBuyEntry=1 MySellEntry=0 MyEntryTime=0 MyEntryDelete=0 MyBuyExit=2 MySellExit=0 MyExitTime=0.1333 MyExitDelete=1 Date=2016-01-29
    Time=0.1333 MyTimeSecondValue=46 MyBuyEntry=1 MySellEntry=0 MyEntryTime=0 MyEntryDelete=0 MyBuyExit=2 MySellExit=0 MyExitTime=0.1333 MyExitDelete=1 Date=2016-01-29
    Time=0.1333 MyTimeSecondValue=47 MyBuyEntry=1 MySellEntry=0 MyEntryTime=0 MyEntryDelete=0 MyBuyExit=2 MySellExit=0 MyExitTime=0.1333 MyExitDelete=1 Date=2016-01-29
    Time=0.1333 MyTimeSecondValue=48 MyBuyEntry=1 MySellEntry=0 MyEntryTime=0 MyEntryDelete=0 MyBuyExit=2 MySellExit=0 MyExitTime=0.1333 MyExitDelete=1 Date=2016-01-29
    Time=0.1333 MyTimeSecondValue=49 MyBuyEntry=1 MySellEntry=0 MyEntryTime=0 MyEntryDelete=0 MyBuyExit=2 MySellExit=0 MyExitTime=0.1333 MyExitDelete=1 Date=2016-01-29

 

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

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


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

相關文章

    沒有相關內容
主站蜘蛛池模板: 3d动漫精品一区二区三区| 亚洲中文字幕久久精品无码a | 国产一区二区三区播放| 97久久超碰国产精品2021| 手机在线观看视频你懂的| 亚洲一级在线观看| 狠狠色综合网久久久久久| 国产中文字幕视频在线观看| 18av黄动漫在线观看| 小猪视频免费网| 久久国产欧美另类久久久| 欧美日韩亚洲区久久综合| 十大最污软件下载| 中文字幕在线免费看线人| 欧美性色黄在线视频| 再深点灬舒服灬太大了添动视频| 黄色网站在线免费| 国产超碰人人爽人人做人人添| 东北大坑第二部txt| 日韩系列第一页| 亚洲欧洲中文日产| 男男黄GAY片免费网站WWW| 国产丰满岳乱妇在线观看| h视频在线观看免费| 大陆三级特黄在线播放| 中文字幕在线看视频一区二区三区 | 国内揄拍国内精品少妇国语| 中文在线观看永久免费| 日韩国产成人精品视频| 亚洲国产成人久久三区| 波多野结衣视频网址| 十分钟免费视频高清完整版www| 青娱乐国产在线视频| 国产欧美精品一区二区| 91大神精品视频| 天天干天天干天天干天天干| 三级黄色在线视频中文| 日本在线观看中文| 九九在线中文字幕无码| 欧美另类老少配hd| 亚洲欧美日韩综合在线播放|