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

IChart getSelectedPeriod for user defined period
http://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=16&t=57407
Page 1 of 1

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

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

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