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!
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):
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.
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.
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;
Hi guys,
I am trying to create a ttm wave watchlist, with A,B and C above zero for going long or below zero for going short. with colored background. here is what I have so far:
def waveA = TTM_Wave().Wave1;
def abovezero = waveA > 0;
def belowzero = waveA < 0;
AssignBackgroundColor(
if abovezero and abovezero[1] then Color.GREEN
else if belowzero and !belowzero[1] then Color.RED
else color.black );
plot scan = abovezero && belowzero;
im trying to add below zero as well but, can't figure out how to do it. I would also want to add if its long or short. For example, it C wave is above zero it would be green and say long.
please help,
I am looking for ttmwave1, ttmwave2high and ttmwave2low, crossing above/below zero line, countconsecutive with labels green crossing above, red crossing below
Thank you
please help,
I am looking for ttmwave1, ttmwave2high and ttmwave2low, crossing above/below zero line, countconsecutive with labels green crossing above, red crossing below
Thank you
it is unclear what you want to see.
i think you want a watchlist column?
3 main questions to answer,
1. where do you want to see something?
2. what do you want to see?
3. when do you want to see something?
1. i think watchlist column
2. i have no idea
3. when a crossing occurs
so, we have to figure out #2.
you want,
to track 3 variables,
a red or green on a crossing
count something...
i don't know what count consecutive means? count what? when?
i don't know if you want 3 separate columns to track each plot variable?
or all combined into 1 column?
---------------------------
this is a lower study, that should help you decide what you want to see.
it combines all 3 plot signals into 1 label.
also has 3 separate labels.
the labels turn red or green on a crossing.
3 numbers show the count of bars , back to a recent crossing.
. they start at 1 or -1 on a crossing.
. positive numbers if a cross up
. negative numbers if a cross down
# col_ttmwave_crossings_00_lower
#https://usethinkscript.com/threads/ttmwave-custom-column.14545/
#I am looking for ttmwave1, ttmwave2high and ttmwave2low, crossing above/below zero line, count consecutive with labels green crossing above, red crossing below
#this combines all 3 into 1 col
#red green on cross
#3 numbers show the count of bars , back to a recent cross , for the 3 plots.
#they start at 1 or -1 on a cross
#pos# if was up
#neg# if was dwn
#--------------
declare lower;
def bn = barnumber();
def na = Double.NaN;
def w1 = TTM_Wave().Wave1;
def w2hi = TTM_Wave().Wave2High;
def w2lo = TTM_Wave().Wave2Low;
def wz = TTM_Wave().ZeroLine;
input show_lines = yes;
plot z1 = if show_lines then w1 else na;
plot z2 = if show_lines then w2hi else na;
plot z3 = if show_lines then w2lo else na;
plot z4 = if show_lines then wz else na;
# count from recent crossing,
#. cnt pos after a cross up
#. cnt neg after a cross down
def w1x = if bn == 1 then 0
else if w1 crosses above wz then 1
else if w1 crosses below wz then -1
else w1x[1] + sign(w1x[1]) ;
def w2hix = if isnan(w2hix[1]) or bn == 1 then 0
else if w2hi crosses above wz then 1
else if w2hi crosses below wz then -1
else w2hix[1] + sign(w2hix[1]) ;
def w2lox = if bn == 1 then 0
else if w2lo crosses above wz then 1
else if w2lo crosses below wz then -1
else w2lox[1] + sign(w2lox[1]) ;
#assignbackgroundcolor(
#if (w1x == 1 or w2hix == 1 or w2lox == 1) then color.green
#else if (w1x == -1 or w2hix == -1 or w2lox == -1) then color.red
#else color.gray);
#------------------------
addlabel(1,
((if w1x > 0 then " " else "") +
w1x + " | " +
(if w2hix > 0 then " H" else "H") +
w2hix + " | " +
(if w2lox > 0 then " L" else "L") +
w2lox)
, color.yellow);
#, color.black);
#------------------------
addlabel(1, " ", color.black);
addlabel(1,
"wave1 " + (if w1x > 0 then " " else "") + w1x
, if w1x == 1 then color.green else if w1x == -1 then color.red else color.gray);
#------------------------
addlabel(1, " ", color.black);
addlabel(1,
"wave2 hi " + (if w2hix > 0 then " " else "") + w2hix
, if w2hix == 1 then color.green else if w2hix == -1 then color.red else color.gray);
#------------------------
addlabel(1, " ", color.black);
addlabel(1,
"wave2 lo " + (if w2lox > 0 then " " else "") + w2lox
, if w2lox == 1 then color.green else if w2lox == -1 then color.red else color.gray);
#-------------------------
#
@halcyonguy custom column, need to know when ttmwave1, ttmwave2 high or ttmwave2 low above zero line, the counts +1,2,3 so on the same when crossing below zero line counts -1,-2,-3, and so on
Can someone please explain how to interpret this? It looks like the yellow/red histogram is Wave A (the shortest term wave). Not clear to me if the blue/cyan histogram is Wave B or C. And it looks like the plotted line is none of the waves.
What I ended up doing is adding TOS default TTM_Wave script to the chart 3 times as lower panels so I could have each of wave A, B, and C plotted separately. According to some site I found, for:
Wave A: turn off plots for Wave2High and Wave2Low (Wave1 is Wave A)
Wave B: turn off plots for Wave1 and Wave2Low (Wave2High is Wave B)
Wave C: turn off plots for Wave1 and Wave2High (Wave2Low is Wave C)
Does anyone know if this is correct regarding TOS default TTM_Wave script? Since it's a TOS built-in script, the code is not available for viewing.
Im trying to make a script that uses the ttm_wave but i cant find the source code or a replaca. I have my own ttm_wave version, but its not exatcly like the original and well, im stuck. Would appreciate any advice or help, thanks.
Im trying to make a script that uses the ttm_wave but i cant find the source code or a replaca. I have my own ttm_wave version, but its not exatcly like the original and well, im stuck. Would appreciate any advice or help, thanks.
it is unclear what you want to see.
i think you want a watchlist column?
3 main questions to answer,
1. where do you want to see something?
2. what do you want to see?
3. when do you want to see something?
1. i think watchlist column
2. i have no idea
3. when a crossing occurs
so, we have to figure out #2.
you want,
to track 3 variables,
a red or green on a crossing
count something...
i don't know what count consecutive means? count what? when?
i don't know if you want 3 separate columns to track each plot variable?
or all combined into 1 column?
---------------------------
this is a lower study, that should help you decide what you want to see.
it combines all 3 plot signals into 1 label.
also has 3 separate labels.
the labels turn red or green on a crossing.
3 numbers show the count of bars , back to a recent crossing.
. they start at 1 or -1 on a crossing.
. positive numbers if a cross up
. negative numbers if a cross down
# col_ttmwave_crossings_00_lower
#https://usethinkscript.com/threads/ttmwave-custom-column.14545/
#I am looking for ttmwave1, ttmwave2high and ttmwave2low, crossing above/below zero line, count consecutive with labels green crossing above, red crossing below
#this combines all 3 into 1 col
#red green on cross
#3 numbers show the count of bars , back to a recent cross , for the 3 plots.
#they start at 1 or -1 on a cross
#pos# if was up
#neg# if was dwn
#--------------
declare lower;
def bn = barnumber();
def na = Double.NaN;
def w1 = TTM_Wave().Wave1;
def w2hi = TTM_Wave().Wave2High;
def w2lo = TTM_Wave().Wave2Low;
def wz = TTM_Wave().ZeroLine;
input show_lines = yes;
plot z1 = if show_lines then w1 else na;
plot z2 = if show_lines then w2hi else na;
plot z3 = if show_lines then w2lo else na;
plot z4 = if show_lines then wz else na;
# count from recent crossing,
#. cnt pos after a cross up
#. cnt neg after a cross down
def w1x = if bn == 1 then 0
else if w1 crosses above wz then 1
else if w1 crosses below wz then -1
else w1x[1] + sign(w1x[1]) ;
def w2hix = if isnan(w2hix[1]) or bn == 1 then 0
else if w2hi crosses above wz then 1
else if w2hi crosses below wz then -1
else w2hix[1] + sign(w2hix[1]) ;
def w2lox = if bn == 1 then 0
else if w2lo crosses above wz then 1
else if w2lo crosses below wz then -1
else w2lox[1] + sign(w2lox[1]) ;
#assignbackgroundcolor(
#if (w1x == 1 or w2hix == 1 or w2lox == 1) then color.green
#else if (w1x == -1 or w2hix == -1 or w2lox == -1) then color.red
#else color.gray);
#------------------------
addlabel(1,
((if w1x > 0 then " " else "") +
w1x + " | " +
(if w2hix > 0 then " H" else "H") +
w2hix + " | " +
(if w2lox > 0 then " L" else "L") +
w2lox)
, color.yellow);
#, color.black);
#------------------------
addlabel(1, " ", color.black);
addlabel(1,
"wave1 " + (if w1x > 0 then " " else "") + w1x
, if w1x == 1 then color.green else if w1x == -1 then color.red else color.gray);
#------------------------
addlabel(1, " ", color.black);
addlabel(1,
"wave2 hi " + (if w2hix > 0 then " " else "") + w2hix
, if w2hix == 1 then color.green else if w2hix == -1 then color.red else color.gray);
#------------------------
addlabel(1, " ", color.black);
addlabel(1,
"wave2 lo " + (if w2lox > 0 then " " else "") + w2lox
, if w2lox == 1 then color.green else if w2lox == -1 then color.red else color.gray);
#-------------------------
#
Hey halcyonguy i was curious if you know how the ttm_wave indicator works/have a replaca for it. i wasnt sure how to message you directly, so thats why im replying to this years old post. ive looked everywhere for a replaca but i cant find it (spent 10+ hours looking, another 30 trying to code it myself) and im compeletly lost. any help would be appreciated, thanks.
Im trying to make a script that uses the ttm_wave but i cant find the source code or a replaca. I have my own ttm_wave version, but its not exatcly like the original and well, im stuck. Would appreciate any advice or help, thanks.
Here is the exact TTM_Wave code from thinkorswim. It’s a combo of all the fib macds. Took me a month to figure this out because of all the misleading and incorrect information about how the TTM_wave works.
def w2high =
if macd1 >= macd2 and macd1 >= macd3 and macd1 >= macd4 and macd1 >= macd5 then macd1
else if macd2 >= macd1 and macd2 >= macd3 and macd2 >= macd4 and macd2 >= macd5 then macd2
else if macd3 >= macd1 and macd3 >= macd2 and macd3 >= macd4 and macd3 >= macd5 then macd3
else if macd4 >= macd1 and macd4 >= macd2 and macd4 >= macd3 and macd4 >= macd5 then macd4
else macd5;
def w2low =
if macd1 <= macd2 and macd1 <= macd3 and macd1 <= macd4 and macd1 <= macd5 then macd1
else if macd2 <= macd1 and macd2 <= macd3 and macd2 <= macd4 and macd2 <= macd5 then macd2
else if macd3 <= macd1 and macd3 <= macd2 and macd3 <= macd4 and macd3 <= macd5 then macd3
else if macd4 <= macd1 and macd4 <= macd2 and macd4 <= macd3 and macd4 <= macd5 then macd4
else macd5;
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.
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.