Impulse MACD [LazyBear] For ThinkOrSwim

Is it possible to add overbought and oversold levels to the study?

add the below code to your script and line value you can change according to your interest.

Code:
plot UP_line = 0.5;
plot DOWN_line = -0.5;

']
NlVrtop.png
 
Last edited by a moderator:
@samer800, appreciate the continued conversions; :) also to other thread participants appreciate the learned command brand new for me *sh( the software tweekd for sh sizing ?? plots Q/@MerryDay/ are these instructions in the ThinkorSwim Manual? FYI for the curious it is the ThinkScript Editor on the TOS platform. All these little tweeks are buried deep in the coding manual and are a mystery to most of us that have not spent their time examining code line by line.. this *sh is one such creative teacher; it's like a secret code between the ***** user and the computer I guess. Oh well, occassionally the light bulbs in my mind just go out..
https://tlc.thinkorswim.com/center/...ing-Studies-and-Strategies/thinkScript-Editor



I really wish someone had showed me this when I first stated “hacking” with Thinkscript on TOS.

I am pointing it out, because it gives the interested user of ThinkorSwim what I call

A “Gestalt” map to organize your thinking and more easily execute your intended commands.

I am completely autodidatic regards computers, coding, languages, without any benefit of a teacher or any formal education in regards to code. I think any really motivated person needs to be constantly encouraged. Usethink.com is one of the unusual sites that does it. I am grateful to all contributors. Best to all, Sincerely MagicQuotes
Blessings to the Bodisattva's on this website! Until we all get enlightened we will collectively remain in darkness so you might as well be generous and share your experience, knowledge and encourage anyone visiting you to share your insights as I pledge to do my few crumbs...
 
Oh, also by the way. the MACD impulse indicator is almost exactly identical in execution to the DMI Oscillator http://tos.mx/q33zMpA
1Tbtai7.png

originally conceived of by James Wilder, one of my favorite indicator contributors ( he was a mechanical engineer turned technical analyst passed away in 2021.. Great ingenious setups with the utilizaton the True range and the Average True range to further studies he publishes. One of the foundations of recursive algo's that drive the market in my humble opinion.. Best to All MagicQuotes :)
 
Last edited by a moderator:
Hi all! Can anyone help? I like to use "Impulse MACD". Need some code to make the watchlist show the value of the "Impulse MACD" itself and highlight the cell with the color of the line (I converted the "md" value from the histogram to a line on the chart). Thank you!

@BenTen
Can you help me?
I like to use "Impulse MACD".
https://usethinkscript.com/threads/impulse-macd-lazybear-for-thinkorswim.13333/page-2
I need code for the watchlist to show the value of the Impulse MACD itself and highlight the cell with the color of the Impulse MACD line (I converted the md value from the histogram to a line on the chart).

Thank you very much for your help!
 
Last edited by a moderator:
Impulse MACD Watchlist
shared watchlist script link: http://tos.mx/x3CkPc8 Click here for --> Easiest way to load shared links
edhn49i.png

Ruby:
#study("Impulse MACD [LazyBear]", shorttitle="IMACD_LB", overlay=false)
# Converted by Sam4Cok@Samer800 - 11/2022

input lengthMA = 34;
input lengthSignal = 9;
input src = hlc3;

def na = Double.NaN;
#calc_smma(src, len) =>
script calc_smma {
input src = close;
input len = 34;
    def smma = if isNaN(smma[1]) then SimpleMovingAvg(src, len) else (smma[1] * (len - 1) + src) / len;
    plot return = smma;
}
#calc_zlema(src, length) =>
script calc_zlema {
input src = close;
input length = 34;
    def ema1 = ExpAverage(src, length);
    def ema2 = ExpAverage(ema1, length);
    def d    = ema1-ema2;
    def zelma = ema1+d;
 plot return = zelma;
}

def hi=calc_smma(high, lengthMA);
def lo=calc_smma(low, lengthMA);
def mi=calc_zlema(src, lengthMA);

def md = if (mi>hi)then (mi-hi) else if (mi<lo) then (mi - lo) else 0;
def sb = SimpleMovingAvg(md, lengthSignal);
def sh=md-sb;
def mdc = if src>mi then if src>hi then 2 else 1 else if src<lo then -2 else -1;

plot ImpulseMACD = md;

AssignBackgroundColor(if mdc==2 then Color.GREEN else
                             if mdc==1 then Color.DARK_GREEN else
                             if mdc==-2 then Color.RED else Color.DARK_RED);

@BIG
 
Last edited:
  • Thumbs Up
Reactions: BIG
Impulse MACD Watchlist
shared watchlist script link: http://tos.mx/x3CkPc8 Click here for --> Easiest way to load shared links
edhn49i.png

Ruby:
#study("Impulse MACD [LazyBear]", shorttitle="IMACD_LB", overlay=false)
# Converted by Sam4Cok@Samer800 - 11/2022

input lengthMA = 34;
input lengthSignal = 9;
input src = hlc3;

def na = Double.NaN;
#calc_smma(src, len) =>
script calc_smma {
input src = close;
input len = 34;
    def smma = if isNaN(smma[1]) then SimpleMovingAvg(src, len) else (smma[1] * (len - 1) + src) / len;
    plot return = smma;
}
#calc_zlema(src, length) =>
script calc_zlema {
input src = close;
input length = 34;
    def ema1 = ExpAverage(src, length);
    def ema2 = ExpAverage(ema1, length);
    def d    = ema1-ema2;
    def zelma = ema1+d;
 plot return = zelma;
}

def hi=calc_smma(high, lengthMA);
def lo=calc_smma(low, lengthMA);
def mi=calc_zlema(src, lengthMA);

def md = if (mi>hi)then (mi-hi) else if (mi<lo) then (mi - lo) else 0;
def sb = SimpleMovingAvg(md, lengthSignal);
def sh=md-sb;
def mdc = if src>mi then if src>hi then 2 else 1 else if src<lo then -2 else -1;

plot ImpulseMACD = md;

AssignBackgroundColor(if mdc==2 then Color.GREEN else
                             if mdc==1 then Color.DARK_GREEN else
                             if mdc==-2 then Color.RED else Color.DARK_RED);

@BIG
Many thanks for the help! Understood, everything works!
 
Thanks for your help. It will be helpful to me as well. I often use technical analysis and analytics in trading.
 
HHi

can anyone tell me the best settings for daytrading a 5 minute chart?
I'm trying to avoid cogestion. Maybe my settings aren't working well w 5 min time frame
I want to see the flat line in order to avoid non trending action.
what's the setting to show that for a 5 min chart?
thanks
 

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