小幫手你好
我想請問為什麼我使用警示腳本日資料回測模擬逐筆洗價
為什麼使用issessionfirstbar去寫target條件
單一標的一天內卻會觸發多筆交易?
謝謝!
var: intraBarPersist target(0);
condition1 = time <= 110000 and high >= getField("參考價", "D") * 1.07;
condition2 = GetSymbolInfo("買賣現沖") or GetSymbolInfo("先買現沖");
condition3 = getField("Volume", "D") >= 500;
if isSessionFirstBar then target = 0;
if condition1 and condition2 and condition3 and target = 0 then target = 1;
if target = 1 and c cross Under ( getField("參考價", "D") + high) * 0.5
then begin
ret = 1;
target = 2;
end;
1 評論