Heikin Ashi MTF and EMA alerts


Category:
0
0

Hey Hahn,

I’m looking at creating an alert system in TOS that alerts me when heikin ashi candles on a daily chart are green (up) or red (down) and price on a 30-min chart hits the 100-day EMA. I’ve looked at a few articles on the site here about how to do MTF scans and am having issues since the heikin ashi study I’m using (the one you helped create in a couple posts ago about heikin ashi mobile) isn’t available in the scans section. I was hoping I could do a scan where if the heikin ashi mobile study is over 0.50 (green on daily), then I could look for a 100-day EMA test on the 30-min from there. It doesn’t seem to work for me though. Do you know any work arounds for this? Thanks as always!

Marked as spam
Posted by (Questions: 2, Answers: 2)
Asked on October 9, 2018 9:33 am
404 views
0
Private answer

Need to clear up a couple things first. From your first post I understand you were working on a chart study that would work on the mobile app. It seems for this post you are working on the desktop version. Because that is the only place you can create scans. Just so we are clear on this.

The code from the previous post is not the best suited for scans. I suggest you use the code posted here: https://www.hahn-tech.com/ans/two-consecutive-green-heikin-ashi-candles/

Posting that code here for convenience. The only thing different here is this code is requiring two consecutive green Heikin-Ashi candles. Whereas you only require one.

def haClose = ohlc4;
def haOpen = if haOpen[1] == 0 then haClose[1] else (haOpen[1] + haClose[1]) / 2;
def haHigh = Max(high, Max(haClose, haOpen));
def haLow = Min(low, Min(haClose, haOpen));
def haColor = haClose > haOpen;
def trendUp = haColor and haColor[1] and !haColor[2];
plot scan = trendUp;

So we just need to modify this a bit. We take this line of code right here:

def trendUp = haColor and haColor[1] and !haColor[2];

and change it to this:

def trendUp = haColor;

That all you need to change. Just replace that line of code with the modification I provided. You will add this to your scan as a Study Filter. And you will set the time frame Daily.

The 100 ma part is a built in Study Filter. So I assume you have that part handled. When you run into issues, break things down into pieces. Then study the results. Over time you will learn what each piece is doing. Only then can you understand how to combine them to get a specific result.

Good luck and have fun!

Marked as spam
Posted by (Questions: 37, Answers: 4086)
Answered on October 9, 2018 1:45 pm