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.

setColor2 - How to pass this value when adding a indicator to chart?
 Post subject: setColor2 - How to pass this value when adding a indicator to chart? Post rating: 0   New post Posted: Thu 11 Jul, 2013, 09:02 

User rating: 1
Joined: Sun 29 May, 2011, 00:00
Posts: 2
Location: Switzerland, Flüelen
Hi Support

I am trying to automatically add the EMA indicator to my chart and have the up trend in green and the down trend in red. Here my sample source

            
IIndicator emaIndicator = indicators.getIndicator("EMA");
currentChart.add(emaIndicator, new Object[] { 23 },
                  new Color[] { Color.GREEN, Color.RED },
                  new DrawingStyle[] { DrawingStyle.LINE },
                  new int[] { 2 });


this code displays only a ema in green.....

What am I missing?


 
 Post subject: Re: setColor2 - How to pass this value when adding a indicator to chart? Post rating: 0   New post Posted: Thu 11 Jul, 2013, 15:30 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
You can't set the down trend color from API, you have to do it manually.


 

Jump to:  

  © 1998-2026 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