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.

How to catch the change of indicator's output color?
 Post subject: How to catch the change of indicator's output color? Post rating: 0   New post Posted: Thu 26 Jun, 2014, 00:21 
User avatar

User rating: 0
Joined: Wed 11 Jun, 2014, 02:23
Posts: 13
Location: CanadaCanada
My indicator draws the lines and graphical objects. I can edit manually the outputs color from the properties of indicator. Can I catch the event of change outputs color in the code to change the color of graphical objects to the same color?


 
 Post subject: Re: How to catch the change of indicator's output color? Post rating: 0   New post Posted: Thu 26 Jun, 2014, 08:08 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
See: IChart.getIndicatorApperanceInfos() and IIndicatorAppearanceInfo.getOutputColors(), see a usage example in our wiki: https://www.dukascopy.com/wiki/#Add_indicators_on_chart
Note that you can't "listen" to the color change, however, you can check for the color change with a certain interval.


 
 Post subject: Re: How to catch the change of indicator's output color? Post rating: 0   New post Posted: Thu 26 Jun, 2014, 18:33 
User avatar

User rating: 0
Joined: Wed 11 Jun, 2014, 02:23
Posts: 13
Location: CanadaCanada
API Support wrote:


Are you sure that getIndicatorApperanceInfos method is accessible from IIndicator inerface?

API Support wrote:
Note that you can't "listen" to the color change, however, you can check for the color change with a certain interval.


This solution to wait for new tick to change the color of chart objects looks imperfect. ;)
Ok. It seems that I need to request for new method to IIndicator interface like setOptInputParameter.


 
 Post subject: Re: How to catch the change of indicator's output color? Post rating: 0   New post Posted: Fri 27 Jun, 2014, 08:42 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
RickD wrote:
Are you sure that getIndicatorApperanceInfos method is accessible from IIndicator inerface?
No, indicators are not designed to control visual properties of other indicators.


 
 Post subject: Re: How to catch the change of indicator's output color? Post rating: 0   New post Posted: Fri 27 Jun, 2014, 18:01 
User avatar

User rating: 0
Joined: Wed 11 Jun, 2014, 02:23
Posts: 13
Location: CanadaCanada
API Support wrote:
RickD wrote:
Are you sure that getIndicatorApperanceInfos method is accessible from IIndicator inerface?
No, indicators are not designed to control visual properties of other indicators.


Ok. Don't you think to add some extended functionality to IIndicator interface?


 
 Post subject: Re: How to catch the change of indicator's output color? Post rating: 0   New post Posted: Mon 30 Jun, 2014, 11:10 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
We already explained that indicators are not design for such purposes. Consider writing a strategy for this.


 
 Post subject: Re: How to catch the change of indicator's output color? Post rating: 0   New post Posted: Mon 30 Jun, 2014, 17:46 
User avatar

User rating: 0
Joined: Wed 11 Jun, 2014, 02:23
Posts: 13
Location: CanadaCanada
API Support wrote:
We already explained that indicators are not design for such purposes. Consider writing a strategy for this.


Sorry. In my opinion this is wrong concept to write the strategy instead of the indicator because it does not trade. I will keep it as the indicator.


 
 Post subject: Re: How to catch the change of indicator's output color? Post rating: 0   New post Posted: Fri 25 Jul, 2014, 00:27 
User avatar

User rating: 1
Joined: Mon 04 Mar, 2013, 10:46
Posts: 15
Location: Australia, Leichhardt
I would try downloading the jforex API which includes the source java code for the standard indicators, then modify the indicator you want to do what you want when ever the state happens that currently only changes a colour.

I have modified some of the standard indicators my self so I can tell you that its very possible.


 

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