請問,早上在玩的時候,開啟IOG(模式二) + 60秒 K棒 + 開細部回測 。
發現如果 buy next bar 會變成等同於 buy next tick ,但如果要以這分鐘的K棒收盤價加減點數掛STOP單就會有問題,
因為60秒的Close會變成條件成立時下一個tick的價格。
有甚麼指令是可以強制以 這分鐘 K棒 的收盤價為Clsoe呢?
close[1]
用了還一樣stop在下一個tick......而不是6998以下
在311這筆tick的時候,符合你的送單條件
而後面連續幾筆都是6999的tick,當然不可能會成交在6998
to Brian :
是,我懂您的意思。
可是我想做的是,一但 C < 7000 ,便去偵測當根K棒的收盤價掛Stop單。
譬如這跟K棒收6998,我想在這根K棒一變成完成K棒時,馬上掛 sellshort 6998-10 STOP 。
使用分線組成的1分K棒是沒問題的,可是使用60秒組成的1分K棒就無法了,會變成用tick的Close而非當根1分K的Close
不知道我的理解是否有錯誤的地方....請兩位多包涵。
先感謝兩位的回答~
Q: 發現如果 buy next bar 會變成等同於 buy next tick ,但如果要以這分鐘的K棒收盤價加減點數掛STOP單就會有問題,
我誤會你的意思了,你是要這一根K棒的收盤才動作嗎?
即然是IOG模式,就不會等到收盤才動作,控制上不好做
你試看看以下那個指令,但是我印象中在MC6中,它有時會不靈光,不知道在 MC7 中有沒有解決
A value of 0 indicates that the tick is the opening tick of the bar, 1 indicates that the tick is within the bar, and 2 indicates that the tick is the closing tick of the bar.
BarStatus(DataNum)
BarStatus
Where: DataNum - a numerical expression specifying the data number of the series
If DataNum is not specified, a value for the current data series will be returned.
BarStatus(1) will return a value of 2 if the current tick in the data series with the data number 1 is the closing tick of a bar
BarStatus(1)
1
好的,我會花時間多用一些方式測試看看,有心得再放上來。
謝謝客服一號 與 Brian 的協助 ^^