Dukascopy
 
 
Wiki JStore Search Login

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

    Submit JForex API bug reports in this forum only.
    Submit Converter issues in Converter Issues.
    Off topics are strictly forbidden.

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

IChart getSelectedPeriod for user defined period
 Post subject: IChart getSelectedPeriod for user defined period Post rating: 0   New post Posted: Wed 05 Aug, 2020, 15:02 

User rating: 3
Joined: Fri 15 Nov, 2019, 12:54
Posts: 16
Location: Poland,
Hi,


I've defined new price based period with value of 100 pips.

In my plugin code I'm trying to get currently selected period in the active chart.

IChart chart; // <- pointing to active chart

Period period = chart.getSelectedPeriod();


The getSelectedPeriod() method returns valid information for all interval-based periods, but for other periods (like price-based) it always returns "7 Days".

How can I get the valid price-based period data?



Best regards,
Marcin


 
 Post subject: Re: IChart getSelectedPeriod for user defined period Post rating: 0   New post Posted: Thu 06 Aug, 2020, 09:58 

User rating: 3
Joined: Fri 15 Nov, 2019, 12:54
Posts: 16
Location: Poland,
I've found the way to access this information - from feedDescriptor object:

IFeedDescriptor feedDescriptor = chart.getFeedDescriptor();

DataType dataType = feedDescriptor.getDataType(); //PRICE_RANGE_AGGREGATION
PriceRange priceRange = feedDescriptor.getPriceRange(); // 100_PIPS


 

Jump to:  

  © 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