TTM_Wave For ThinkorSwim

Dix

New member
In my watchlists I would like to add a column where I can see the values of the TTM Wave for each stock. Can someone assist with the code part? I know how to add columns to my watchlists, etc. Essentially I want to run a pre-market scan to see for example TTM Waves that are greater than +2 or less than -2 for example. I know how to build the scan but also want to add the TTM Wave values to my watchlist for easier sorting. Thanks!
 

halcyonguy

Well-known member
VIP
Lifetime
Thank you very much for your corrections. It will not show Wave B or C when I unselect Wave A.

welcome
i think you are looking at the wrong study.
they have similar names. mine has a _00b on the end.

mine has a drop down to pick one of the wave letters.
yours had 3 inputs.

input wave = { default "A" , "B" , "C" };

settings - wave select
xk8RHVo.jpg
 

MerryDay

Administrative
Staff member
Staff
VIP
Lifetime
Here is a Mobius version
Ruby:
# Mobius ABC Waves
# V01.2015
# Long Wave (C), Medium Wave (B), and Short Wave (A)

declare lower;

def c = close;
plot Value = ExpAverage(ExpAverage(c, 5) -
             ExpAverage(c, 13), 3);
     Value.DefineColor("Blue",Color.CYAN);
     Value.DefineColor("Red", Color.RED);
     Value.AssignValueColor(if Value >= Value[1]
                            then Value.color("Blue")
                            else Value.color("Red"));
     Value.HideTitle();
     Value.HideBubble();
# Wave A
def fastMA1 = ExpAverage(c, 5 * 2);
def slowMA1 = ExpAverage(c, 13 * 2);
def macd1 = fastMA1 - slowMA1;
def signal1 = ExpAverage(macd1, 13 * 2);
plot hist1 = macd1 - signal1;
     hist1.SetPaintingStrategy(PaintingStrategy.Histogram);
     hist1.AssignValueColor(if hist1 < 0 and hist1 < hist1[1]
                            then color.dark_red
                            else if hist1 < 0 and
                                    hist1 > hist1[1]
                                 then color.yellow
                            else if hist1 > 0 and
                                    hist1 > hist1[1]
                                 then color.yellow
                            else color.dark_red);
    hist1.HideBubble();
    hist1.HideTitle();
def fastMA2 = ExpAverage(c, 5 * 2);
def slowMA2 = ExpAverage(c, 13 * 3);
def macd2 = fastMA2 - slowMA2;
def signal2 = ExpAverage(macd2, 13 * 3);
plot hist2 = macd2 - signal2;
     hist2.SetPaintingStrategy(PaintingStrategy.Histogram);
     hist2.AssignValueColor(if hist2 < 0 and hist2 < hist2[1]
                            then color.dark_red
                            else if hist2 < 0 and
                                    hist2 > hist2[1]
                                 then color.yellow
                            else if hist2 > 0 and
                                    hist2 > hist2[1]
                                 then color.yellow
                            else color.dark_red);
    hist2.HideBubble();
    hist2.HideTitle();
# Wave B
def fastMA3 = ExpAverage(c, 5 * 2);
def slowMA3 = ExpAverage(c, 13 * 5);
def macd3 = fastMA3 - slowMA3;
def signal3 = ExpAverage(macd3, 13 * 5);
plot hist3 = macd3 - signal3;
     hist3.SetPaintingStrategy(PaintingStrategy.Histogram);
     hist3.AssignValueColor(if hist2 < 0
                            then color.blue
                            else color.cyan);
    hist3.HideBubble();
    hist3.HideTitle();
def fastMA4 = ExpAverage(c, 5 * 2);
def slowMA4 = ExpAverage(c, 13 * 10);
def macd4 = fastMA4 - slowMA4;
def signal4 = ExpAverage(macd4, 13 * 10);
plot hist4 = macd4 - signal4;
     hist4.SetPaintingStrategy(PaintingStrategy.Histogram);
     hist4.AssignValueColor(if hist2 < 0
                            then color.blue
                            else color.cyan);
    hist4.HideBubble();
    hist4.HideTitle();
