LazyBear's Universal Oscillator for Thinkorswim

I still believe there are simpler ways that provide better information and a smoother presentation.
@horserider Are there "simpler ways"? Probably...Is there "better information"? Probably...Is there a "smoother presentation"? Probably...but there isn't the benefits associated with working and collaborating together as a team :cool:
 

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

No doubt on the benefit of working as a team. Maybe I am not stating my comments clearly. Just trying to say there are alternative ways or studies to put your efforts towards. Why make it more complicated then need be to get the desired result of helping in one's trading.

In post 81 which of those studies looks easier to trade.
 
@netarchitech The SMI DSS EUO works great...Perhaps an updated code would be needed to the original thread about this indicator.

I do have some new requests now that this indicator that is perfected and finished.

1st request: I was thinking about a slim ribbon type indicator but with the smoothing lines that are found in the PercentR_MAC...I think that would be really cool IF there was an indicator that could smooth out especially the Simple or Exponential moving averages. I would say no more than 3 lengths allowing the user to chose what periods and colors or types of moving averages they want as well as having the smoothing option ON or OFF. That would also save some space in the upper study by combining 3 moving averages into one study. You have the codes already so perhaps this will not be a hard one to do.

2nd request might require some team work...but should also be doable...I hope. I would like to enhance the True Momentum Oscillator code below with the following criteria: As per Mobius suggestions...TMO works best IF it is combined with a secondary TMO indicator with an aggregation of 5-10 times the trading chart timeframe either overlaying it on top of each other OR simply a second instance of the indicator.

In order to save space and to make TMO look like it has more finesse is there a way to do something like the CSA study that we did where the second instance of TMO indicator is represented as dots UNDER the 1st TMO indicator...please refer to the pic #1.

Pic #1


As compared to this...


IF this request will be too much of a PITA in combining two TMO indicators into one...then what could be done is just convert TMO into the dots and make it a stand alone indicator that could go under the first TMO instance...I don't think the zero line will be necessary or the 10 OB or -10 OS lines...just two colored dots...BUT please allow the user to change colors just in case they want to on the dots...

TMO code with Fisher Transform and time aggregation:

#TMO True Momentum Oscillator with Higher Aggregation _Mobius
#Tuesday, May 15, 2018 12:36 PM
## OneNote Archive Name: TMO True Momentum Oscillator with Higher Aggregation _Mobius
## Archive Section: Momentum
## Suggested Tos Name: TrueMomentumOscillator_w_HigherAggregation_Mobius
## Archive Date: 5.15.2018
## Archive Notes:
## 08:43 Mobius: Well give it a few days to get altered, munched, distorted and twisted. Then when it get back to being used as intended someone will start making money with it.
## 08:45 Mobius: Oh and in my view - It's highest and best use is as designed with a secondary aggregation plotted either on it or with it around 5 to 10 time higher.
## "##" indicates an addition or adjustment by the OneNote Archivist
## Original Code Follows
# TMO ((T)rue (M)omentum (O)scillator) With Higher Aggregation
# Mobius
# V01.05.2018
#hint: TMO calculates momentum using the delta of price. Giving a much better picture of trend, tend reversals and divergence than momentum oscillators using price.

declare Lower;

input length = 14;
input calcLength = 5;
input smoothLength = 3;
input agg = AggregationPeriod.weeK;
input displayFisherLabels = no;

