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.

Progammatically detect chart instrument change?
 Post subject: Progammatically detect chart instrument change? Post rating: 0   New post Posted: Thu 26 Feb, 2015, 07:36 
User avatar

User rating: 0
Joined: Fri 10 Oct, 2014, 00:35
Posts: 58
Location: New Zealand, Auckland
Hi

Is it possible for a strategy to programmatically detect when the user changes instrument or period on the active chart?

Cheers
Tony


 
 Post subject: Re: Progammatically detect chart instrument change? Post rating: 0   New post Posted: Fri 27 Feb, 2015, 14:25 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
It is possible to get a chart by calling
IChart chart;
chart = context.getChart(Instrument.EURUSD);

this chart can be checked on each tick to see if its period has changed:
period.equals(chart.getFeedDescriptor().getPeriod()) 


 

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