Two Greens Is a 'Go'. Two Reds Is a 'Stop'

Let’s assume that it’s been established that the parameters of the Heikin-Ashi Smoothed indicator need to be reviewed before the defaults are accepted. (Which parameters you finally choose is ‘Chef’s Choice’.) If you like single-panel, no-other indicators charts, then you’re done. If you’re a perennial experimenter, then you might want to consider adding the Parabolic Time/Price indicator, a very thorough discussion of which can be found here. Parabolic SAR [ChartSchool] Though its parameters could be changed, the defaults are plenty good enough. But it’s useful to understand the math underlying the indicator.

What I like about PARTP is that it plots well with 4-period HA Smoothie, and it gives an early “heads-up” on trend changes. Here’s an instance using ENPH as an example.

If one were depending on the HA bars to turn color to get in/out, then clearly one would NOT be trying to get in the following day, Oct 25. But if one were paying attention to the signals being provided by PARTP, which had placed a green dot below prices for two days in a row, then one would be looking to buy. So, how did that signal turn out? Here’s the chart advanced by one day.

For sure, sometimes PARTP suggests exiting a position before HA Smoothies does. Here’s an example.

But how much more money was gained by hanging on to the position? (Ans: Not much) Whereas it’s easy to find examples where following PARTP’s signals meant you were exiting on the last ‘up’ bar of the trend, rather than a day or two later.

As always, don’t take my word for it or Quill’s word or anyone else’s. Do your own due-diligence by charting lots and lots of stocks and trying to find instances where the system breaks down and where it does good. If the good signals outnumber the bad signals, you’ve found an edge.



Here’s another chart that shows that a trading system based on PARTP can work.

Obviously, a lot more backtesting would need to be done, which I’m scrambling to do.


Here’s a chart done with a different charting package. The programmer says he’s using the standard defaults for SAR. But this needs to be checked, because his charts differ from Barhart’s, though the diff is manageable. Now, instead of waiting 2 bars, only one bar is waited.


Arindam, was just trying to reproduce your results this morning and ran into a couple issues including as you have listed. The first was the SAR in Thinkorswim and Stockcharts. They were a day later than yours. Tried Barcharts and got the same as I had previously in TOS. I could match, however, by changing the acceleration. Could you list what your settings in Barcharts were? Standard is (0.02, 0.2), which Barcharts changes the expression so that it is (50,5).


The other issue is the candle calculations themselves. I have done moving averages (using whatever style and interval) for the OHLC individually and then generated the HA from those values. That is also the way useThinkscript does it as well as trendtraderpro. BC references using two moving averages, but gives no calculation details. They reference a “Perfect Trend System” that is a MetaTrader program, that I have looked at. Again, I can’t sort out their actual calculations. I contacted BC Support and got a canned answer. When challenged, their support guy admitted he had no idea and passed it off to the “Development Team.” Doubt I’ll get any info from them.

Minor issues in many ways, but can make the difference of a signal or candle color.

I’ll keep digging for their actual formula.



Did some digging and found about a half-dozen ways to generate “Smoothed Heikin-Ashi” candles and charts. All called the same but with slight differences in formulation.

Found in TradeView a formulation that seems to match Barcharts and others. So, what they appear to do is as I do initially, generate moving averages for each OHLC. I calculate the Heikin-Ashi candle from that data. They appear to go on and take a moving average of the moving average of the OHLC and then generate their candles. Double smoothing. I do a subtle double smoothing, but use Valcu or Vervoort’s formula. So, the end result for Barcharts is a HA candle chart that maybe smoothed with a 4 interval, but is actually more like a 3 1/2. It can induce even color differences in some situations.

I am NOT stating one is better than the other, I am stating that you have to be aware of what you are using. Backtest and evaluate. Learn your system and indicators. With that said, I will run some checks in Excel to confirm that this indeed what is happening for the candle differences. Once I find my HA Excel test spreadsheet that is. I have no interest in rewriting that whole thing again. If it confirms, I’ll probably write the thinkscript for double smoothed Heikin Ashi for TOS and run them head-to-head.

It will all have to wait, more tree work to do this week.


1 Like