def o = open(period = agg);
def c = close(period = agg);
def data = fold i = 0 to length
with s
do s + (if c > getValue(o, i)
then 1
else if c < getValue(o, i)
then - 1
else 0);
def EMA5 = ExpAverage(data, calcLength);
plot Main = ExpAverage(EMA5, smoothLength);
plot Signal = ExpAverage(Main, smoothLength);
Main.AssignValueColor(if Main > Signal
then color.green
else color.Red);
Signal.AssignValueColor(if Main > Signal
then color.green
else color.red);
Signal.HideBubble();
Signal.HideTitle();
addCloud(Main, Signal, Color.LIGHT_GREEN, color.red);
plot zero = if isNaN(c) then double.nan else 0;
zero.SetDefaultColor(Color.gray);
zero.hideBubble();
zero.hideTitle();
plot ob = if isNaN(c) then double.nan else round(length * .8);
ob.SetDefaultColor(Color.gray);
ob.HideBubble();
ob.HideTitle();
plot os = if isNaN(c) then double.nan else -round(length * .8);
os.SetDefaultColor(Color.gray);
os.HideBubble();
os.HideTitle();
addCloud(ob, length, Color.LIGHT_RED, Color.LIGHT_RED, Yes);
addCloud(-length, os, Color.GREEN, Color.GREEN, showBorder = Yes);
# End Code TMO with Higher Aggregation

# JQ_FisherTransform_wLabels v02
# assistance provided by AlphaInvestor, amalia, randyr and nube

# v02 9.23.2018 JQ added arrows

input Fisherprice = hl2;
input FisherLength = 10;
input TriggerLineOffset = 1; # Ehler's value of choice is 1
input TriggerLine_Color_Choice = {"magenta", "cyan", "pink", default "gray", "Mustard", "red", "green", "dark_gray", "Pale Yellow", "white"};
input deBug = no;

input BuyLabelText = " FisherTransform Buy ";
input SellLebelText = " FisherTransform Sell ";

def maxHigh = Highest(Fisherprice, FisherLength);
def minLow = Lowest(Fisherprice, FisherLength);
def range = maxHigh - minLow;
def value = if IsNaN(Fisherprice)
then Double.NaN
else if IsNaN(range)
then value[1]
else if range == 0
then 0
else 0.66 * ((Fisherprice - minLow) / range - 0.5) + 0.67 * value[1];
def truncValue = if value > 0.99 then 0.999 else if value < -0.99 then -0.999 else value;
def fish = 0.5 * (Log((1 + truncValue) / (1 - truncValue)) + fish[1]);
def FTOneBarBack = fish[TriggerLineOffset];
def FT = fish;

plot FisherBullCross = if FT crosses above FTOneBarBack then lowestall(Main) else Double.NaN;
FisherBullCross.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
FisherBullCross.SetDefaultColor(Color.UPTICK);

plot FisherBearCross = if FT crosses below FTOneBarBack then highestall(Main) else Double.NaN;
FisherBearCross.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
FisherBearCross.SetDefaultColor(Color.DOWNTICK);



AddLabel (displayFisherLabels, "" + if FT >= FTOneBarBack then BuyLabelText else SellLebelText + " ",
(if FT > FTOneBarBack
then Color.LIGHT_GREEN
else if FT < FTOneBarBack
then Color.LIGHT_RED
else Color.GRAY));



# End Fisher Transform Code
 
Yes, like @tomsk mentioned, please keep things organized so that other members can read up on the topic and keep up with the right content. If you guys change subject or discussion, I highly recommend creating a new post. I can also help with moving any messages not pertaining to the Universal Oscillator to a different or new thread. Just let me know the message #, and I'm more than happy to do so.
 
Yes, like @tomsk mentioned, please keep things organized so that other members can read up on the topic and keep up with the right content. If you guys change subject or discussion, I highly recommend creating a new post. I can also help with moving any messages not pertaining to the Universal Oscillator to a different or new thread. Just let me know the message #, and I'm more than happy to do so.
@BenTen Thanks...As soon as things get figured out here we will let you know from what post # to move...assuming this project is a go.
 
...Just trying to say there are alternative ways or studies to put your efforts towards. Why make it more complicated then need be to get the desired result of helping in one's trading.

