救命阿 ~MC高手麻煩指導一下阿 感恩阿!!!
variables:nowposition(0),signDTStr("");DefineDLLFunc: "C:\Program Files (x86)\OrderMaster\OMSignAPI.dll",bool,"IniDllAndPosition",LPSTR,int;
DefineDLLFunc: "C:\Program Files (x86)\OrderMaster\OMSignAPI.dll",bool,"GoOrder",LPSTR,LPSTR,LPSTR,int,double;
if date<>date then begin
IniDllAndPosition("TTO", 0);
end;
買進策略......
nowposition = 1;
end;
賣出策略......
nowposition = -1;
end;
if marketposition<0 then begin
buytocover("stop1") next bar at entryprice+70 stop;
end;
if marketposition>0 then begin
sell("stop2") next bar atentryprice-70 stop;
end;
======================================================================
以上那兩段是停損,問題來了 MC在MC上面有停損,但是MC接下單大師沒有執行停損還停留在那一口單,請問內容哪邊錯誤了呢,麻煩高手指導一下 感謝 .....(萬用API範例)
平倉.....
nowposition = 0;
end;
value100=MarketPosition;
if value100<>value100 then begin
text_Content = NumToStr( iff( value100=0, ExitPrice(0), EntryPrice(0) ),0 );
text_onChart = text_New(Date , Time, iff(value100>value100, L, H) Points,"");
TeXT_SetString(TeXT_onChart,iffstring(value100>value100,"|n"+TeXT_Content,TeXT_Content+"|n"+"|n"+"|n"+"|n"+"|n"+"|n"));
text_SetStyle(text_onChart, 4, 4);
text_SetColor(text_onChart, white);
text_setsize(text_onChart, 14);
end;
{api}
if nowposition = 1 then begin
signDTStr = numtostr(year(date)+1900,0) +"/" + numtostr(month(date),0) + "/" + numtostr(dayofmonth(date),0) + " " + numtostr(time,0) + "00";
GoOrder("TTO", "", signDTStr , nowposition, Close);
end;
if nowposition = 0 then begin
signDTStr = numtostr(year(date)+1900,0) +"/" + numtostr(month(date),0) + "/" + numtostr(dayofmonth(date),0) + " " + numtostr(time,0) + "00";
GoOrder("TTO", "", signDTStr , nowposition, Close);
end;
if nowposition = -1 then begin
signDTStr = numtostr(year(date)+1900,0) +"/" + numtostr(month(date),0) + "/" + numtostr(dayofmonth(date),0) + " " + numtostr(time,0) + "00";
GoOrder("TTO", "", signDTStr , nowposition, Close);
end;
在 MultiCharts 停損只要用 SetStopLoss(金額); 就好了,不需要像HTS那樣做了。
至於串接下單大師的萬用API,我這個版本應該是簡單許多了:http://www.yctseng.net/2011/12/multicharts.html
我的測試,萬用API並沒有明顯比在RAMDISK上Run文字檔的方式有多少優勢。 再請問一下阿政大,是不是所有Set開頭的signal,都是買在this bar,而不是next bar?
頁:
[1]