Dukascopy
 
 
Wiki JStore Search Login

Getting all opened JForex platform charts
 Post subject: Getting all opened JForex platform charts Post rating: 0   New post Posted: Tue 09 Jul, 2013, 16:20 
User avatar

User rating: 98
Joined: Mon 23 Jul, 2012, 02:02
Posts: 656
Location: United States, Durham, NC
For Strategy to access ALL charts open on the JForex platform,
for all instruments, and charting types, how do I get them?

Do I need to use IContext.getCharts(Instrument) for all possible instruments,
using each Instrument in turn? (I could do that... but doesn't sound elegant)

But can I get the set of ALL opened charts in just one call? Not charts
opened by my Strategy, but any charts that are open?

Thanks for any tips!
HyperScalper


 
 Post subject: Re: Getting all opened JForex platform charts Post rating: 0   New post Posted: Tue 09 Jul, 2013, 18:43 
User avatar

User rating: 70
Joined: Sat 22 Sep, 2012, 17:43
Posts: 118
Location: Brazil, Fortaleza, Ceará
Unfortunately it cannot be done in one call under the present implementation.
// Grab references to all open charts
Set<IChart> allcharts = new HashSet<IChart>();
for(Instrument eachinstrument : Instrument.values())
   allcharts.addAll(context.getCharts(eachinstrument));
           
// Output the charts we picked up
for(IChart eachchart : allcharts)
   console.getOut().println(eachchart.getInstrument() + " (" + eachchart.getFeedDescriptor().getPeriod() + ")");
EUR/USD (Ticks)
USD/JPY (Hourly)
USD/CHF (15 Mins)
GBP/USD (30 Mins)


 
 Post subject: Re: Getting all opened JForex platform charts Post rating: 0   New post Posted: Tue 09 Jul, 2013, 20:13 
User avatar

User rating: 98
Joined: Mon 23 Jul, 2012, 02:02
Posts: 656
Location: United States, Durham, NC
Thanks so much. That is what I am doing... for each instrument...

It's not so much overhead...

Good Trading !!
HyperScalper


 
 Post subject: Re: Getting all opened JForex platform charts Post rating: 0   New post Posted: Tue 09 Jul, 2013, 20:26 
User avatar

User rating: 98
Joined: Mon 23 Jul, 2012, 02:02
Posts: 656
Location: United States, Durham, NC
Also, I cannot do what I actually wanted to do. In a JForex Platform Hosted Strategy...

...I wanted to setChartAutoshift() for each chart.

BUT, that's available only through IChartPresentationManager which is...
...available only in Standalone mode.

Oh, well... No big deal.

I work with Standalone, but just wanted a Simple Strategy which would set charts to the autoshifted state within the JForex platform, But... it Cannot be Done. :(

HyperScalper


 
 Post subject: Re: Getting all opened JForex platform charts Post rating: 0   New post Posted: Wed 24 Jul, 2013, 11:11 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
IContext.getCharts() which gets all opened charts, available with JForex-API 2.8.1.


 

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