In post 81 which of those studies looks easier to trade.
Understood @horserider There is no need to complicate things, but providing a user with alternatives within one indicator can be helpful to that user if they so choose to take advantage of the enhancements within...Providing options to a user leaves them with the opportunity to explore at their own pace...Providing a simpler indicator may satisfy a user in the short term, but as they progress, they may very well be looking for more...

Thanks @horserider for providing an alternative dialog and indicator to stimulate a healthy discussion on this subject...With that said, on behalf of the other members of the team, I would like to extend an invitation to you to join us and thereby incorporate your skills and ideas in the overall indicator development effort... :)
 
I do have some new requests now that this indicator that is perfected and finished.
@HighBredCloud No rest for the weary :) As always, I will try my best to keep up with the steady stream of ideas...With that said, let's take it one step at a time, starting with the smoothing of the 3 moving average lines...

On that note, let's start a new thread... :cool: I'll pull out the PercentR_MAC code and start working...
 
@HighBredCloud No rest for the weary :) As always, I will try my best to keep up with the steady stream of ideas...With that said, let's take it one step at a time, starting with the smoothing of the 3 moving average lines...

On that note, let's start a new thread... :cool: I'll pull out the PercentR_MAC code and start working...
@netarchitech Good idea...that version of the Smoothed Slim Ribbon will be a hit for sure...something everyone can use. Can you include the same moving averages as in the PercentR_MAC...just incase someone feels the need to play around with them?

And I really like the invitation you extended to @horserider to join if he so wishes.

Guys and Gals...at the end of the day we're all here on the daily basically...So lets put our heads together and come up with something that gives us the edge in the markets...No idea is stupid idea as long as we have an idea to begin with...better than not having an idea in the first place. Right?

Some of you are light years above my experience as both a trader and as a coder so you're more than welcome to expand and elaborate what I often spitball. "Rome was not built in a day."
 
The SMI DSS EUO works great...Perhaps an updated code would be needed to the original thread about this indicator.
Thanks @HighBredCloud :) Glad to hear it is working great...Good idea about updating the code...Once completed, I think it should be in a new thread and the posts associated with it...Before working on the Slim Ribbon project, I'll round up the associated posts and ask @BenTen to move them to the new thread...
 
Good idea...that version of the Smoothed Slim Ribbon will be a hit for sure...something everyone can use.
Thanks @HighBredCloud but I can't take credit for your idea :)

Some of you are light years above my experience as both a trader and as a coder so you're more than welcome to expand and elaborate what I often spitball.
Uh-oh...there you go again with the "spitballin"...Hahahaha :ROFLMAO:

Guys and Gals...at the end of the day we're all here on the daily basically...So lets put our heads together and come up with something that gives us the edge in the markets...No idea is stupid idea as long as we have an idea to begin with...better than not having an idea in the first place. Right?
Right you are @HighBredCloud ! Teamwork is the key! :cool:
 
Hey guys, @netarchitech @HighBredCloud I love seeing you guys try to build something that works, I’ve always been an advocate of lettings scripts do most of the work for you.. well obviously besides pushing the buy and sell buttons. Id be contributing more but have a ton of stuff going on atm. Im big on momentum trading recently where the chart and trend sort of lets the money work for you. Trends with breaksouts are essential and it looks like you guys are onto something. Hopefully it will come with a scan ;) haha
 
@HighBredCloud @netarchitech Also another thing I wanted to mention, alot of indicators dont work well unless they use multiple time frames.. no matter how complex you may make them, you need charts to agree. I have a friend that is very successful at trading and he scalps when his 1min and 5min charts agree with each other.
 
@Enable Trend and Momentum are probably the most common indicators out there I'd say...but one of the most effective in my opinion. So hopefully the work that is done here can benefit others. We're just making good indicators better. ;)
 
@Enable From my findings...its extremely hard to make an indicator that is accurate on a 1 min chart...and yes multi timeframe is almost a must. There is no magic indicator...that I am aware of. Personally I'd like to see an indicator that is able to tell you a pullback from a reversal...or one that plots higher highs and higher lows...etc. Not sure if something like that exists...

