小幫手您好
想請您看看下面腳本所執行的自動交易被觸發的條件為何?
為什麼一開盤就馬上被觸發?腳本其他商品都沒發生,唯獨這支
商品:1612 宏泰 頻率:1分鐘 逐筆洗價:啟用 資料讀取筆數:5 策略部位:依庫存
PRINT內容

腳本內容
if CurrentTime = 085955 then tg=0 ;
if CurrentTime = 085955 then sp=0 ;
if CurrentTime = 085955 then oc=0 ;
value1=FilledAvgPrice*1.01618;
value2=FilledAvgPrice*1.03236;
value3=FilledAvgPrice*1.06472;
value4=FilledAvgPrice*1.095;
//cross Below
condition1=close cross Below value1 or close cross Below value2 or close cross Below value3
or close>=value4;
condition2=currentTime>=090000 and close>FilledAvgPrice ;
if Position >= 1 and tg=0 and condition1 and condition2 then
begin
SetPosition(0,label:="平倉");{ 停利 }
tg=1;
oc=close-tp;
value88=round((oc-FilledAvgPrice)*Position,2);
Alert(text("1.已平倉",NumToStr(value88,2)));
end;
if currentTime>=132500 then return;




13 評論