天天看點

MT5中position、order、deal 差別

一直對MT5中position、order、deal 的概念很困惑,百度了很多,這個連結講解的比較清楚:https://www.mql5.com/en/forum/314300(還是老外實在)

原文:

Order is only used to to send request to the market. It will be the order until platform open it.

After Opening Order become Position (one for netting account or many for hedging account)

In hedging account order ticket is equal to position ticket.

After position closing (by market or manually) it becomes deal and can be retrieved from deal history.

Pending orders closed before reaching market conditions are also become deals.
           

加上自己的了解:

1.訂單(包括挂單)被平台執行前,叫order

2.訂單被執行後,就轉變為position,也就是持倉

3.這裡要注意賬戶是否支援對沖,對支援對沖的賬戶來說,單一貨币對可以有很多個position,否則隻能有一個position

4.在支援對沖的賬戶裡,order的訂單号和position的訂單号相同

5.當訂單被平倉後或挂單被删除後,就轉變為deal

6.一筆交易從開倉到平倉分成了3個步驟,order->position->deal,每一個步驟都可以看做一個完整的交易,都可以在曆史交易中單獨檢視

7.曆史記錄中的position綜合了開倉和平倉資訊,但好像不能直接調用,得自己根據ticket去組合order和deal

8.另外,mt5中的平倉是開了等手數的反向單,是以在曆史交易中同一筆交易會出現好幾筆記錄(兩個order,兩個deal)

9.這樣了解的話也可以說通,說是為了相容股票交易。但相對于mt4,用的是真麻煩,至少提供下相容mt4的API呀

繼續閱讀