Hi,
Please give advice on how to properly calculate ProfitLoss of two merged positions with
opposite direction.
Here are some logs of messages related to merged positions:
Quote:
102 Strategy clientInit$BaseStrategy$16 22-02-2017 14:45:44.240000: MESSAGE type(ORDER_CLOSE_OK) content: None -----------
REASONS: [ORDER_CLOSED_BY_MERGE, ]
creationTime: 1487774729498
ORDER:
state: CLOSED
amount: 0.008
closePrice: 1.050934375
openPrice: 1.050934375
creationTime: 22/02/2017 15:10:00
closeTime: 22/02/2017 15:45:29
comment: None
fillTime: 22/02/2017 15:39:30
id: 127048141
instrument: EUR/USD
label: A179_132M
orderCommand: SELL
originalAmount: 0.001
profitLossInAccountCurrency: 0.0
profitLossInPips: -0.0
profitLossInUSD: -0.0
commission: 0.0
commissionInUSD: 0.0
state: CLOSED
isLong: False
Fill history:
amount: 0.008, price: 1.050934375, time: 22/02/2017 15:39:30
Close history:
amount: 0.008, price: 1.050934375, time: 22/02/2017 15:45:29
102 Strategy clientInit$BaseStrategy$16 22-02-2017 14:45:44.307000: MESSAGE type(ORDER_CLOSE_OK) content: None -----------
REASONS: [ORDER_CLOSED_BY_MERGE, ]
creationTime: 1487774729499
ORDER:
state: CLOSED
amount: 0.001
closePrice: 1.05153
openPrice: 1.05153
creationTime: 22/02/2017 15:45:01
closeTime: 22/02/2017 15:45:29
comment: None
fillTime: 22/02/2017 15:45:29
id: 127049366
instrument: EUR/USD
label: A179_139
orderCommand: BUY
originalAmount: 0.001
profitLossInAccountCurrency: 0.0
profitLossInPips: 0.0
profitLossInUSD: 0.0
commission: 0.15
commissionInUSD: 0.04
state: CLOSED
isLong: True
Fill history:
amount: 0.001, price: 1.05153, time: 22/02/2017 15:45:29
Close history:
amount: 0.001, price: 1.05153, time: 22/02/2017 15:45:29
102 Strategy clientInit$BaseStrategy$16 22-02-2017 14:45:44.364000: MESSAGE type(ORDER_CHANGED_OK) content: -----------
REASONS: []
creationTime: 1487772600710
ORDER:
state: FILLED
amount: 0.007
closePrice: 0.0
openPrice: 1.050934
creationTime: 22/02/2017 15:10:00
closeTime: 01/01/1970 01:00:00
comment: None
fillTime: 22/02/2017 15:39:30
id: 127049478
instrument: EUR/USD
label: A179_141M
orderCommand: SELL
originalAmount: 0.001
profitLossInAccountCurrency: -17.09
profitLossInPips: -6.0
profitLossInUSD: -4.17
commission: 0.0
commissionInUSD: 0.0
state: FILLED
isLong: False
Fill history:
amount: 0.007, price: 1.050934375, time: 22/02/2017 15:39:30
102 Strategy clientInit$BaseStrategy$16 22-02-2017 14:45:44.388000: MESSAGE type(NOTIFICATION) content: POSITION_MERGED_TO-Positions: 127048141; 127049366 MERGED to position: 127049478 -----------
REASONS: []
creationTime: 1487774729501
ORDER:
state: FILLED
amount: 0.007
closePrice: 0.0
openPrice: 1.050934
creationTime: 22/02/2017 15:10:00
closeTime: 01/01/1970 01:00:00
comment: None
fillTime: 22/02/2017 15:39:30
id: 127049478
instrument: EUR/USD
label: A179_141M
orderCommand: SELL
originalAmount: 0.001
profitLossInAccountCurrency: -17.09
profitLossInPips: -6.0
profitLossInUSD: -4.17
commission: 0.0
commissionInUSD: 0.0
state: FILLED
isLong: False
Fill history:
amount: 0.007, price: 1.050934375, time: 22/02/2017 15:39:30
102 Strategy clientInit$BaseStrategy$16 22-02-2017 14:45:44.423000: MESSAGE type(ORDERS_MERGE_OK) content: Positions: 127048141; 127049366 MERGED to position: 127049478 -----------
REASONS: []
creationTime: 1487774729502
ORDER:
state: FILLED
amount: 0.007
closePrice: 0.0
openPrice: 1.050934
creationTime: 22/02/2017 15:10:00
closeTime: 01/01/1970 01:00:00
comment: None
fillTime: 22/02/2017 15:39:30
id: 127049478
instrument: EUR/USD
label: A179_141M
orderCommand: SELL
originalAmount: 0.001
profitLossInAccountCurrency: -17.09
profitLossInPips: -6.0
profitLossInUSD: -4.17
commission: 0.0
commissionInUSD: 0.0
state: FILLED
isLong: False
Fill history:
amount: 0.007, price: 1.050934375, time: 22/02/2017 15:39:30
BR,
Coreroy