Login Page - Create Account

Support Board


Date/Time: Sun, 26 May 2024 13:41:07 +0000



[Programming Help] - Color Bars based on Heikin Ashi

View Count: 2597

[2016-11-09 22:55:58]
User513959 - Posts: 16
Hi Ive attempted to try and accomplish this myself with "Color bars based on alert" but have not been successful.

Is there a way to color regular candlestick bars based on the Heikin Ashi formula. Basically would go like this;

HA bar is green + Candle closes green = green solid candlestick
HA bar is green + Candle closes red = green hollow candlestick

Inverse for red HA bars.

Essentially Im looking to combine the trend follow characteristics of HA bars with real OHLC of regular candles.

Thanks,
Stefan
[2016-11-10 00:20:44]
Sawtooth - Posts: 4009
Try this:

You'll need 4 instances of the Color Bar Based On Alert Condition study, one for each combination.
You'll need to set the Chart >> Chart Settings >> Main Setting tab >> Graph Draw Type to Candlestick Bars Hollow.

Use these formulas and Draw Styles, respectively, in each color bar study:

HA green, candle green:
=AND(ID1.SG1<ID1.SG4,O<C)
Color Bar (use same green as in Graphics Settings)

HA green, candle red:
=AND(ID1.SG1<ID1.SG4,O>C)
Color Bar Hollow (use same green as in Graphics Settings)

HA red, candle red:
=AND(ID1.SG1>ID1.SG4,O>C)
Color Bar (use same red as in Graphics Settings)

HA red, candle green:
=AND(ID1.SG1>ID1.SG4,O<C)
Color Bar Hollow (use same red as in Graphics Settings)

Notes:
-Above formulas assume the HA study is ID1. Edit as needed.
-Above assumes the HA study is not set to Display as Main Price Graph
[2016-11-10 01:51:49]
User513959 - Posts: 16
Amazing! Thank you!

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account