|
請問各位高手
小弟用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; |
|