LazyBear's Universal Oscillator for Thinkorswim

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

@Enable Welcome to the uTS community :) Thanks for your feedback...it's good to know there are community members out there whom are interested in what the team is trying to accomplish...Our hope is to design, build and test ideas that the entire community can benefit from, if they so choose...

Good Luck and Good Trading :cool:
 
Thanks @netarchitech its good to be here with you guys, with all of your market and coding knowledge :) can you share the link to where I can get the smoothed MAs by any chance?
 
@Enable here is the Slimmer Ribbon you asked about...These are GREAT! First version that will probably have more enhancements when @netarchitech has more time...keep checking here from time to time.

Code:
# filename: MR__EZ_Slimmer_Ribbon_
# source: https://usethinkscript.com/threads/slim-ribbon-indicator-for-thinkorswim.245/
# original authors: Slim Miller and [USER=140]@markos[/USER]
# idea source: [USER=1381]@HighBredCloud[/USER]
# enhancements: [USER=72]@netarchitech[/USER]

#V01.01.11.20.2019

input price = close;
input SlimmerMALength1 = 8;
input SLimmerMALength2 = 13;
input SlimmerMALength3 = 21;
input SlimmerMAType = AverageType.EXPONENTIAL;

# plot and smooth the Moving Averages
def SlimmerMA1 = MovingAverage(SlimmerMAType, price, SlimmerMALength1);
plot SlimmerMovAvg1 = SlimmerMA1;
SlimmerMovAvg1.SetDefaultColor(Color.GREEN);
SlimmerMovAvg1.SetLineWeight(2);
SlimmerMovAvg1.hide();

def SlimmerMA2 = MovingAverage(SlimmerMAType, price, SlimmerMALength2);
plot SlimmerMovAvg2 = SlimmerMA2;
SlimmerMovAvg2.SetDefaultColor(Color.YELLOW);
SlimmerMovAvg2.SetLineWeight(2);
SlimmerMovAvg2.hide();

def SlimmerMA3 = MovingAverage(SlimmerMAType, price, SlimmerMALength3);
plot SlimmerMovAvg3 = SlimmerMA3;
SlimmerMovAvg3.SetDefaultColor(Color.RED);
SlimmerMovAvg3.SetLineWeight(2);
SlimmerMovAvg3.hide();


input applySelectSmoothing = yes;

def smooth_MA1 = EhlersSuperSmootherFilter(MovingAverage(SlimmerMAType, price, SlimmerMALength1));
def smooth_MA2 = EhlersSuperSmootherFilter(MovingAverage(SlimmerMAType, price, SlimmerMALength2));
def smooth_MA3 = EhlersSuperSmootherFilter(MovingAverage(SlimmerMAType, price, SlimmerMALength3));

input SelectSmoothingType = {default "Smooth MAs", "No Smoothing"};

plot X;
X.SetDefaultColor(Color.GREEN);
X.SetLineWeight(2);
plot Y;
Y.SetDefaultColor(Color.YELLOW);
Y.SetLineWeight(2);
plot Z;
Z.SetDefaultColor(Color.RED);
Z.SetLineWeight(2);

switch (SelectSmoothingType) {
case "Smooth MAs":
    X = if applySelectSmoothing and SlimmerMA1 then smooth_MA1 else SlimmerMA1;
    Y = if applySelectSmoothing and SlimmerMA2 then smooth_MA2 else SlimmerMA2;
    Z = if applySelectSmoothing and SlimmerMA3 then smooth_MA3 else SlimmerMA3;
case "No Smoothing":
    X = if applySelectSmoothing and SlimmerMA1 then SlimmerMA1 else SlimmerMA1;
    Y = if applySelectSmoothing and SlimmerMA2 then SlimmerMA2 else SlimmerMA2;
    Z = if applySelectSmoothing and SlimmerMA3 then SlimmerMA3 else SlimmerMA3;
}
;
 
Last edited by a moderator:
@netarchitech Thank You so much! Out of curiosity for the main instance of TMO can you use the scrip with the Fisher Transform? Also are you able to cross check it with the one that @tomsk posted? The one posted by @tomsk does not come with Fisher Transform...and the one I posted I attempted of merging two TMO's together...to my surprise it worked...However, @tomsk said they are not the same...not sure IF he didn't look at the code I posted or if he was going off the notion that it included Fisher Transform which I think was added by Johnny Q...

