小幫手請教:
在當沖中,2連紅且漲幅>1.5%,<2%,我寫法是如下
if date<>date[1] then begin
if trueall(close > open,2) and close / low[1]>1.015 and close / low[1]<1.02 then ret = 1;
end;
如果想要表達成tick,是不是就是開啟『逐筆』即可呢?感謝
小幫手請教:
在當沖中,2連紅且漲幅>1.5%,<2%,我寫法是如下
if date<>date[1] then begin
if trueall(close > open,2) and close / low[1]>1.015 and close / low[1]<1.02 then ret = 1;
end;
如果想要表達成tick,是不是就是開啟『逐筆』即可呢?感謝
Hello 風期會,
逐筆洗價並不會讓您的腳本變成用Tick頻率運算,而是每根Tick計算一次。
您取前期值還是會是該頻率上一根Bar的值,而不是上一根的Tick的值。
如果該欄位有支援 tick 的話,您可以這樣寫搭配逐筆洗價:
//3個tick越來越高
if GetField("Close", "Tick") > GetField("Close", "Tick")[1] and GetField("Close", "Tick")[1] > GetField("Close", "Tick")[2]
// 比前一根tick上漲 1.5% 到 2%
and (GetField("Close", "Tick") / GetField("Close", "Tick")[1]) > 1.015 and (GetField("Close", "Tick") / GetField("Close", "Tick")[1]) < 1.02
then ret = 1;
1 評論