And in regards to the scan...that is not my forte...but I am sure others here might be able to help once the indicator is done.
 
@Enable Did you check out the Stochastic Momentum Index with Double Smooth Stochastic and Universal Oscillator indicator in this thread?

Final Version script:

Code:
# filename: MR__EZ_SMI_DSS_EUO_

# original authors: TDAmeritrade and LazyBear
# enhancements: netarchitech as requested by [USER=1381]@HighBredCloud[/USER]
#               normalized code sample courtesy of [USER=1369]@tomsk[/USER]
# V1.01.2019.11.06
# V1.02.2019.11.16
# V1.03.2019.11.17

declare lower;

input PaintBars = no;
input showHistogram = yes;
input showBreakoutSignals = {default "No", "On SMI", "On AvgSMI", "On SMI & AvgSMI"};

input MinValue = -100;
input MaxValue = 100;

input percentDLength = 3;
input percentKLength = 5;

def min_low = Lowest(low, percentKLength);
def max_high = Highest(high, percentKLength);
def rel_diff = close - (max_high + min_low) / 2;
def diff = max_high - min_low;

def avgrel = ExpAverage(ExpAverage(rel_diff, percentDLength), percentDLength);
def avgdiff = ExpAverage(ExpAverage(diff, percentDLength), percentDLength);

plot SMI = if avgdiff != 0 then avgrel / (avgdiff / 2) * 100 else 0;
#plot SMI = if avgdiff != 0 then avgrel / (avgdiff / 2) else 0;
SMI.hide();

plot PlotToNormalize = SMI;  # replace close with the name of the plot you wish to normalize  
PlotToNormalize.SetHiding(1);
plot NormalizedSMI =  (MaxValue - MinValue) * (PlotToNormalize - LowestAll(PlotToNormalize))/ (HighestAll(PlotToNormalize) - LowestAll(PlotToNormalize))+ MinValue;
NormalizedSMI.SetPaintingStrategy(PaintingStrategy.LINE);
NormalizedSMI.SetDefaultColor(GetColor(6));
NormalizedSMI.SetLineWeight(2);

plot AvgSMI = ExpAverage(SMI, percentDLength);
AvgSMI.hide();

plot PlotToNormalize1 = AvgSMI;  # replace close with the name of the plot you wish to normalize  
PlotToNormalize1.SetHiding(1);
plot NormalizedAvgSMI =  (MaxValue - MinValue) * (PlotToNormalize1 - LowestAll(PlotToNormalize1))/ (HighestAll(PlotToNormalize1) - LowestAll(PlotToNormalize1))+ MinValue;
NormalizedAvgSMI.SetPaintingStrategy(PaintingStrategy.LINE);
NormalizedAvgSMI.SetDefaultColor(GetColor(5));
NormalizedAvgSMI.SetLineWeight(2);

# DSS
input N2_Period = 21;
input R2_Period = 5;

def Ln2 = Lowest(low, N2_Period);
def Hn2 = Highest(high, N2_Period);
#def Y2 = ((close - Ln2)/(Hn2 - Ln2)) * 100;
def Y2 = ((close - Ln2) / (Hn2 - Ln2));
def X2 = ExpAverage(Y2, R2_Period);

def Lxn = Lowest(X2, N2_Period);
def Hxn = Highest(X2, N2_Period);
#def DSS = ((X2 - Lxn)/(Hxn - Lxn)) * 100;
def DSS = ((X2 - Lxn) / (Hxn - Lxn));
def DSSb = ExpAverage(DSS, R2_Period);
plot DSSsignal = DSSb[1];

