Savage Oscillator for ThinkorSwim

FateOwnzYou

Active member
VIP
VIP Enthusiast
I have made a Momentum Oscillator that I have tried to make it to where it gets you in an out as quickly as possible. It is basically a Bearish Line and Bullish line that will cross depending on price action.

Sensitivity: You can change Sensitivity to whatever suits your trading method. At default I have it set to 1, but ive come to realize that some prefer 3 or 4 to get a smoother line and less consolidation signals. The Higher the number, the smoother it will get, but also the more delayed it will be

Price Color: Yes or No, this will change the color of the price action to show trends. Green up, Red down

Reversal Warning Candle: This will change the color of price action of JUST the candles that are overbought or oversold on the oscillator. These indicate potential reversals. Once the blue goes away is about the time to enter

Reversal Warning: This is the setting that will change the sensitivity of the reversal signals. You will set this setting from 1 to 10. 1 being the weakest and most signals, 10 being the strongest and minimal signals. I have defaulted this to 8. I would recommend 7 to 9 depending on what you want.

Below The pictures I have the Main Script that will give you the lower oscillator, along with option of changing candle color for trends and reversals.
Then a standalone Arrow indicator that will show just the arrows for the reversals
Then I will also have a Script JUST for Candle color change.

EDIT: I have also just added a full upper version for the reversals on price action. When approaching the outer walls could be nearing a reversal.
It has the option for the high volume (as requested) and will be displayed by changing the color of the midline.
Also has multi-Timeframe capabilities with option to turn off or on if desired
(This script will be posted in the end of this Post)

V1ibpv8.png


7ndqAUr.png


OXOxTPt.png


ZjpV08q.png

XcXOtFj.png


SIPL6jk.png

Savage_Oscillator
Code:
#https://usethinkscript.com/threads/savage-oscillator.4214/
#Assembled by FateOwnzYou on UseThinkscript.com


declare lower;
Input Price_Color = yes;
Input Sensitivity = 1;
Input Reversal_Warning_Candle = yes;
Input Reversal_Warning = 8;
Input AverageLine = yes;
Input HighVolume = yes;
Input VolumeAveragingLength = 20;
Input VolumePercentThreshold = 60;

Plot _High = 9;
Plot CautionHigh = Reversal_Warning;
Plot _Low = -9;
Plot CautionLow = (Reversal_Warning)*-1;
Plot Zero = 0;

##Stochastics
Def S1 = Max(-100, Min(100, (StochasticFull(KPeriod = 8, slowing_period = 5, averageType = AverageType.EXPONENTIAL))) - 50) / 50.01;
Def S2 = Max(-100, Min(100, (StochasticFull(KPeriod = 17, slowing_period = 5, averageType = AverageType.EXPONENTIAL))) - 50) / 50.01;
Def S3 = Max(-100, Min(100, reference RSI(2)) - 50) / 50.01;

Plot Bull =(expAverage((S1 + S2 + S3)/3,Sensitivity))*10;
Def SpdChng = if Bull < 1.5 then ((movingAverage(averageType.Weighted, Bull, 20))-1.5) else ((movingAverage(averageType.Weighted, Bull, 10))-1.5) ;
plot Bear = (SpdChng - Bull);
plot middle = if AverageLine then((bull - bear)/2)+bear else double.nan;

##Reversals
Plot Top = if Bull > Reversal_Warning then Bull else double.nan;
Plot Bottom = if Bull < (Reversal_Warning)*-1 then Bull else double.nan;

##High Volume
def aVol = Average(volume, volumeAveragingLength);
def pVol = 100 * ((volume - aVol[1]) /aVol[1]);
def pDot = pVol >= volumePercentThreshold;

