Typical Price Combo Average with ATR Bands and Matching %TPCA Indicators For ThinkOrSwim

Jman831

Member
These are a couple of indicators I came up with that I've been practicing with using the OnDemand feature on ToS. I enjoy it a lot for scalping off of the 5 minute chart in combination with other indicators/averages. Maybe some of you will find use for it.

The first indicator on the price chart I call a "Typical Price Combo Average". I may or may not change the name to "Typical Price Combo Cloud" simply because I turned it into a clouded channel. It combines an exponential average of an exponential average of an exponential average of typical price with an average of your choosing into one average and adds ATR bands to that average. I prefer the default settings that I came up with but it's fully adjustable. The exponential factor of the typical price, the average type of the average you're combining it with, the length of the average you're combining it with, the ATR type, the ATR length, and the ATR "factor" or multiplier are all adjustable.

The second indicator at the bottom of the screenshots below I called a "Typical Price Combo Average Oscillator" but I'm thinking of calling that a "%TPCA" or a "%TPCC" instead because it is similar to the %B indicator for Bollinger Bands, but it gives a percentage based on where the high of the candle is, in relation to the upper half of the cloud if the close is above the Typical Price Combo Average, and it gives a negative percentage based on where the low of the candle is, in relation to the lower half of the cloud if the close is below the Typical Price Combo Average. Basically the red line at the top of the indicator represents the upper cloud line or 100%, the gray line in the middle represents the Typical Price Combo Average itself or 0%, and the green line at the bottom represents the lower cloud line or -100%. The histogram represents the highs and the lows in relation. It's just a way of getting a better look at where the price is in relation to the cloud. Typically when the green line is crossed (especially multiple times in a row), it's a good time to start thinking about buying, and when the red line is crossed, it's a good time to start thinking about selling.

Here are the screenshots I mentioned:

o-Average-and-Percent-TPCA-SPY-5-minute-12-16-2021.png


o-Average-and-Percent-TPCA-SPY-5-minute-12-17-2021.png


Here's the source code for the Typical Price Combo Average:

Code:
input AvgType = averageType.EXPONENTIAL;
input AvgLength = 18;
input Price = close;
input ExponentialFactor = 3;
input ATRType = averageType.SIMPLE;
input ATRLength = 9;
input ATRFactor = 2.0;

def exptypprice = ExpAverage(ExpAverage(ExpAverage((high + low + close) / 3, ExponentialFactor), ExponentialFactor), ExponentialFactor);
def movavg = MovingAverage(AvgType, Price, AvgLength);
def comboavg = (exptypprice + movavg) / 2;

def atr = MovingAverage(ATRType, trueRange(high, close, low), ATRLength);
def upchan = comboavg + atr * ATRFactor;
def lowchan = comboavg - atr * ATRFactor;

plot TypPriceComboAvg = comboavg;
plot UpperChannel = upchan;
plot LowerChannel = lowchan;

AddCloud(upchan, lowchan, color.BLUE);
TypPriceComboAvg.setDefaultColor(color.CYAN);
UpperChannel.setDefaultColor(color.LIGHT_RED);
LowerChannel.setDefaultColor(color.LIGHT_GREEN);

And here's the source code for the %TPCA:

Code:
declare lower;

input AvgType = AverageType.EXPONENTIAL;
input AvgLength = 18;
input Price = close;
input ExponentialFactor = 3;
input ATRType = AverageType.SIMPLE;
input ATRLength = 9;
input ATRFactor = 2.0;

def exptypprice = ExpAverage(ExpAverage(ExpAverage((high + low + close) / 3, ExponentialFactor), ExponentialFactor), ExponentialFactor);
def movavg = MovingAverage(AvgType, Price, AvgLength);
def comboavg = (exptypprice + movavg) / 2;

def atr = MovingAverage(ATRType, TrueRange(high, close, low), ATRLength);
def upchan = comboavg + atr * ATRFactor;
def lowchan = comboavg - atr * ATRFactor;

def priceper = if (close - comboavg) / (upchan - comboavg) > 0 then (high - comboavg) / (upchan - comboavg) * 100 else (low - comboavg) / (comboavg - lowchan) * 100;

plot OneHundred = 100;
plot Zero = 0;
plot NegativeOneHundred = -100;
plot PricePercentage = priceper;

OneHundred.setDefaultColor(color.LIGHT_RED);
Zero.setDefaultColor(color.GRAY);
NegativeOneHundred.setDefaultColor(color.LIGHT_GREEN);
PricePercentage.setPaintingStrategy(paintingStrategy.HISTOGRAM);
PricePercentage.assignValueColor(if priceper > 0 then color.GREEN else color.RED);

Hopefully my contribution will find use among some of you. Good luck and happy trading!

Oh and if you come up with any settings that you like especially or have any input on the indicators, please let me know!
 
Last edited:

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
396 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top