5 分 K 取收盤價 怎都都取到上一檔的
variable:KBarOfDay(0); KBarOfDay+=1; if date<>date[1] then KBarOfDay=1;
if CurrentTime >= 091000
value1 = bollingerband(Close[2], 20, 2);
value2 = bollingerband(Close[2], 20, -2);
value3 = bollingerband(Close[1], 20, 2);
value4 = bollingerband(Close[1], 20, -2);
value5 = bollingerband(Close, 20, 2);
value6 = bollingerband(Close, 20, -2);
print(file("d:\print\Ten.log"), currenttime, symbol,"0 BB", KBarOfDay, close[2], value1, value2);
print(file("d:\print\Ten.log"), currenttime, symbol,"5 BB", KBarOfDay, close[1], value3, value4);
print(file("d:\print\Ten.log"), currenttime, symbol,"10 BB", KBarOfDay, close, value5, value6);
log 如下 date = 1/23
91113.000000 4536.TW CurrentTime 2.000000 127.000000 => 應該是0900 值是開盤昨天 13:25
91113.000000 4536.TW 0 BB 2.000000 128.000000 129.324808 126.075192 => 應該是5分0905 值是開盤0900
91113.000000 4536.TW 5 BB 2.000000 125.000000 129.523499 125.776501 => 0910 => 0905
91113.000000 4536.TW 10 BB 2.000000 127.000000 129.443560 125.956440
請幫忙 感謝
3 評論