Co-Founder Admin

TSABM or Time Spent Above/Below the Mean

We adopted a time based exhaustion indicator based on the mean, or in this case, the simple moving average. We know for a fact that moving averages should not be used in a consolidating market because it will lead to a lot of whipsaws, however, we want to see if there is a particular pattern in how many days it can trade above/below the mean before becoming exhausted and perform a reversal.

Please do your own back testing. Some customization ideas:

  • a different mean formula such as EMA, ALMA, etc (this example uses SMA)
  • a different timeframe (this example uses 30 days)
  • a different exhaustion point (this example uses 15 days)
  • add a secondary buy/sell parameter

Important: I don't think this can stand as a standalone indicator but can complement current strategies by providing the trader a sense of awareness of a possible exhaustion moves based on time. Intuitively, we know this will lose you money in a downtrend but can be useful during sideways to weak uptrends. I doubt the trader will get good signals during strong uptrends where prices don't really stay below the mean for extended periods.

You can find the formula below:

//Time Spent Above/Below the Mean
//Time Based Trend Exhaustion

set sma = sma(close,30)
set up=countifs(close>sma, close<sma)
set down = countifs(close<sma,close>sma)
set count = up - down
set sell = count >15
set buy = count < -15


This topic was modified 2 months ago 2 times by Mike
Topic starter Posted : 28/05/2021 12:28 pm
Co-Founder Admin

Made even better with 5 day RSI 😀 


Topic starter Posted : 28/05/2021 12:46 pm