天天看点

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呀

继续阅读