#Paint
zero.assignValueColor(if pDot and HighVolume then color.CYAN else color.current);
zero.setlineWeight(2);
middle.setdefaultColor(color.white);
Bottom.setdefaultColor(Color.yellow);
Bottom.setPaintingStrategy(paintingStrategy.POINTS);
Bottom.setlineWeight(3);
Top.setdefaultColor(Color.yellow);
Top.setPaintingStrategy(paintingStrategy.POINTS);
Top.setlineWeight(3);
_High.setdefaultColor(color.gray);
_Low.setdefaultColor(color.gray);
Zero.setdefaultColor(color.gray);
Cautionhigh.setdefaultColor(color.gray);
Cautionlow.setdefaultColor(color.gray);
Bear.assignValueColor(color.red);
Bull.assignvalueColor(color.green);
Bear.assignValueColor(color.red);
Bull.assignvalueColor(color.green);
addLabel(yes, if Bull > Bear then "Bullish" else "Bearish", if Bull > Bear then Color.Green else color.red);
assignpriceColor(if Price_Color AND Bull > Bear then color.green else color.current);
assignpriceColor(if Price_Color AND Bull < Bear then color.red else color.current);
assignpriceColor(if Reversal_Warning_Candle AND Bull > Reversal_Warning then color.blue else color.current);
assignpriceColor(if Reversal_Warning_Candle AND Bull < (Reversal_Warning)*-1 then color.blue else color.current);
addcloud(cautionhigh,_high,color.yellow, color.yellow);
addcloud(cautionlow,_low,color.yellow, color.yellow);

Savage_Oscillator_Arrows (Stand Alone Arrows)
Code:
#https://usethinkscript.com/threads/savage-oscillator.4214/
#Assembled by FateOwnzYou on UseThinkscript.com

Input Sensitivity = 1;
Input Reversal_Warning = 8;
Input Label = yes;

#Stochastics
Def S1 = Max(-100, Min(100, (StochasticFull(KPeriod = 8, slowing_period = 5, averageType = AverageType.EXPONENTIAL))) - 50) / 50.01;
Def S2 = Max(-100, Min(100, (StochasticFull(KPeriod = 17, slowing_period = 5, averageType = AverageType.EXPONENTIAL))) - 50) / 50.01;
Def S3 = Max(-100, Min(100, reference RSI(2)) - 50) / 50.01;

def Bull =(expAverage((S1 + S2 + S3)/3,Sensitivity))*10;
Def SpdChng = if Bull < 1.5 then ((movingAverage(averageType.Weighted, Bull, 20))-1.5) else ((movingAverage(averageType.Weighted, Bull, 10))-1.5) ;
def Bear = (SpdChng - Bull);

Plot Top = Bull > Reversal_Warning;
Plot Bottom = if Bull < (Reversal_Warning)*-1 then Bull else double.nan;

#Paint
Bottom.setdefaultColor(Color.Blue);
Bottom.setPaintingStrategy(paintingStrategy.BOOLEAN_ARROW_UP);
Bottom.setlineWeight(3);
Top.setdefaultColor(Color.Blue);
Top.setPaintingStrategy(paintingStrategy.BOOLEAN_ARROW_DOWN);
Top.setlineWeight(3);
addLabel(Label, if Bull > Bear then "Bullish" else "Bearish", if Bull > Bear then Color.Green else color.red);

Savage_Oscillator_Upper (Stand Alone Candle Color Change)
Code:
#https://usethinkscript.com/threads/savage-oscillator.4214/
#Assembled by FateOwnzYou on UseThinkscript.com

input Sensitivity = 1;
Input Reversal_Warning = 8;
input Label = yes;
Input HighVolume = yes;
input volumeAveragingLength = 20;
input volumePercentThreshold = 50;

def s1 = Max(-100, Min(100, (StochasticFull(KPeriod = 8, slowing_period = 5, averageType = AverageType.EXPONENTIAL))) - 50) / 50.01;
def s2 = Max(-100, Min(100, (StochasticFull(KPeriod = 17, slowing_period = 5, averageType = AverageType.EXPONENTIAL))) - 50) / 50.01;
def s3 = Max(-100, Min(100, reference RSI(2)) - 50) / 50.01;

def Bull =expAverage((s1 + s2 + s3)/3,sensitivity)*10;
def avg = if bull < 1.5 then ((movingAverage(averageType.Weighted, bull, 20))-1.5) else ((movingAverage(averageType.Weighted, bull, 10)))-1.5 ;
def Bear = (avg - bull);

def aVol = Average(volume, volumeAveragingLength);
def pVol = 100 * ((volume - aVol[1]) /aVol[1]);
def pDot = pVol >= volumePercentThreshold;
plot volumeStrength = if pDot and (Bull or Bear) and HighVolume then hl2 else Double.NaN;

addLabel(Label, if Bull > Bear then "Bullish" else "Bearish", if Bull > Bear then Color.Green else color.red);
volumeStrength.SetPaintingStrategy(PaintingStrategy.POINTS);
volumeStrength.SetLineWeight(3);
volumeStrength.SetDefaultColor(color.cyan);
volumeStrength.hideBubble();
assignpriceColor(if Bull > Bear then color.GREEN else color.current);
assignpriceColor(if Bull < Bear then color.RED else color.current);
assignpricecolor(if Bull > Reversal_Warning then color.BLUE else color.current);
assignpricecolor(if Bull < (Reversal_Warning *-1) then color.BLUE else color.current);

