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.

Possibility to get the Indicator by mouse cursor position in strategy
 Post subject: Possibility to get the Indicator by mouse cursor position in strategy Post rating: 0   Post Posted: Thu 16 May, 2013, 12:38 

User rating: 0
Joined: Tue 16 Oct, 2012, 13:10
Posts: 17
Location: Russian FederationRussian Federation
Hi! Does anyone know of the possibility to get the indicator by mouse cursor position on chart in JForex strategy?


 
 Post subject: Re: Possibility to get the Indicator by mouse cursor position in strategy Post rating: 0   Post Posted: Thu 16 May, 2013, 14:46 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Please elaborate.


 
 Post subject: Re: Possibility to get the Indicator by mouse cursor position in strategy Post rating: 0   Post Posted: Fri 17 May, 2013, 07:38 

User rating: 0
Joined: Tue 16 Oct, 2012, 13:10
Posts: 17
Location: Russian FederationRussian Federation
Suppose, we have opened EURUSD chart (M1) and placed two Moving Average indicators with different parameters on this chart, my task is to write strategy which is responsible to determine the indicator over which the mouse cursor is moved. For the simplicity: user moves the mouse cursor and strategy prints the Indicator info if the mouse cursor is placed over the indicator's curve.


 
 Post subject: Re: Possibility to get the Indicator by mouse cursor position in strategy Post rating: 0   Post Posted: Fri 17 May, 2013, 07:45 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
There is no mouse listener for indicators, but there is one for charts:
https://www.dukascopy.com/wiki/#Chart_Operations/Add_mouse_listener
And from the mouse event you can get both price and time coordinates, see:
https://www.dukascopy.com/client/javadoc/com/dukascopy/api/chart/mouse/IChartPanelMouseEvent.html
Thus you could compare those coordinates to indicator values that you would calculate also in your strategy and determine if the mouse cursor is on an indicator line or close to it.


 
 Post subject: Re: Possibility to get the Indicator by mouse cursor position in strategy Post rating: 0   Post Posted: Mon 03 Jun, 2013, 05:25 

User rating: 0
Joined: Tue 16 Oct, 2012, 13:10
Posts: 17
Location: Russian FederationRussian Federation
Chart Panel is the separate panel for indicators such as RSI, Stochastic. But can I get this for Panel with instrument prices, where such indicators are deployed as TrendEnvelopes, SAR?


 
 Post subject: Re: Possibility to get the Indicator by mouse cursor position in strategy Post rating: 0   Post Posted: Mon 03 Jun, 2013, 07:20 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
beamlight wrote:
Chart Panel is the separate panel for indicators such as RSI, Stochastic.
From API standpoint also the main chart (IChart) is a chart panel (IChartPanel), thus you can add a mouse listener to 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