COCO研究院

 找回密碼
 註冊
搜索
查看: 3169|回復: 2

救命阿 ~MC高手麻煩指導一下阿 感恩阿!!!

[複製鏈接]
發表於 12-8-6 22:33 | 顯示全部樓層 |閱讀模式
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[1] 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 at  entryprice-70 stop;
end;
======================================================================
以上那兩段是停損,問題來了 MC在MC上面有停損,但是MC接下單大師沒有執行停損還停留在那一口單,請問內容哪邊錯誤了呢,麻煩高手指導一下 感謝 .....(萬用API範例)

平倉.....
  nowposition = 0;            
end;                                                


                                   
value100=MarketPosition;
if value100<>value100[1] then begin
text_Content = NumToStr( iff( value100=0, ExitPrice(0), EntryPrice(0) ),0 );
text_onChart = text_New(Date , Time, iff(value100>value100[1], L, H) Points,"");
TeXT_SetString(TeXT_onChart,iffstring(value100>value100[1],"|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;
發表於 12-8-6 23:18 | 顯示全部樓層
在 MultiCharts 停損只要用 SetStopLoss(金額); 就好了,不需要像HTS那樣做了。

至於串接下單大師的萬用API,我這個版本應該是簡單許多了:http://www.yctseng.net/2011/12/multicharts.html

我的測試,萬用API並沒有明顯比在RAMDISK上Run文字檔的方式有多少優勢。
發表於 12-9-18 12:41 | 顯示全部樓層
再請問一下阿政大,是不是所有Set開頭的signal,都是買在this bar,而不是next bar?
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

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

GMT+8, 24-4-29 13:48

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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