plot PlotToNormalize2 = DSSsignal;  # replace close with the name of the plot you wish to normalize  
PlotToNormalize2.SetHiding(1);
plot NormalizedDSS =  (MaxValue - MinValue) * (PlotToNormalize2 - LowestAll(PlotToNormalize2))/ (HighestAll(PlotToNormalize2) - LowestAll(PlotToNormalize2))+ MinValue;
NormalizedDSS.SetPaintingStrategy(PaintingStrategy.LINE_VS_POINTS);
NormalizedDSS.AssignValueColor(if DSSb > NormalizedDSS then Color.GREEN else Color.RED);
NormalizedDSS.SetLineWeight(3);

#EUO
input bandedge = 20;
input lengthMA = 9;

def whitenoise = (close - close[2]) / 2;
def a1 = ExpAverage(-1.414 * 3.14159 / bandedge);
def b1 = 2.0 * a1 * Cos(1.414 * 180 / bandedge);
def c2 = b1;
def c3 = -a1 * a1;
def c1 = 1 - c2 - c3;

def filt = c1 * (whitenoise + (whitenoise[1])) / 2 + c2 * (filt[1]) + c3 * (filt[2]);
def filt1 = if TotalSum(1) == 0 then 0 else if TotalSum(1) == 2 then c2 * filt1[1] else if TotalSum(1) == 3 then c2 * filt1[1] + c3 * (filt1[2]) else filt;
def pk = if TotalSum(1) == 2 then .0000001 else if AbsValue(filt1) > pk[1] then AbsValue(filt1) else 0.991 * pk[1];
def denom = if pk == 0 then -1 else pk;
def euo = if denom == -1 then euo[1] else filt1 / pk;
plot euoMA = ExpAverage(euo, lengthMA);
euoMA.hide();

plot PlotToNormalize3 = euo;  # replace close with the name of the plot you wish to normalize  
PlotToNormalize3.SetHiding(1);
plot NormalizedEUO =  (MaxValue - MinValue) * (PlotToNormalize3 - LowestAll(PlotToNormalize3))/ (HighestAll(PlotToNormalize3) - LowestAll(PlotToNormalize3))+ MinValue;
#NormalizedPlot3.SetPaintingStrategy(PaintingStrategy.line);
NormalizedEUO.hide();

plot hist = if showHistogram then NormalizedEUO else Double.NaN;
hist.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
hist.SetLineWeight(5);
hist.DefineColor("Positive and Up", Color.GREEN);
hist.DefineColor("Positive and Down", Color.DARK_GREEN);
hist.DefineColor("Negative and Down", Color.RED);
hist.DefineColor("Negative and Up", Color.DARK_RED);
hist.AssignValueColor(if hist >= 0 then if hist > hist[1] then hist.Color("Positive and Up") else hist.Color("Positive and Down") else if hist < hist[1] then hist.Color("Negative and Down") else hist.Color("Negative and Up"));


plot ZeroLine = 0;
ZeroLine.SetDefaultColor(GetColor(4));
ZeroLine.HideTitle();

def over_bought = 40;
def overbought = over_bought;

def over_sold = -40;
def oversold = over_sold;

plot OS = if !isNaN(close) then OverSold else Double.NaN;
OS.SetPaintingStrategy(PaintingStrategy.Line);
OS.SetLineWeight(2);
OS.SetDefaultColor(Color.ORANGE);

plot OB = if !IsNaN(close) then OverBought else Double.NaN;
OB.SetPaintingStrategy(PaintingStrategy.Line);
OB.SetLineWeight(2);
OB.SetDefaultColor(Color.ORANGE);

def upSMI = NormalizedSMI crosses above oversold;
def upAvgSMI = NormalizedAvgSMI crosses above oversold;
def downSMI = NormalizedSMI crosses below overbought;
def downAvgSMI = NormalizedAvgSMI crosses below overbought;

plot UpSignal;
UpSignal.SetDefaultColor(Color.UPTICK);
UpSignal.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
UpSignal.SetLineWeight(3);

plot DownSignal;
DownSignal.SetDefaultColor(Color.DOWNTICK);
DownSignal.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
DownSignal.SetLineWeight(3);