Savage_Watchlist

Code:
Input Sensitivity = 1;
Input Reversal_Warning = 8;


##Stochastics
Def S1 = Max(-100, Min(100, (StochasticFull(KPeriod = 8, slowing_period = 5, averageType = AverageType.EXPONENTIAL))) - 50) / 50.01;
Def S2 = Max(-100, Min(100, (StochasticFull(KPeriod = 17, slowing_period = 5, averageType = AverageType.EXPONENTIAL))) - 50) / 50.01;
Def S3 = Max(-100, Min(100, reference RSI(2)) - 50) / 50.01;

def Bull =(expAverage((S1 + S2 + S3)/3,Sensitivity))*10;
Def SpdChng = if Bull < 1.5 then ((movingAverage(averageType.Weighted, Bull, 20))-1.5) else ((movingAverage(averageType.Weighted, Bull, 10))-1.5) ;
def Bear = (SpdChng - Bull);
def middle = ((bull - bear)/2)+bear;

def condition1 = Bull > Reversal_Warning;
def condition2 = Bull < (Reversal_Warning * -1);
def crossing = middle + 1;
def crossing2 = middle - 1;
def between1 = middle > crossing2 and middle < crossing;

addLabel(yes, if condition1 or condition2 then "Reversal" else concat("",Bull), if condition1 or condition2 then color.black else if bull > 1.5 then color.Light_Green else if bull < -1.5 then color.Light_Red else if between1 then color.orange else color.current);

assignbackgroundcolor(if condition1 then color.light_red else if condition2 then color.light_green else color.current);


EDIT: I have also added this MultiTimeframe Price action Savage Bands
Picture and script below
hzEEXht.png


Code:
#The Official Savage Bands
#https://usethinkscript.com/threads/savage-oscillator.4214/
#Assembled by FateOwnzYou on UseThinkscript.com

###MTF###
input Sensitivity = 1;
input Distance = 5;
input Smoothness = 7;
input MTF = yes;
input currentTF = no;
input TimeFrame = aggregationPeriod.DAY;
input HighVolume = no;
input volumeAveragingLength = 20;
input volumePercentThreshold = 50;

def S1_MTF = Max(-100, Min(100, (StochasticFull(KPeriod = 8, slowing_period = 5, averageType = AverageType.EXPONENTIAL, priceh = high(period=TimeFrame), pricel = low(period=TimeFrame), pricec = close(period=TimeFrame)))) - 50) / 50.01;
def S2_MTF = Max(-100, Min(100, (StochasticFull(KPeriod = 17, slowing_period = 5, averageType = AverageType.EXPONENTIAL, priceh = high(period=TimeFrame), pricel = low(period=TimeFrame), pricec = close(period=TimeFrame)))) - 50) / 50.01;
def S3_MTF = Max(-100, Min(100, reference RSI(2, price = close(period=timeframe)))- 50) / 50.01;

def savage_MTF = (ExpAverage((S1_MTF + S2_MTF + S3_MTF) / 3, Sensitivity)) * 10;

def bottom_MTF = Min(close(period=TimeFrame)[1], low(period=TimeFrame));
def tr_MTF = TrueRange(high(period=TimeFrame), close(period=TimeFrame), low(period=TimeFrame));
def ptr_MTF = tr_MTF / (bottom_MTF + tr_MTF / 2) * 100;
def APTR_MTF = (MovingAverage(AverageType.WILDERS, ptr_MTF, 14))*Distance;

def LowLine_MTF = ((0.0625*(((APTR_MTF*close(period=TimeFrame))/100)*-1))*(savage_MTF+7.75))+close(period=TimeFrame);
def HighLine_MTF = ((0.01*((APTR_MTF*close(period=TimeFrame))/100))*((-6.25*savage_MTF)+51.5625))+close(period=TimeFrame);

plot SmoothedLow_MTF = if MTF then (movingaverage(data = LowLine_MTF, averageType = AverageType.WEIGHTED, length = Smoothness)) else double.nan;
smoothedlow_MTF.setdefaultColor(color.red);
plot SmoothedHigh_MTF = if MTF then (movingaverage(data = HighLine_MTF, averageType = AverageType.WEIGHTED, length = Smoothness)) else double.nan;
smoothedhigh_MTF.setdefaultColor(color.red);

