Heikin Ashi on Thinkorswim Mobile App


Category:
0
0

Hello,

Thinkorswim doesn’t have an option for Heikin Ashi candles on its mobile app and I was wondering if you could help me create an indicator that turns green when the candle is a green heikin Ashi and turns red when HA is red. Thanks Hahn!

Marked as spam
Posted by (Questions: 2, Answers: 2)
Asked on October 8, 2018 6:11 am
1747 views
0
Private answer

Right, so there is no way for the mobile app to recognize code that attempts to paint the color of the candles. The work around, as you have hinted, is the create an indicator that displays it in some other way.

I have experimented with designing mobile apps for Thinkorswim. I have found that even trying to dynamically set the color based on some condition is not possible. The mobile apps selects its own colors, just because.

So this code plots as a lower study. It’s plots as a histogram. We don’t bother assigning any colors here because the mobile app will just ignore them. On a desktop chart this indicator will plot all one color. However on the mobile app it will paint the histogram bars green when above zero and red when below zero.

At this point in Thinkorswim’s technology, this is the best we can do. Here is the code, followed by a screenshot showing the result.

declare lower;
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));
plot trend = if haClose > haOpen then 1 else if haClose < haOpen then -1 else 0;
trend.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);

 

Attachments:
Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on October 8, 2018 7:50 am
0

That’s fantastic, thanks so much Hahn! I tested it out on my mobile and it works.

I was wondering if I could take this a step further and tie this indicator to just a daily chart. How would I go about this? My idea is that I’d like to know what the color of the daily heikin Ashi candle is showing while looking at a 30-min timeframe. I’m looking at implementing an alert on the 30-min, but only want to be alerted if the HA on the daily is either green or red. Any ideas?

( at October 8, 2018 2:21 pm)
0

Sorry, that is not supported in the mobile app at this time. This is what we call a secondary aggregation. Trying to reference a higher time frame a smaller time frame chart. You can do this in the desktop version but not in the mobile version.

( at October 8, 2018 3:06 pm)