switch (showBreakoutSignals) {
case "No":
    UpSignal = Double.NaN;
    DownSignal = Double.NaN;
case "On SMI":
    UpSignal = if upSMI then oversold else Double.NaN;
    DownSignal = if downSMI then overbought else Double.NaN;
case "On AvgSMI":
    UpSignal = if upAvgSMI then oversold else Double.NaN;
    DownSignal = if downAvgSMI then overbought else Double.NaN;
case "On SMI & AvgSMI":
    UpSignal = if upSMI or upAvgSMI then oversold else Double.NaN;
    DownSignal = if downSMI or downAvgSMI then overbought else Double.NaN;
}

UpSignal.SetHiding(showBreakoutSignals == showBreakoutSignals."No");
DownSignal.SetHiding(showBreakoutSignals == showBreakoutSignals."No");

AssignPriceColor(if PaintBars then (if euo >= 0 then Color.GREEN else Color.RED) else Color.CURRENT);

AddCloud(NormalizedSMI, NormalizedAvgSMI, Color.GREEN, Color.RED);
 
@tomsk Great info for sure and something to take into consideration...But I can't help to ask what is your concern here pertaining this idea? Please share so that it is known...

Even Mobius suggested to use "dual TMO" indicators with the second one being aggregated to a 5-10 times the original timeframe...

I find the dots being the most useful as TMO itself is effective on the color change that reflects polarity change and not by the OB/OS or ZERO line...as far as I know. right?

The added idea about SuperTrend merging into the TMO indicator also is something different that you stated in your link. I respect Mobius work and everything in this idea is combining his ideas and scripts together...The SuperTrend in particular will allow for a separate SuperTrend to be ran in the upper study such as the Price Trend SuperTrend...

Please clear up any misconceptions I may have about this particular project before anyones time is wasted. Is the issue with this idea the effectiveness? Overall simplicity or readability? What is it?

You might have possibly understood. I personally don't have any "concerns" or "misconceptions" as you've detailed, since there is so much interest in indicators across the site, thought it might be educational for all to better understand the classification of indicators. This will enable all those building indicators to have a much better foundation and understanding. All the best guys as you explore possibilities and build it out.
 
You might have possibly understood. I personally don't have any "concerns" or "misconceptions" as you've detailed, since there is so much interest in indicators across the site, thought it might be educational for all to better understand the classification of indicators. This will enable all those building indicators to have a much better foundation and understanding. All the best guys as you explore possibilities and build it out.
@tomsk You've built more indicators than I have tested...I think I read somewhere that you coded over 1000 different scripts...That by itself is incredible. I would like to hear concerns and critiques about things because IF there is a way to improve on an idea...and there almost ALWAYS is...then by all means let's do just that. The last thing I want is combining an indicator with another that just does not make sense.

You guys as the coders probably have betters ways of ding things than what my imagination can even think of...IF you see something that does not make sense...just say it...So that we can take a step back and see your point. It's hard as it to communicate via a message board BUT to my surprise it has worked out way better than I have expected thus far. At the end of the day...we all need to listen to one another whether its the coders or guys like me throwing crazy ideas at you...or nothing will get done how its suppose to.

Right now I am stuck with this @tomsk see pic below...ANY way to make this better?

 
I was thinking about a slim ribbon type indicator but with the smoothing lines that are found in the PercentR_MAC...
Done...

I think that would be really cool IF there was an indicator that could smooth out especially the Simple or Exponential moving averages.
Done...

I would say no more than 3 lengths allowing the user to chose what periods and colors or types of moving averages they want as well as having the smoothing option ON or OFF.
Done...Please note, if you want to customize any item, just remember to customize X, Y and/or Z...note to self, rename those variables...

@HighBredCloud Looking forward to your findings :) The "Slimmer Ribbon" project is located here...
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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