Dukascopy Support Board

IChart getSelectedPeriod for user defined period
Page 1 of 1

Author:  pminc74 [ Wed 05 Aug, 2020, 15:02 ]
Post subject:  IChart getSelectedPeriod for user defined period


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,

Author:  pminc74 [ Thu 06 Aug, 2020, 09:58 ]
Post subject:  Re: IChart getSelectedPeriod for user defined period

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

  Page 1 of 1