Dukascopy Support Board
http://www.dukascopy.com/swiss/english/forex/jforex/forum/

Swap
http://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=83&t=56582
Page 1 of 1

Author:  mcquak [ Fri 15 Jun, 2018, 21:41 ]
Post subject:  Swap

Hi community and support.
Does anyone know how to get swap for opened as well as already closed orders? I can not find anything in IOrder class, but only commision.

Any help appreciated.

T.

Author:  mtnfx [ Sat 16 Jun, 2018, 08:39 ]
Post subject:  Re: Swap

I think the most correct way is
IContext.getReportService() -> getOpenPositions() | getClosedPositions() -> getSwaps()

Another way - evaluate difference in price of 'first open' and 'last open' in IOrder.getFillHistory()' and calculate amount of money out of that. In normal conditions - there is new entry each day with open price adjusted with nightly swap pips
    Fill Time:    2018-06-06 23:16:39.000
    Filled:       #0: 2018-06-06 23:16:39.000 -    9000 * 1.1770811
                  #1: 2018-06-07 00:05:50.000 -    9000 * 1.177302
                  #2: 2018-06-08 00:06:46.000 -    9000 * 1.177376

BUT, from practice I see that it DOES NOT always work this way. Rather frequently 'fill history' contains only 'initial' fill for orders lasting many days.

Author:  mcquak [ Sat 16 Jun, 2018, 10:57 ]
Post subject:  Re: Swap

Cheers mtnfx, thats's exactly what I needed.

mtnfx wrote:
I think the most correct way is
IContext.getReportService() -> getOpenPositions() | getClosedPositions() -> getSwaps()

Another way - evaluate difference in price of 'first open' and 'last open' in IOrder.getFillHistory()' and calculate amount of money out of that. In normal conditions - there is new entry each day with open price adjusted with nightly swap pips
    Fill Time:    2018-06-06 23:16:39.000
    Filled:       #0: 2018-06-06 23:16:39.000 -    9000 * 1.1770811
                  #1: 2018-06-07 00:05:50.000 -    9000 * 1.177302
                  #2: 2018-06-08 00:06:46.000 -    9000 * 1.177376

BUT, from practice I see that it DOES NOT always work this way. Rather frequently 'fill history' contains only 'initial' fill for orders lasting many days.

Author:  Traderider [ Thu 01 Aug, 2019, 08:41 ]
Post subject:  Re: Swap

for Swap I Like to Buy USDCHF :D :D

  Page 1 of 1