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.

Simplify setParamVisibility() for IOhlcChartObject
 Post subject: Simplify setParamVisibility() for IOhlcChartObject Post rating: 0   New post Posted: Thu 11 Jul, 2013, 22:54 
User avatar

User rating: 164
Joined: Mon 08 Oct, 2012, 10:35
Posts: 676
Location: NetherlandsNetherlands
Is there a way to hide all default text on a IOhlcChartObject object with a single line?

I can do that with the following code, but would be more elegant a simple line...
IOhlcChartObject ohlc;
ohlc =  myChart.getChartObjectFactory().createOhlcInformer();
ohlc.setParamVisibility(CandleInfoParams.DATE, false);
ohlc.setParamVisibility(CandleInfoParams.TIME, false);
ohlc.setParamVisibility(CandleInfoParams.OPEN, false);
ohlc.setParamVisibility(CandleInfoParams.HIGH, false);
ohlc.setParamVisibility(CandleInfoParams.LOW, false);
ohlc.setParamVisibility(CandleInfoParams.CLOSE, false);
ohlc.setParamVisibility(CandleInfoParams.VOL, false);
ohlc.setParamVisibility(CandleInfoParams.INDEX, false);
ohlc.setParamVisibility(TickInfoParams.DATE, false);
ohlc.setParamVisibility(TickInfoParams.TIME, false);
ohlc.setParamVisibility(TickInfoParams.ASK, false);
ohlc.setParamVisibility(TickInfoParams.BID, false);
ohlc.setParamVisibility(TickInfoParams.ASK_VOL, false);
ohlc.setParamVisibility(TickInfoParams.BID_VOL, false);
ohlc.setParamVisibility(PriceAgregatedInfoParams.DATE, false);
ohlc.setParamVisibility(PriceAgregatedInfoParams.START_TIME, false);
ohlc.setParamVisibility(PriceAgregatedInfoParams.END_TIME, false);
ohlc.setParamVisibility(PriceAgregatedInfoParams.OPEN, false);
ohlc.setParamVisibility(PriceAgregatedInfoParams.HIGH, false);
ohlc.setParamVisibility(PriceAgregatedInfoParams.LOW, false);
ohlc.setParamVisibility(PriceAgregatedInfoParams.CLOSE, false);
ohlc.setParamVisibility(PriceAgregatedInfoParams.VOL, false);
ohlc.setParamVisibility(PriceAgregatedInfoParams.INDEX, false);


 
The Best Answer  Post subject: Re: Simplify setParamVisibility() for IOhlcChartObject Post rating: 1   New post Posted: Fri 12 Jul, 2013, 02:02 
User avatar

User rating: 70
Joined: Sat 22 Sep, 2012, 17:43
Posts: 118
Location: Brazil, Fortaleza, Ceará
Simplest (least verbose) approach under the existing APIs:
for(IOhlcChartObject.CandleInfoParams param : IOhlcChartObject.CandleInfoParams.values())
   ohlc.setParamVisibility(param, false);
for(IOhlcChartObject.TickInfoParams param : IOhlcChartObject.TickInfoParams.values())
   ohlc.setParamVisibility(param, false);
for(IOhlcChartObject.PriceAgregatedInfoParams param : IOhlcChartObject.PriceAgregatedInfoParams.values())
   ohlc.setParamVisibility(param, false);
Main advantage here new Enum constants in any of these three categories are automatically included with no code rewriting


 

Jump to:  

  © 1998-2026 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