[jav] HeikinAshized Oscillators

This script allows to HeikinAshize different commonly used centered oscillators.
It plots them like Heikin Ashi candles. In this way, we can eliminate some of the noise and uncertainty that is inherent to applying only one calculation period to the oscillators.
Applying Heikin Ashi to an oscillator might be advantageous compared to applying it directly to the chart, because you are not altering price readings. The obvious advantage is the clear visualization of the trend directions without noise.

The oscillators included are:

Apart from the choice of one of these indicators, only two more inputs are required:
  • the main (median) period and
  • the % of variability of this period.

The script calculates 4 evenly spaced periods from that data (period and variability), e.g. for a period of 50 and a variability of 30%, the script calculates oscillator values for 4 different periods evenly spaced around 50, (35, 45, 55, 65) and uses these 4 values to draw the Heikin Ashi candle.

The script also plots the usual upper/lower (overbought/oversold) values, as well as the central line.

The interesting concept of applying Heikin Ashi to an oscillator was recently introduced in Tradingview by @JayRogers . Many thanks for the idea.
For Heikin Ashi calculations, the useful script by @allanster was taken as a reference.
Any improvements, modifications or suggestions are welcome.
Mã nguồn mở

Với tinh thần của TradingView, tác giả đã xuất bản tập lệnh theo mã nguồn mở, vì thế trader có thể dễ dàng hiểu và tùy chỉnh được. Bạn có thể sử dụng miễn phí, hoặc tùy chỉnh lại mã đã được cấp phép bởi Quy tắc Chung. Bạn có thể sử dụng nó trên biểu đồ.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?

Bình luận

This is a great script - A very clean trend/oscilaltor. I wonder if you can add alert for change of bar colour from red to green and vice versa ? - That would make it very useful

I use the Fisher input. Do you like any any particular input?


Phản hồi
javabgar kamaal010
@kamaal010, thanks! I find Fisher the most useful one.
Regarding alerts, I don't use any, and have no experience in coding them, but I believe that including this lines at the end of my script could work:

alertchngcol = barColor == #ef5350 and barColor == #26a69a
alertcondition(alertchngcol, title='Alert on Green Bar', message='Green Bar!')

if alertchngcol
alert('Green Bar!', alert.freq_once_per_bar)
Phản hồi
javabgar javabgar
(last line should be 4-spaces indented)
Phản hồi
kcchin23 javabgar

Very nice scripts. TQ

there is error compile script when i try to add the alert lines above?
Phản hồi
Very nice thanks
Phản hồi
javabgar pricechart1336
@pricechart1336, you are welcome!
Phản hồi