強力小幫手您好,想撰寫交易腳本,於當日09:30後,若有相較於開盤價漲幅大於2%且為紅k時,會進場交易
但用"日頻率"回測近兩個月台股上市普通股973項,全部無交易紀錄,請問一下是不是有寫錯的地方,感謝
Value51 = GetField("Close","1");//最後一筆成交價
Value5 = (value51-OpenD(0))/OpenD(0)*100;//即時相較於開盤價之漲跌幅
Condition1 = (close-OpenD(0))>0;//紅K或黑K判斷
Condition2= (value5>2);
condition3 = time>093000;
condition4 = condition1 and condition2 and condition3;
//進場
if condition4
then setposition(+1,market);
//停損 及停利
input: profit_percent(1.5, "停利(%)");
input: loss_percent(2.5, "停損(%)");
if close >= FilledAvgPrice*1.015 or close <= FilledAvgPrice*0.975 then setposition(0,market);
1 評論