小幫手你好
我想要寫一個計算股票當天碰到漲停,後來回檔後又回漲停,用1分K計算當天的回檔幅度
我用交易腳本寫去print,但不知道為什麼print出來都是不對的
謝謝小幫手
var: intraBarPersist _stop(false);
var: last_date (0);
if date <> last_date then begin
_stop = false;
last_date = date;
value2 = 0;
value1 = 5000;
end;
if currentTime <= 132400
and condition1 and condition2
and high = getField("漲停價", "D")
and _stop = false
then begin
value2 = getBarOffset(currentdate, currentTime);
_stop = true;
end;
for value3 = value2 +1 to getBarOffset(currentdate, 132400)
begin
if low[value3] < value1 then value1 = low[value3];
end;
if currenttime >= 132459 and c = getField("漲停價", "D") and value1 < 5000
then
print(file("C:\Users\Mionnibal\Documents\test.txt"),
currentDate, symbol, "back%", (VALUE1 - getField("漲停價", "D"))/ getField("漲停價", "D"));
1 評論