您好
出場條件:A. 庫存股票跌破當初成交K棒的低點時賣出 或 B. 成交後5天賣出
請問如何取得庫存成交日期
條件A.條件B 的程式要如何寫 請指教
// 作多, 日頻率
//進場
var:intraBarPersist LD(0);
condition2 = GetField("投信買賣超","D")[1]> volume[1] * 0.1;
condition3 = c > H[1];
if condition2 and condition3
AND FILled =0 AND position =0 then
begin
setposition(1);
LD=date;
end;
//出場:跌破當初成交K棒的低點時賣出 或 成交後5天賣出
if filled>0
and (c<LowD(getBarOffset(LD)) or date-LD=5)
then setposition(0);
print( "成交日期", NumToStr(LD, 0) , "成交天數", NumToStr(date-LD, 0));
4 評論