講師 您好
我想請問關於entryprice的問題, 如果我的掛單都使用停止單, 那麼在跳空時會發生掛單價和實際成交價不同的情況, 因此
我想要在code裡面去print我的實際成交價是多少, 因此我使用entryprice, 但是如果我有兩筆以上的未平倉, 我想要知道最近一次進場的進場價格
而不是第一筆進場的價格, 請問我該怎麼寫?
謝謝
僅能自行紀錄了!它的功能僅能抓到第一筆未平倉的值..
MC7 的指令才能支援多次進場的取用,若你有使用MC7 ,HELP中有說明
Returns an absolute numerical value, indicating the execution price of trade entry order.
PosTradeEntryPrice(PosAgo,TradeNumber)
PosTradeEntryPrice
PosAgo
TradeNumber
Where: PosAgo - a numerical expression, specifying the position:
0 - open position;
1 - one position back (the last position closed);
2 - two positions back, etc.
TradeNumber - a numerical expression, specifying the number of trade (zero-based).
This function can only be used in signals.
To retrieve the total number of trades in specified position use PosTradeCount
PosTradeCount
PosTradeEntryPrice(0,1) will return a value of 100.2 for the second trade of the open position, if this trade was opened by the order filled at 100.2.
PosTradeEntryPrice(0,1)
0
1