Re: tradestation的寫作方式 - 財經

Table of Contents

附上程式,我想要的程式是開盤如果比昨天收盤跳高大漲100點以上
例如,6/16開盤就進場做多(雖然當天其實不適合做多)
(如果開低再爬上去不算)
馬上出現買進訊號,同時,系統回測時也會計錄在當根k棒的open點
而不是close,更不是next bar的open
請各位先進指導一下吧 ~>_<~


input: Price(close),loss(26);

if open>close[1] +100 then begin buy("買") this bar at open stop;
{上面這一行沒辦法在ts執行,不過hts可以執行只要加上or higher or lower}
end;


if open - low > 30 and currentcontracts>0
then begin exitlong ("BUY出場")this bar at close;
end;

if
low < value7 - loss and currentcontracts>0
then begin exitlong ("BUY停")this bar at close;
end;

--

All Comments