In any event...what I thought I did was take a regular Mobius code that with higher aggregation and just pasted the Fisher part in there...To me both the TMO that I posted and the one @tomsk posted looked the same when plotted in TOS...

As far as the colors go...I really don't know...can you perhaps add a feature for the user to chose that themselves? Its hard for me to see what colors would work well especially when there would be 3 instances of TMO...

And you are correct when you stated that IF a user only wants 2 instances they would simply un-check plot...Let me know if you need the codes again...but they are in this thread both mine and @tomsk posted...

Once again thanks again for doing this.
 
Back to the original post, what settings do I have to check to make it look like the second version on the original post? Thanks!
 
Back to the original post, what settings do I have to check to make it look like the second version on the original post?
@dolomick Not quite sure what you're referring to...Would it be this:

a.png



If so, just copy and paste the following code into a new study:

Code:
#
# TD Ameritrade IP Company, Inc. (c) 2015-2019
#

declare lower;

input cutoffLength = 20;

def whiteNoise = (close - close[2]) / 2;
def filter = reference EhlersSuperSmootherFilter(price = whiteNoise, "cutoff length" = cutoffLength);
def peak = if IsNaN(filter) then peak[1] * 0.991 else Max(AbsValue(filter), peak[1] * 0.991);

plot UniversalOsc = filter / peak;
plot ZeroLine = 0;

UniversalOsc.SetDefaultColor(GetColor(1));
UniversalOsc.SetLineWeight(2);

ZeroLine.SetDefaultColor(GetColor(4));

AddCloud(UniversalOsc, ZeroLine, Color.GREEN, Color.RED);

Hope this helps...

Good Luck and Good Trading :)
 
Can anyone create the code for this indicator so that drawing it as a histogram, the bars will be red when below the zero line, and the bars will be green when above the zero line? So it would look similar to the picture in post #77, but instead of red and green clouds, it would be red and green histogram bars. Thanks very much in advance for any assistance!!!
 
Can anyone create the code for this indicator so that drawing it as a histogram, the bars will be red when below the zero line, and the bars will be green when above the zero line? So it would look similar to the picture in post #77, but instead of red and green clouds, it would be red and green histogram bars. Thanks very much in advance for any assistance!!!

Code:
#
# TD Ameritrade IP Company, Inc. (c) 2015-2019
#

declare lower;

input cutoffLength = 20;

def whiteNoise = (close - close[2]) / 2;
def filter = reference EhlersSuperSmootherFilter(price = whiteNoise, "cutoff length" = cutoffLength);
def peak = if IsNaN(filter) then peak[1] * 0.991 else Max(AbsValue(filter), peak[1] * 0.991);

plot UniversalOsc = filter / peak;
plot ZeroLine = 0;
UniversalOsc.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
UniversalOsc.AssignValueColor(if UniversalOsc > 0 then COLOR.GREEN else COLOR.RED);
UniversalOsc.SetDefaultColor(GetColor(1));
UniversalOsc.SetLineWeight(2);
ZeroLine.SetDefaultColor(GetColor(4));

#AddCloud(UniversalOsc, ZeroLine, Color.GREEN, Color.RED);
 
Hello Community. I am new and using Think or Swim platform on my learning to trading futures. I found that this site ever provide a well presented indicators better than think or swim platform. I found out that there were very talented and very creative contributors on this site and am very much impressed. I would like to ask to those who are very knowledgeable programmers for help and I would like to thank you in advance for your time and effort for helping.
So I found this Universal Oscillator to be useful and I would like to ask if someone can write a code for label as I would like to add a label on the screen on the top left that corresponds with the histogram of this indicator as posted (chart) on #1.
 
Hello Community. I am new and using Think or Swim platform on my learning to trading futures. I found that this site ever provide a well presented indicators better than think or swim platform. I found out that there were very talented and very creative contributors on this site and am very much impressed. I would like to ask to those who are very knowledgeable programmers for help and I would like to thank you in advance for your time and effort for helping.
So I found this Universal Oscillator to be useful and I would like to ask if someone can write a code for label as I would like to add a label on the screen on the top left that corresponds with the histogram of this indicator as posted (chart) on #1.
Include this code (below) at the end (not sure if this is what you intended). You must also comment this line (#declare lower) if you want this label to appear on the top left.

AddLabel(yes, if euo >= 0 then "LazyBear-Positive" else
"LazyBear-Negative" ,
if euo >= 0 then Color.green else
Color.red );
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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