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

Getting all opened JForex platform charts
http://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=96&t=49569
Page 1 of 1

Author:  hyperscalper [ Tue 09 Jul, 2013, 16:20 ]
Post subject:  Getting all opened JForex platform charts

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

Author:  CriticalSection [ Tue 09 Jul, 2013, 18:43 ]
Post subject:  Re: Getting all opened JForex platform charts

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)

Author:  hyperscalper [ Tue 09 Jul, 2013, 20:13 ]
Post subject:  Re: Getting all opened JForex platform charts

Thanks so much. That is what I am doing... for each instrument...

It's not so much overhead...

Good Trading !!
HyperScalper

Author:  hyperscalper [ Tue 09 Jul, 2013, 20:26 ]
Post subject:  Re: Getting all opened JForex platform charts

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

Author:  API Support [ Wed 24 Jul, 2013, 11:11 ]
Post subject:  Re: Getting all opened JForex platform charts

IContext.getCharts() which gets all opened charts, available with JForex-API 2.8.1.

  Page 1 of 1