COCO研究院

 找回密碼
 註冊
搜索
查看: 6843|回復: 12

請問這樣串接下單大師哪裡有問題嗎

[複製鏈接]
發表於 10-12-24 13:17 | 顯示全部樓層 |閱讀模式
請問各位高手
小弟用MC要串接下單大師
可是照他的範例這樣打
下單大師都說找不到對應的艙位
可以請各位高手幫我看看嗎?




Inputs: Auto(0);
Vars:nowposition(0),signDTStr("");
if Auto=1 then begin
DefineDLLFunc: "C:\Program Files\OrderMaster\OMSignAPI.dll",bool,"IniDllAndPosition",LPSTR,int;
DefineDLLFunc: "C:\Program Files\OrderMaster\OMSignAPI.dll",bool,"GoOrder",LPSTR,LPSTR,LPSTR,int,double;
DefineDLLFunc: "C:\Program Files\OrderMaster\OMSignAPI.dll",int,"GetNowPosition",LPSTR;

nowposition=marketposition*currentcontracts;
if date<>date[1] then IniDllAndPosition("MXF", nowposition);
end;

nowposition=marketposition*currentcontracts;

inputs : aa(10),bb(30);

var : ma1(0),ma2(0);

ma1 = average(c,aa);

ma2 = average(c,bb);

if time >= 0930 and time <=  1230 then begin
   if marketposition <= 0 and  ma1 > ma2 then buy 1 contracts next bar at market;
   end;
   
if time >= 0930 and time <=  1230 then begin
   if marketposition >= 0 and  ma1 < ma2 then sellshort 1 contracts next bar at market;
   end;
  
if time >= 1300 then begin
   sell 1 contracts  next bar at market;
   buytocover  1 contracts  next bar at market;
end;


if Auto=1 then begin
if nowposition = 0 then begin
signDTStr = numtostr(year(date)+1900,0) +"/" + numtostr(month(date),0)
+ "/" + numtostr(dayofmonth(date),0) + " " + numtostr(time_s,0);
GoOrder("MXF", "", signDTStr , nowposition, ExitPrice(0));
end
else begin
signDTStr = numtostr(year(date)+1900,0) +"/" + numtostr(month(date),0)
+ "/" + numtostr(dayofmonth(date),0) + " " + numtostr(time_s,0);
GoOrder("MXF", "", signDTStr , nowposition, EntryPrice(0));
end;
end;
發表於 10-12-24 23:17 | 顯示全部樓層
下單大師 ,萬用API 設定 那裡 識別碼 要 打上去  MXF,也就是 程式裡面 你使用 什麼  "XXXX" 下單大師 那裡 就要 使用 什麼 作為 識別碼
inputs : aa(10),bb(30),Auto(0);
[IntrabarOrderGeneration = true];  //這一行 加上去
 樓主| 發表於 10-12-27 09:25 | 顯示全部樓層
我來試試看
謝謝大大
 樓主| 發表於 10-12-27 11:28 | 顯示全部樓層
抱歉大大
小弟把這一行加進去之後
下單大師依然說無法抓到部位
不知道哪裡還是有問題
發表於 10-12-27 16:51 | 顯示全部樓層
本帖最後由 trading144 於 10-12-27 04:55 PM 編輯

你有沒有 做 萬用API 初始化 動作?
能不能 抓到 信號,在於 萬用API 設定 那裡 識別碼 與 MC裡面 程式碼 對應同 字串
以下 複製到你MC程式的 前段, 取代原先的 試試看:
[IntrabarOrderGeneration = true];
DefineDLLFunc: "C:\Program Files\TS Support\MultiCharts\myMCtool.dll",bool,"MC4WriteFile",LPSTR,LPSTR;

//if Auto=1 then begin  不用 設 Auto 變數也可以
  DefineDLLFunc: "C:\Program Files\OrderMaster\OMSignAPI.dll",bool,"IniDllAndPosition",LPSTR,int;
  DefineDLLFunc: "C:\Program Files\OrderMaster\OMSignAPI.dll",bool,"GoOrder",LPSTR,LPSTR,LPSTR,int,double;
  nowposition=marketposition*currentcontracts;
  if date<>date[1] then IniDllAndPosition("MXF", nowposition);
//end;
發表於 10-12-27 16:55 | 顯示全部樓層
MC 程式碼 尾端 放 這一段:
nowposition=marketposition*currentcontracts;

//if Auto=1 then begin   
  if nowposition = 0 then begin  
     signDTStr = numtostr(year(date)+1900,0) +"/" + numtostr(month(date),0)
     + "/" + numtostr(dayofmonth(date),0) + " " + numtostr(time_s,0);
     GoOrder("MXF", "", signDTStr , nowposition, ExitPrice(0));
  end
  else begin
     signDTStr = numtostr(year(date)+1900,0) +"/" + numtostr(month(date),0)
     + "/" + numtostr(dayofmonth(date),0) + " " + numtostr(time_s,0);
     GoOrder("MXF", "", signDTStr , nowposition, EntryPrice(0));
  end;   
//end;
 樓主| 發表於 10-12-29 08:17 | 顯示全部樓層
謝謝大大
目前放上去沒問題
現在看盤中能不能下單
感謝大大
 樓主| 發表於 10-12-29 11:20 | 顯示全部樓層
大大真抱歉打擾你
但是我測試過之後
下單大師一直偵測我的程式訊號為0部位
就算有進場
他還是說是0
發表於 10-12-29 14:04 | 顯示全部樓層
回復 8# pipi1122


    http://www.coco-in.net/viewthread.php?tid=7656&extra=page%3D1

你使用 這套 測試看看
發表於 11-3-24 13:15 | 顯示全部樓層
坐在電腦前
內心的恐懼貪婪興奮展現無疑
每天都在洗三溫暖
發表於 11-5-5 00:30 | 顯示全部樓層
ma1 = average(c,aa);
ma2 = average(c,bb);
if ma1 > ma2 ...
發表於 11-5-8 02:04 | 顯示全部樓層
以前交易室多採用路透社報價系統
發表於 11-5-12 18:25 | 顯示全部樓層
mc+下單大師~~~好用~~~個人覺得超
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

手機版|Archiver|站長信箱|廣告洽詢|COCO研究院

GMT+8, 24-4-25 09:51

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回復 返回頂部 返回列表
理財討論網站 | AI繪圖AI超擬真美女AI beauty AI Stable DiffusionAI正妹AI Lookbook