Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

ProfitLoss on merged position
 Post subject: ProfitLoss on merged position Post rating: 0   New post Posted: Wed 22 Feb, 2017, 16:04 
User avatar

User rating: 0
Joined: Sun 16 Dec, 2012, 23:39
Posts: 8
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


 

Jump to:  

cron
  © 1998-2024 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com