# Wave C
def fastMA5 = ExpAverage(c, 5 * 2);
def slowMA5 = ExpAverage(c, 13 * 20);
def macd5 = fastMA5 - slowMA5;
def signal5 = ExpAverage(macd5, 13 * 20);
plot hist5 = macd5 - signal5;
     hist5.SetPaintingStrategy(PaintingStrategy.Histogram);
     hist5.AssignValueColor(if hist2 < 0
                            then color.blue
                            else color.cyan);
    hist5.HideBubble();
    hist5.HideTitle();
def fastMA6 = ExpAverage(c, 5 * 2);
def slowMA6 = ExpAverage(c, 13 * 30);
plot macd6 = fastMA6 - slowMA6;
     macd6.SetPaintingStrategy(PaintingStrategy.Histogram);
     macd6.AssignValueColor(if hist2 < 0
                            then color.blue
                            else color.cyan);
    macd6.HideBubble();
    macd6.HideTitle();
plot zero = if isNaN(c) then double.nan else 0;
     zero.SetDefaultColor(Color.yellow);
     zero.HideBubble();
     zero.HideTitle();
# End Code Mobius ABC Waves
 

SealTrades

New member
I really liked the idea of creating more screen real estate by making the ABC Wave confluence a simple line on the chart. I created the Bearish condition to plot as well. This is my first attempt at coding anything, and for some reason it wouldn't work as one ThinkScript so my work-around was to create two separate studies (one bear, one bull) and then make the black lines (referred to as Neutral Waves) fully transparent by creating a Global Colors setting that can be manipulated. I then plotted it to the Squeeze indicator vs. the actual chart.
Code:
# Draw Vertical Signal when All Histogram Waves are above the Zero Line

DefineGlobalColor("Bullish Waves", Color.DARK_GREEN);
DefineGlobalColor("Neutral Waves", Color.Black);

AddVerticalLine(close, ”” , (if TTM_Wave()."Wave1" >0 and TTM_Wave()."Wave2high" >0 and  TTM_Wave()."Wave2low" >0 then GlobalColor("Bullish Waves") else GlobalColor("Neutral Waves")));

Code:
# Draw Vertical Signal when All Histogram Waves are below the Zero Line

DefineGlobalColor("Bearish Waves", Color.Dark_RED);
DefineGlobalColor("Neutral Waves", Color.Black);

AddVerticalLine(close, ”” , (if TTM_Wave()."Wave1" <0 and TTM_Wave()."Wave2high" <0 and  TTM_Wave()."Wave2low" <0 then GlobalColor("Bearish Waves") else GlobalColor("Neutral Waves")));
Photos for Reference
Notice lines on Squeeze Indicator:


Settings (make "Neutral Waves" fully transparent on both studies):
 
Last edited by a moderator:

mgnichols

New member
Good afternoon Members!
Seeking help with script for TOS scanner. Hopefully simple but still above what I'm able to do.

I utilize the TTM Wave (1) or A on my chart. Red and Yellow Histogram.
Looking for scanner code that identifies stocks where the histogram bar is changing today from red to yellow or trending better than the previous day.

Thanks!
 

bakly

New member
Good afternoon Members!
Seeking help with script for TOS scanner. Hopefully simple but still above what I'm able to do.

I utilize the TTM Wave (1) or A on my chart. Red and Yellow Histogram.
Looking for scanner code that identifies stocks where the histogram bar is changing today from red to yellow or trending better than the previous day.

Thanks!
plot YellowHistogram = TTM_Wave()."Wave1" is greater than TTM_Wave()."Wave1" from 1 bars ago;
plot RedHistogram = TTM_Wave()."Wave1" is less than TTM_Wave()."Wave1" from 1 bars ago;
 
Last edited:

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.
Top