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.

Few Query about IChartObject
 Post subject: Few Query about IChartObject Post rating: 0   New post Posted: Thu 04 Feb, 2010, 21:27 

User rating: 0
Joined: Mon 25 Jan, 2010, 20:52
Posts: 13
1>How should I know if user has changed it's location, size etc.. Is there any listener to monitor ChartObject ?
I need it because we need to put price marker and when User change it we need to special work.
2>How to identify particular object. By its Text ?


 
 Post subject: Re: Few Query about IChartObject Post rating: 0   New post Posted: Fri 05 Feb, 2010, 09:01 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi
Quote:
How should I know if user has changed it's location, size etc.. Is there any listener to monitor ChartObject ?
In an ChartObjectListener interface is the function moved() (https://www.dukascopy.com/swiss/docs/api/index.htm).
Quote:
How to identify particular object. By its Text ?
In an IChart interface is the function get(String key) https://www.dukascopy.com/swiss/docs/api/index.htm.
Please consider this documentation:https://www.dukascopy.com/swiss/docs/interfaces/IChart.htm


 
 Post subject: Re: Few Query about IChartObject Post rating: 0   New post Posted: Fri 05 Feb, 2010, 23:02 

User rating: 0
Joined: Mon 25 Jan, 2010, 20:52
Posts: 13
Thats fine. But now I am facing new problem.
Case :
I opened chart for EUR/USD by double clicking Workspace->Currency->EUR/USD.
Then I ensured that EUR/USD is selected in Combobox of opened chart.
Then I created few PriceMarker and Lines.
After that, In strategy I called following code on every Tick event.
IChart chart = context.getChart(Instrument.EURUSD);
List<IChartObject> shapes = chart.getAll();
System.out.println(shapes.size()):
System.out.println(shapes):


Surprisingly, when I executed strategy, Size was printed 0 and there were no shapes in list.

Did I done any Mistake ?

Thanking you.


 
 Post subject: Re: Few Query about IChartObject Post rating: 0   New post Posted: Wed 10 Feb, 2010, 12:18 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
It's not allowed to access an objects, that are created by another strategy or user. It means that, you should draw an object from your strategy and only after that you could access it.


 

Jump to:  

cron
  © 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