stocksniper
Member
Does anybody know how to scan for Heikin Ashi Doji candles? Any help is greatly appreciated.
def c = OHLC4;
def o = (open[1] + close[1]) / 2;
# commented out to save calculations as these are part of the HA calculation, but not needed for this scan:
# def L = min(min(low, open), close);
# def h = max(max(high, open), close);
plot doji = if o == c then 1 else double.nan;
def c = OHLC4;
def o = (open[1] + close[1]) / 2;
# commented out to save calculations as these are part of the HA calculation, but not needed for this scan:
# def L = min(min(low, open), close);
# def h = max(max(high, open), close);
plot doji = if o == c then 1 else double.nan;
plot doji = if c >= (o - 0.005 * o) and c <= (o + 0.005 * o) then 1 else double.nan;
It is a scan, not a plot intended to use on a chart. Changing the type of candle for your plot is done through the chart settings, not this code.Hey guys,
Still having trouble with this code. Seems to plot using regular candles instead of heiken ashi candles.
It is a scan, not a plot intended to use on a chart. Changing the type of candle for your plot is done through the chart settings, not this code.
-mashume
There are several threads around that make use of the AddChart() function, though it is not officially supported (read: it may disappear at any time). You can use the values from this study and that function to add HA candles on another chart:It won't help if I am looking for a HA doji and getting a regular bar chart doji. Thanks for trying.
def c = OHLC4;
def o = (open[1] + close[1]) / 2;
def L = min(min(low, open), close);
def h = max(max(high, open), close);
AddChart( high = h,
low = L,
open = o,
close = c,
type = iChartType.BAR;,
growColor = color.gray,
fallColor = color.gray,
neutralColor = color.gray
);
[/cpde]
not that the candle colours don't actually work. You get one colour and that's it.
-mashume
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
I | Heikin-Ashi Moving Average Labels | Questions | 0 | |
T | Heikin Ashi overlay | Questions | 1 | |
Heikin Ashi Calcualtion | Questions | 1 | ||
R | scanning for red heikin ashi candle? | Questions | 1 | |
C | How to get my strategy to recognize Heikin Ashi Candles | Questions | 1 |
Start a new thread and receive assistance from our community.
useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.
We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.
If you are new, or just looking for guidance, here are some helpful links to get you started.