$VOLSPD Oscillator (S&P Squeeze Alert)

Hi there,

I'm not an expert by any means, but I am working on a project to aid a very specific strategy that requires a very specific setup. The asset I am trading relies heavily on market internals, primarily SPX. Success is currently being back-tested in a journal, and I don't have enough results to claim this strategy works in all market conditions; which is why I'm looking to develop a tool (or perhaps gain insight on already existing tools). I am excited with what I would deem preliminary results have provided so far.

I apologize for any confusion this may bring, as I'm not quite a technician by any means. I'm using the best of my current knowledge in an entry and exit on a particular strategy. I hope this doesn't come off the wrong way!

What I am attempting to do is convert $VOLSPD into an oscillator that works similarly to how you would graphically view MACD & SqueezePro/TTM_Squeeze. Now $VOLSPD on a greater timeframe (e.x. 1y 1d chart) already operates as an oscillator, even though intraday will display a trend. It needs a zero-line and the bars would show up and down volume on $VOLSPD much like what you would see with TTM, MACD, DMI Oscillator, etc. I think for this to work you need to do $VOLSPD/10000000 which then gives it a range of double digits as opposed to...many digits $VOLSPD shows by default.

Okay, so we get $VOLSPD functioning as an oscillator, cool. The next step is we need to compile a couple key signals that would be provided by something else. The signals would be derived from when the Bollinger Bands enter the 1, 2, and 3 factorial Keltner Channels on a 5 minute chart (however if it's possible to automatically adjust to your timeframe that would be great). For summary purposes, we would essentially be replicating the "dots" that are on the zero line with TTM_Squeeze.

Lastly $TICK expressed as a line on the oscillator, basically a way to graphically view $TICK converging and diverging with $VOLSPD.
 
Last edited by a moderator:
Hi there,

I'm not an expert by any means, but I am working on a project to aid a very specific strategy that requires a very specific setup. The asset I am trading relies heavily on market internals, primarily SPX. Success is currently being back-tested in a journal, and I don't have enough results to claim this strategy works in all market conditions; which is why I'm looking to develop a tool (or perhaps gain insight on already existing tools). I am excited with what I would deem preliminary results have provided so far.

I apologize for any confusion this may bring, as I'm not quite a technician by any means. I'm using the best of my current knowledge in an entry and exit on a particular strategy. I hope this doesn't come off the wrong way!

What I am attempting to do is convert $VOLSPD into an oscillator that works similarly to how you would graphically view MACD & SqueezePro/TTM_Squeeze. Now $VOLSPD on a greater timeframe (e.x. 1y 1d chart) already operates as an oscillator, even though intraday will display a trend. It needs a zero-line and the bars would show up and down volume on $VOLSPD much like what you would see with TTM, MACD, DMI Oscillator, etc. I think for this to work you need to do $VOLSPD/10000000 which then gives it a range of double digits as opposed to...many digits $VOLSPD shows by default.

Okay, so we get $VOLSPD functioning as an oscillator, cool. The next step is we need to compile a couple key signals that would be provided by something else. The signals would be derived from when the Bollinger Bands enter the 1, 2, and 3 factorial Keltner Channels on a 5 minute chart (however if it's possible to automatically adjust to your timeframe that would be great). For summary purposes, we would essentially be replicating the "dots" that are on the zero line with TTM_Squeeze.

Lastly $TICK expressed as a line on the oscillator, basically a way to graphically view $TICK converging and diverging with $VOLSPD.

This may help you get started

Capture.jpg
Ruby:
declare lower;

#$Tick Normalized to $Volspd-------------------------------------------
#$TICK shown as a histogram with periods where no current data available, prior data used to plot it

script normalizePlot {
    input data      = close;
    input newRngMin = -.2;
    input newRngMax = .2;
    def hhData      = HighestAll( data );
    def llData      = LowestAll( data );
    plot nr = ((( newRngMax - newRngMin ) * ( data - llData )) / ( hhData -
llData )) + newRngMin;
}

input newRngMax = 100000000;
input newRngMin = -100000000;

def t           = if IsNaN(close("$TICK")) then t[1] else close("$TICK");
plot tick       = normalizePlot(t, newRngMin, newRngMax);
tick.SetDefaultColor(Color.MAGENTA);
tick.SetLineWeight(2);

#$VOLSPD -------------------------------------------------------------------------
#$VOLSPD shown as a histogram, colored like MACD, with periods where no current data available, prior data used to plot it

def vspd    = if IsNaN(close("$VOLSPD")) then vspd[1] else close("$VOLSPD");
plot volspd = vspd;
volspd.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
volspd.DefineColor("Positive and Up", Color.GREEN);
volspd.DefineColor("Positive and Down", Color.DARK_GREEN);
volspd.DefineColor("Negative and Down", Color.RED);
volspd.DefineColor("Negative and Up", Color.DARK_RED);
volspd.AssignValueColor(if volspd >= 0 then if volspd > volspd[1] then volspd.Color("Positive and Up") else volspd.Color("Positive and Down") else if volspd < volspd[1] then volspd.Color("Negative and Down") else volspd.Color("Negative and Up"));


#Squeeze Added to zero line shown as white dot ----------------------------------------
plot zero         = 0;
input showsqueeze = yes;
def bbupper       = reference BollingerBands(length = 20, "average type" = "EXPONENTIAL").UpperBand;
def kcupper       = KeltnerChannels(length = 15, "average type" = "EXPONENTIAL", "true range average type" = "EXPONENTIAL").Upper_Band;
def Squeeze       = bbupper - kcupper < 0;
plot Squeezeplot  = if showsqueeze and Squeeze then zero else Double.NaN;
Squeezeplot.SetDefaultColor(Color.WHITE);
Squeezeplot.SetPaintingStrategy(PaintingStrategy.POINTS);
Squeezeplot.SetLineWeight(5);
Squeezeplot.HideBubble();
 
Last edited by a moderator:

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

This may help you get started
Hi Sleepy,

thanks for for this indicator, just wanted to check is it possible to make this oscillator work for $ADSPD as well but without normalization. Since ADSPD is for stocks in SnP the max values would only be +500 & -500. Can you please let me know what changes I need to make in the above indicator to make it for ADSPD. thanks in advance.
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
593 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