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.

IReportService
 Post subject: IReportService Post rating: 0   New post Posted: Tue 01 Mar, 2016, 10:48 
User avatar

User rating: 0
Joined: Sun 28 Feb, 2016, 22:52
Posts: 4
Location: PolandPoland
Hello,

does IReportService works? I've been trying to obtain overnight information for currently open positions, but getOpenPositions() method of IReportService always return empty list. I'm using JForex-API 2.12.33.

Following code always return zero, regardless of open position count:
console.getOut().println(context.getReportService().getOpenPositions().size());


Is there any way to get overnights for open positions other than estimating it? I've switched from MT4 to JForex and see JForex a lot better than MT4, but not being able to get overnights for open position in API is a major issue.


Regards,
Sebastian


 
 Post subject: Re: IReportService Post rating: 0   New post Posted: Thu 03 Mar, 2016, 15:25 
User avatar

User rating: 0
Joined: Sun 28 Feb, 2016, 22:52
Posts: 4
Location: PolandPoland
Ok... So it looks that there is still no straightforward "official API" way to retrieve overnights for open orders ;) But I have an idea how to workaround this - one just have to obtain initial order open price for particular order. Because on every overnight rollover order opening price is changed by a value of overnight rate in pips, the only what we need is to get difference between current open price and initial order price. This difference is an exact overnight cost that you need to multiply by order amount and pip value in desired currency. I haven't tested it yet, but will do soon :)

Regards,
Sebastian


 

Jump to:  

cron
  © 1998-2025 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