def aVol_MTF = Average(volume(period = TimeFrame), volumeAveragingLength);
def pVol_MTF = 100 * ((volume(period = TimeFrame) - aVol_MTF[1]) /aVol_MTF[1]);
def pDot_MTF = pVol_MTF >= volumePercentThreshold;
#plot volumeStrength = if pDot and HighVolume then hl2 else Double.NaN;

plot MidLine_MTF = ((SmoothedHigh_MTF - SmoothedLow_MTF)/2)+SmoothedLow_MTF;
MidLine_MTF.assignvalueColor(if pdot_MTF and HighVolume and MTF then color.yellow else color.red);

### End MTF

#Stochastics
def S1 = Max(-100, Min(100, (StochasticFull(KPeriod = 8, slowing_period = 5, averageType = AverageType.EXPONENTIAL, priceh = high, pricel = low, pricec = close))) - 50) / 50.01;
def S2 = Max(-100, Min(100, (StochasticFull(KPeriod = 17, slowing_period = 5, averageType = AverageType.EXPONENTIAL, priceh = high, pricel = low, pricec = close))) - 50) / 50.01;
def S3 = Max(-100, Min(100, reference RSI(2, price = close))- 50) / 50.01;

def savage = (ExpAverage((S1 + S2 + S3) / 3, Sensitivity)) * 10;

def bottom = Min(close[1], low);
def tr = TrueRange(high, close, low);
def ptr = tr / (bottom + tr / 2) * 100;
def APTR = (MovingAverage(AverageType.WILDERS, ptr, 14))*Distance;

def LowLine = ((0.0625*(((APTR*close)/100)*-1))*(savage+7.75))+close;
def HighLine = ((0.01*((APTR*close)/100))*((-6.25*savage)+51.5625))+close;

plot SmoothedLow = if CurrentTF then (movingaverage(data = LowLine, averageType = AverageType.WEIGHTED, length = Smoothness)) else double.nan;
smoothedlow.setdefaultColor(color.cyan);
plot SmoothedHigh = if CurrentTF then (movingaverage(data = HighLine, averageType = AverageType.WEIGHTED, length = Smoothness)) else double.nan;
smoothedhigh.setdefaultColor(color.cyan);

def aVol = Average(volume, volumeAveragingLength);
def pVol = 100 * ((volume - aVol[1]) /aVol[1]);
def pDot = pVol >= volumePercentThreshold;

plot MidLine = ((SmoothedHigh - SmoothedLow)/2)+SmoothedLow;
MidLine.assignvaluecolor(if pdot and HighVolume then color.yellow else color.cyan);
 
Last edited:
cheers !! This would be one of the best Let me check out tomorrow
feel like using DMI Di+ and Di- Bull and Bear fight together w ADX
let see !!!!!

thanks so much
 
@mdtn It should be about the same on all time frames. but the timeframe that you use should be relative to how long your trades plan to be. If your a investor your gonna wanna look at monthly, swing trader maybe Daily, day trader maybe hourly or 15min. Its really up to you on what works for you best
 
@FateOwnzYou Actually your oscillator indicator is good predict for Momentum ,on the other hand DMI is used for how strong the trend is and slower than yours. that just my opinions
 
The DMI is using a slower average and longer length so not a fair comparison. I would suggest a higher sensitivity. Try maybe 3 and see if that cuts choppiness of this study.
You are absolutely right and I did try 3 and see what I see is exactly same pattern with his Oscillator WOW !!!!
 
@Stockbat it does that when price is bouncing around and consolidating. No real way to avoid consolidation on price action, but you can make it less choppy if you change the sensitivity setting. Moving that number up will smooth things out, but in turn will give you more of a delayed signal.
 
To clarify what I said. Try sensitivity of Savage at 3. Yes a bit slower but worth the less chop. As far as DMI if you do DMI say at 5 , exponential or simple I believe it may be close to Savage, not examined it, just think it may be close. As fate said maybe DMI 3 matches Savage, no idea. You would just need to try it and see what you like.
 
@mdtn It should be about the same on all time frames. but the timeframe that you use should be relative to how long your trades plan to be. If your a investor your gonna wanna look at monthly, swing trader maybe Daily, day trader maybe hourly or 15min. Its really up to you on what works for you best
Thanks FateOwnzYou :)
 

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
151 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