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.

Change of candles colours in Heikin-Ashi indicator
 Post subject: Change of candles colours in Heikin-Ashi indicator Post rating: 0   New post Posted: Wed 23 May, 2012, 07:54 

User rating: 0
Joined: Wed 05 Oct, 2011, 08:56
Posts: 16
Location: Singapore,
Can someone please explain to me how I can change the candles colour in the built-in Heikin-Ashi indicator?

Thanks!


 
 Post subject: Re: Change of candles colours in Heikin-Ashi indicator Post rating: 0   New post Posted: Wed 23 May, 2012, 08:04 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
replace in line 115:
Color fillColor
with
Color fillColor = candle[OPEN] > candle[CLOSE] ?  Color.RED : Color.GREEN;
remove in next 5 rows:
fillColor = new Color(252, 239, 150);
and
fillColor = new Color(7, 139, 248);


 
 Post subject: Re: Change of candles colours in Heikin-Ashi indicator Post rating: 0   New post Posted: Wed 23 May, 2012, 19:21 

User rating: 0
Joined: Wed 05 Oct, 2011, 08:56
Posts: 16
Location: Singapore,
Thanks a lot! Now, if only I could figure out how to de-register the existing HA indicator in the system and register the one that I have just modified?


 
 Post subject: Re: Change of candles colours in Heikin-Ashi indicator Post rating: 0   New post Posted: Wed 23 May, 2012, 20:09 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
You can not deregister the original indicator. You need to rename the customized indicator, say to HeikinAshi2 (see in onStart the IndicatorInfo assignment). And the you just open it in the Workspace panel under the Custom Indicators folder by selecting Open Indicator.


 
 Post subject: Re: Change of candles colours in Heikin-Ashi indicator Post rating: 0   New post Posted: Thu 24 May, 2012, 10:16 

User rating: 0
Joined: Wed 05 Oct, 2011, 08:56
Posts: 16
Location: Singapore,
Thank you! The indicator name in line 31 (public class HeikinAshiIndicator2 implements IIndicator, IDrawingIndicator {)" needs to be changed, too, or so I believe after trying to solve the "cannot compile" problem. It also turns out that the cache needs to be cleared and only after a restart of the platform does the indicator show up as intended.

Thanks!


 

Jump to:  

  © 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