Wiki
JStore
Search
Login
Dukascopy Support Board
Automated Trading
Knowledge Base
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
.
Pages: [ 1 ]
Print view
IChart in a Standalone software
Sacha68
Post subject:
IChart in a Standalone software
Post rating:
0
Posted:
Tue 19 Mar, 2013, 17:12
User rating:
0
Joined:
Wed 18 May, 2011, 21:14
Posts:
4
Location:
Switzerland, Biel
Hi support,
After a successful connection I would like to insert a JPanel with a graph on my basis JFrame
I use this code :
private void startStrategy() throws Exception {
final int frameWidth = 1000;
final int frameHeight = 600;
final int controlPanelHeight = 50;
// subscribe to the instruments
final Instrument[] instrArr = new Instrument[] { EURUSD };
Set<Instrument> instruments = new HashSet<Instrument>(Arrays.asList(instrArr));
logger.info("Subscribing instruments...");
client.setSubscribedInstruments(instruments);
logger.info("Start strategy...");
client.startStrategy(new StrategyPublicMethods());
logger.info("Open chart...");
IFeedDescriptor feedDescriptor = new FeedDescriptor();
feedDescriptor.setDataType(DataType.TICKS);
feedDescriptor.setInstrument(Instrument.EURUSD);
IChart chart = client.openChart(feedDescriptor);
final IClientGUI clientGUI = client.getClientGUI(chart);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
clientGUI.getChartPanel().setPreferredSize(new Dimension(frameWidth, frameHeight - controlPanelHeight));
clientGUI.getChartPanel().setMinimumSize(new Dimension(frameWidth, 200));
clientGUI.getChartPanel().setMaximumSize(new Dimension(Short.MAX_VALUE, Short.MAX_VALUE));
getContentPane().add(clientGUI.getChartPanel());
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
client.closeChart(clientGUI.getChart());
}
});
}
});
}
The graph does not appear. What is the problem?
Thanks
Sacha
API Support
Post subject:
Re: IChart in a Standalone software
Post rating:
0
Posted:
Tue 19 Mar, 2013, 18:48
User rating:
∞
Joined:
Fri 31 Aug, 2007, 09:17
Posts:
6139
Consider starting from the following example program and integrate your logic into it:
https://www.dukascopy.com/wiki/#JForex_SDK/Open_a_chart_from_IClient
Pages: [ 1 ]
Display posts from previous:
All posts
1 day
7 days
2 weeks
1 month
3 months
6 months
1 year
Sort by
Author
Post time
Subject
Ascending
Descending
Dukascopy Support Board
Automated Trading
Knowledge Base
Jump to:
Select a forum
------------------
Visual JForex
English
Feature Requests
Report a bug
Français
Demandes de nouvelles fonctionnalités
Signaler un problème
Deutsch
Verbesserungsvorschläge
Fehlerberichte
العربية
إقتراحات جديدة
تقارير الأخطاء
Pусский
Заказ нового функционала
Репорты об ошибках
中文
功能要求
报告错误
Forex Community
Community Board
Contests
Trader Contest
Strategy Contest
Dukascopy Products and Services
Fundamental Analysis Contest
Article Contest
Trading Platforms
JForex
FAQs
Feature Requests
Bug Reports
Automated Trading
Knowledge Base
Feature Requests
Implemented Requests
Bug Reports
Fixed Bugs
Fixed Issues
Release Notes
Previos Versions
© 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