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.

Object visibility per timeframe
 Post subject: Object visibility per timeframe Post rating: 0   New post Posted: Sun 01 Jul, 2012, 12:10 

User rating: 0
Joined: Thu 07 Jun, 2012, 15:09
Posts: 5
Hi Support,

How can I set the object visibility per timeframe? for instance I want the pivot line to be visible on the 15 minute and Hourly timeframes only on the chart. I found this here:

https://www.dukascopy.com/wiki/#Chart_object_attributes

  public enum ATTR_INT { 
        TIMEFRAMES,             // Value can be one or combination (bitwise addition) of object visibility constants to set/get timeframe object property     
    }


and tried this but without success:

      obj= chart.draw(String.valueOf(PP), IChart.Type.SHORT_LINE , linestart, PP, linestop,PP);
      obj.setAttrInt(IChartObject.ATTR_INT.TIMEFRAMES, 15 );


What values must one set for the IChartObject.ATTR_INT.TIMEFRAMES attribute in order to make the object visible on the M15 and H1 timeframes only??

Thanks!


 
 Post subject: Re: Object visibility per timeframe Post rating: 0   New post Posted: Thu 05 Jul, 2012, 12:06 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
The article you refer to is obsolete and the enumerations are deprecated. Currently it is not possible to set objects to be shown only for certain time frame, however, you can implement this in your own strategy, e.g., onTick check the IChart.getSelectedPeriod() and if it does not match 15 minutes, then remove the object from the chart, but if it does then either keep the object or re-add it if it had been removed.


 

Jump to:  

  © 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