Modifying Quill's Simon Sez System

In some versions of Quill’s Simon Sez trading systems a pair (or a triplet) of moving averages is included. He favors 13/50. But I find that pair doesn’t backtest any better than many other fast-slow variants. In other versions of SS, he uses the widely used triplet of 50, 100, 200 to estimate favorable/unfavorable market conditions (as does Weinstein). But I think that makes for a very cluttered chart.

As everyone knows, moving averages (MAs) come in many versions: simple, weighted, exponential, double exponential, Hull, etc. They differ from one another according to the weighting of the components of the series used to calculate the average and the extent to which the average is smoothed. Almost any MA type can be forced to provide nearly the same signals as any other MA type simply by adjusted the lookback period over which it is calculated. Some lookback periods are favored over others. But unless rigorous backtesting is done, the choices are arbitrary. As with choosing which fishing lure to cast, choosing which MA to plot is a matter of preference and habit with the upside being that what one uses frequently is likely to be effective simply because it’s what one gets used to using.

My favorite MA type is the triangular MA, because I like the swoopy curves creating by giving more weight to the middle potion of the time-prices series from which the MA is calculated than to the most recent prices, as is done with weighed and exponential MAs. But as I said, the choice of MA type and lookback period are arbitrary unless one has done the backtesting to prove otherwise. Anecdotally, a 5-period Triangular MA gets me in and out of trades close enough to the bottom and to the top, most of the time, to never need changing out to something faster, slower, or better. I’ve expermented with using pairs of trianular MAs. But I dislike the clutter created by plotting a second line and prefer the signals created by price crosing over/under a single MA than the signals created when a faster MA crosses over/under a slower one. Again, this is yet another ‘Chef’s Choice’.

Now comes the part where things get complicated. If one is trading off of HA bars (Heikin Ashi) , one is never dealing with exact prices, but a smoothing of them. If one is applying MAs to a plot based on HA bars, then that introduces yet another level of abstraction and inexactness which can raise this question, “Did a ‘Buy’ or ‘Sell’ signal occur or not?” Here’s a chart that illustrates that problem.

Look at the dogi in the first third of the chart. If one is using ‘price crossing the MA’ as the signal, then no signal has occured, right? Same-same the following day. But now look at a chart done with hollow candles.

Huge diff, right?

Retrospectively, the smoothed version of prices, aka, HA bars, kept one in the trend IF one is only using crossovers for signals. The unsmoothed version, aka, hollow candles, had one getting out at the open on the 15th on a day of rising prices but missing out on four further days of gains. Given that one can’t trade yesterday’s market, a decision has to be made between the two chart formats and their implied rule sets. Dojis are important, and there are plenty of studies that confirm their usefulness and reliablity as trading signals. Therefore, I’d make this compmise.

Plot wirh HA bars (to retain their greater trend clarity) and use crosses of price over a 5-period triangular MA UNLESS a clear doji is printed. In which case, GET OUT at the next day’s open.

I haven’t done the backtesting needed to justfy that rule, nor do I intend to. From looking at lots and lots of charts, it simply is what makes sense for the Chicken Little trader I am to do.

Charlie

3 Likes

what is triangular MA - I looked up in stockcharts but could not find it

bridge,

StockCharts offers only a limited palette of MA types. Go to BarChart.

Here’s a plot of five types of MAs, all with a 10-priod lookback.

Pink, Simple
Blue, Triangular
Green, Exponential
Purple, Hull
Red, Weighted