I owe you a reply for your long, thoughtful post on using ‘relative strength’, which actually comes in two versions: RS vs itself and RS vs a base symbol.

BC provides three ways to do RS against a base symbol, and a dozen or so indicators really are just measuring RS of the ticker being plotted.

Yeah, the default for SAR is (0.02, 0.20). But both parameters can be varied. When MetaStock could still be run with user-supplied data, I used to back-test variants, whose results I don’t even remember, other than to say, faster versions tended to keep one out of trouble with volatile stocks, slower versions worked well with ‘Steady-Eddie’ stocks.

No matter the formula that BC is actually using, how they plot SAR is plenty good and doesn’t need to be fussed with. The chart you couldn’t reproduce was done with with a low-cost backtester called StockAnalyze. The programmer, Sasha, is good about answering questions and fixing bugs. So when I know exactly what I would like him to change about SAR, I’ll contact him thru his forum.

What I keep seeing, though, from hand-charting a couple hundred stocks today, is that my suggested 2 greens/ 2 reds system gets the entries and exits right nearly every time. What’s a hassle is finding stocks that haven’t already made their move. But here are four that could be paper traded to test the idea: AGLE, VIRI, PEAR, LUNA.

Yeah, yeah,. They’re penny biotechs. But that sector makes fabulous moves. So I’m trying to put together a means to trade them mechanically.

1 Like

TOS - Studies and stratigies

Shared_TrendTraderPRO2 (20,no,v2, Weighted)
Shared_TrendTraderPRO (20,no,Valcu, Weighted)

Shared_TrendTraderPRO_TimeHeatmap (20,Valcu,Weighted, FIFTEEN_MIN)
Shared_TrendTraderPRO_TimeHeatmap (20,Valcu,Weighted, HOUR)
Shared_TrendTraderPRO_TimeHeatmap (20,Valcu,Weighted, FOUR_HOURS)
Shared_TrendTraderPRO_TimeHeatmap (20,Valcu,Weighted, DAY)

I am looking at SOFI and Barchart and the TrendTraderPRO software. I am using line that crisscross over the Smoothred data.

Now as you kruz on down the below, the Code is written to save you time. Find the author Aspa Trader has tried to help others.

TrendTraderPRO is Now Closed to New Customers.
If you are an existing customer, you can log in to the members area to access the indicators and video course here.

Hope the above information can be some assistance.

Quill =


Okay, first of all, thank you, but I have the code I need. The concept is straight-forward and I wrote most myself and later (a few years ago) joined UseThinkScript and found refinements. Actually, a better thread on UseThinkScript is started by BonBon, she’s an outstanding coder who had some nice refinements. UseThinkScript is very dedicated to NOT sharing copyrighted material so I truly hope you are not intending to share with anyone the “Shared_TrendTraderPro…” material. Which is very easy to do in TOS.

But you are missing the point of my post. The issue is not my code, the issue is there are TWO different formulas to calculate the candles. Barchart and UseThinkScript (same as TrendTraderPro) are different formulas/calculations and users just need to be aware of what they are using. Probably doesn’t matter a whole lot in terms of results, but it can alter short candles. Just Looking at the details to be specific.

The line that “crisscross over the Smoothed data.” is actually the price (usually using the closing price). I have found that very interesting to work with. Actually, I have played with several price EMA’s crossing an average line of the Heikin-Ashi smoothed data. It’s pretty promising but most backtest systems can’t calculate the smoothed data nor the average of the smoothed data so the best way to backtest seems to be using Excel. While I can do it, and have written most of such a spreadsheet, it’s very laborious for me and I dropped that a couple years ago. This is all prompting me to take another crack at it.

Finally, I see you have posted the heatmaps of TrendTraderPro. Again, can’t support the sharing of copyrighted material, but readers can note that there are a couple options in UseThinkScript of HA Trend Dots or bars. It’s simple code that can either print dots/bars as an indicator or in the chart space as a series of bars showing the changes in the candles. Personally, I found the use of a flexigrid and multiple time frame charts helps more. I can easily see on the chart the candle changes, it ain’t hard. More bells and whistles don’t always make things better.

Appreciate the info,

1 Like