By adjusting the lookback period, most MAs can be forced to provide (roughly) the same signals as any other MA type. So which is chosen depends more on “aesthetics” than “accuracy”. The most “graceful” (and useful) of them is the triangular for its swoopy curves. (IMHO, 'natch.)

2 Likes

Bridge,

Triangular Moving average is basically the simple moving average of the simple moving average. Often referred to as “Double Smoothed Simple MA.”

You calculate the SMA by adding the closing values for n periods of data and dividing by n, or simply put, you average it. For the TriMA, you add the SMA values for the same n periods and divide by n, or average those SMA’s.

One of the easier ones to calculate.

Lakedog

1 Like

Lake,

Your explanation of how a triangular MA is calculated is wrong.

“The TMA is calculated by taking an average of the price data not just in a fixed period as in simple moving averages, but in a triangular weighting system. This triangular weighting gives more weight to prices in the middle of the period and less weight to prices at the beginning and end of the period, creating a smoother average line.”

Read more at: https://stlplaces.com/blog/a-complete-guide-to-triangular-moving-average-tma

1 Like

Interesting…I stand corrected. That is what I get from looking at and trusting Barchart:

https://www.barchart.com/education/technical-indicators/moving_average_triangular

They make a slight reference to a weighting (without any details), but show formulas doing the calculations exactly as I stated: simple MA of the SMA

The triangular moving average (TMA) is a weighted average of the last n prices (P), whose result is equivalent to a double smoothed simple moving average:
SMA = (P1 + P2 + P3 + P4 + … + Pn) / n
TMA = (SMA1 + SMA2 + SMA3 + SMA4 + … SMAn) / n

Actually, from TOS:

The Triangular Moving Average (TMA) is a study calculated as double-smoothed simple moving average (or SMA of SMA) of the price. The moving average is calculated for an interval being a half of the selected time period. This way, the emphasis is placed on the middle of the time period selected.

They make reference to a weighting, but fail to clarify the technique in their learning center. However, pulling out from their thinkscript it seems they use:

effectiveLength = Ceil((length + 1)/2)

So “n” period of 5 becomes 3; 8 becomes 5; 13 becomes 7; etc

They appear to use the changed period length for both the SMA then the SMA of the SMA. So I’m mostly right, just need to alter the length.

How do you calculate it Arindam??

Lakedog

PS Geez, went back to my Excel files for some old backtesting I did a decade or so ago and what-do-you-know, I created the right formula back then! SMA of the SMA with an adjusted period. Alzheimer’s, it really sucks!!

2 Likes

Lake,

I don’t see how doing a SMA of an SMA would get to a Triangular MA. But a weighting scheme would, which is what EMAs use, only they over-weight the most recent prices, not the middle ones.

In general, I don’t look at the formulas used to calculate the various technical indicators. I just plot them and --maybe-- tweak the existing parameters. But more and more, I’m tending to run bare bones charts, just Price and Volume.

Charlie

1 Like

Charlie,
The weighting is using by using a shorter “N” or length/period number yet calling it the original longer period value.

I don’t disagree it feels a little screwy, but that is the formula. Wanting to be diligent, I tracked it down in another non-stock statistical/math formula reference that gives me a formula identical to the one in TOS as further confirmation. It is also what I tracked down some years ago, just hadn’t remembered.

The funny aspect is because you are just changing the period basically, then the Triangular MA values for a TMA of 8 are actually just the SMA of the SMA of 5 (since N=(8+1)/2, rounded to the highest integer, or 5). That’s the “Ceil” command in thinkscript.

I have been spending hours building some other back-testing excel spreadsheets and was just adding Triangular MA fields when this came up. Building them based upon what I have already said, the values I get are identical to values generated in TOS. That’s using QQQ OHLC data since inception in 1999. I get identical values for TMA’s in 2023. A problem would have been amplified.

That still doesn’t clarify and ease the gut reaction, but it is the data. Happy to entertain any other reference or thought.

Lakedog
Who usually tries to stick to EMA’s or SMA’s

1 Like

Lake,

If that’s the math, then that’s the math, and I’m too lazy to challenge it.

I will say this though. I think SMAs and EMAs are all but useless except for very limited purposes and are inferior to weighted MAs (which Schwab’s charts will plot.) But all of them are beat by ‘triangular’ in terms of the crispness of the crossovers they create while not getting yanked around frantically by what amounts to just noise in the signal.

I’ll freely admit that’s more of an aesthetic judgment on my part than the product of backtesting. But in the course of a day, I’m easily looking at a couple hundred charts, and I don’t want to waste my time with ugly ones.

Maybe it’s my boat-building background stepping into the foreground. I want charts that look good and speak clearly, not the jumble of lines others tolerate.

Charlie