Appreciate anyone could convert this inciator into thinkscrip.
https://www.tradingview.com/script/qt6xLfLi-Impulse-MACD-LazyBear/
https://www.tradingview.com/script/qt6xLfLi-Impulse-MACD-LazyBear/
Last edited by a moderator:
#// @author LazyBear
#// List of my public indicators: http://bit.ly/1LQaPK8
#// List of my app-store indicators: http://blog.tradingview.com/?p=970
#study("Impulse MACD [LazyBear]", shorttitle="IMACD_LB", overlay=false)
# Converted by [email protected] - 11/2022
declare lower;
input BarColor = no;#input(false, title="Enable bar colors")
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;
#--- PLots
plot ImpulseSignal = sb;
ImpulseSignal.SetDefaultColor(Color.WHITE);
ImpulseSignal.SetLineWeight(2);
plot ImpulseHisto = sh;
ImpulseHisto.SetPaintingStrategy(PaintingStrategy.SQUARED_HISTOGRAM);
ImpulseHisto.SetDefaultColor(Color.BLUE);
plot ImpulseMACD = md;
ImpulseMACD.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
ImpulseMACD.AssignValueColor(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);
plot "0" = if isNaN(close) then na else 0;
"0".SetDefaultColor(Color.DARK_GRAY);
#--- Bar Color
AssignPriceColor(if !BarColor then Color.CURRENT else
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);
#--- END Code
Nope, no red here. It sounds like you copy & pasted the wrong script or did not copy & paste the complete scripthello samer800 awesome work as Allways thankyou my problem is I TRY convert this inciator
Impulse MACD [Lazy Bear] For Thinkorswim AFTER I copy I paste Create It show Red please help
tank you YOUR FOLLOWERS RUSS
I would recommend changing the Plot of value "md" from histogram to line. In order to show the crossing more clearly.#// @author LazyBear
#// List of my public indicators: http://bit.ly/1LQaPK8
#// List of my app-store indicators: http://blog.tradingview.com/?p=970
#study("Impulse MACD [LazyBear]", shorttitle="IMACD_LB", overlay=false)
# Converted by [email protected] - 11/2022
# modified on 5/Feb/2023
declare lower;
input BarColor = no; #input(false, title="Enable bar colors")
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;
#--- PLots
plot ImpulseSignal = sb;
ImpulseSignal.SetDefaultColor(Color.WHITE);
ImpulseSignal.SetLineWeight(2);
plot ImpulseHisto = sh;
ImpulseHisto.SetPaintingStrategy(PaintingStrategy.SQUARED_HISTOGRAM);
ImpulseHisto.SetDefaultColor(Color.BLUE);
plot ImpulseMACD = md;
ImpulseMACD.SetLineWeight(2);
ImpulseMACD.AssignValueColor(if mdc==2 then Color.GREEN else
if mdc==1 then Color.DARK_GREEN else
if mdc==-2 then Color.RED else Color.orange);
plot "0" = if isNaN(close) then na else 0;
"0".SetDefaultColor(Color.DARK_GRAY);
#--- Bar Color
AssignPriceColor(if !BarColor then Color.CURRENT else
if mdc==2 then Color.GREEN else
if mdc==1 then Color.DARK_GREEN else
if mdc==-2 then Color.RED else Color.orange);
where do you change that?I would recommend changing the Plot of value "md" from histogram to line. In order to show the crossing more clearly.
where do you change that?
addcloud(md, sb, color.green, color.red);
I figured it out. I just did plot ImpulseHisto = sh*2;Hello, is there a way to make the impulse histogram bigger (taller)?
You can. Not sure that you should.Hello, is there a way to make the impulse histogram bigger (taller)?
I had posted the modified codes.where do you change that?
Thank you! This is awesome!check it out
CSS:#// @author LazyBear #// List of my public indicators: http://bit.ly/1LQaPK8 #// List of my app-store indicators: http://blog.tradingview.com/?p=970 #study("Impulse MACD [LazyBear]", shorttitle="IMACD_LB", overlay=false) # Converted by [email protected] - 11/2022 declare lower; input BarColor = no;#input(false, title="Enable bar colors") 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; #--- PLots plot ImpulseSignal = sb; ImpulseSignal.SetDefaultColor(Color.WHITE); ImpulseSignal.SetLineWeight(2); plot ImpulseHisto = sh; ImpulseHisto.SetPaintingStrategy(PaintingStrategy.SQUARED_HISTOGRAM); ImpulseHisto.SetDefaultColor(Color.BLUE); plot ImpulseMACD = md; ImpulseMACD.SetPaintingStrategy(PaintingStrategy.HISTOGRAM); ImpulseMACD.AssignValueColor(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); plot "0" = if isNaN(close) then na else 0; "0".SetDefaultColor(Color.DARK_GRAY); #--- Bar Color AssignPriceColor(if !BarColor then Color.CURRENT else 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); #--- END Code
I have been testing this indicator and it has been pretty good. I have the histogram hidden and I converted the impulse macd to line as mentioned above. I was wondering if it's possible to apply a highertime frame impulse on a smaller time frame chart to stay in trades longer? I am mostly day trading on the 5 min and would like to apply the impulse macd from the 10 min to the 5 min chart.I would recommend changing the Plot of value "md" from histogram to line. In order to show the crossing more clearly.
In the video above it mentions you have to add them manually based on relative highs and lows at minute 6:00Is it possible to add overbought and oversold levels to the study?
Is it possible to add overbought and oversold levels to the study?
I tried this, but I can never get a straight horizontal line. Ended up getting lines that follow above or below the signal line insteadIt's not hard to add them dynamically. Just add a plot for the highest high and lowest low of the impulse signal for last X number of bars. I did that mod for another platform (not TOS so please don't ask for the code). I haven't found the OB and OS levels as helpful as I'd hoped. For the timeframes and instruments that I trade, I prefer to look for agreement between fast and slow inputs. YMMV.
Best wishes and happy trading.
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
S | MACD & RSI Overlay (Expo) for ThinkOrSwim | Custom | 0 | |
F | LinReg-MACD Alerts For ThinkOrSwim | Custom | 4 | |
T | Ichimoku, MACD, and PSar Dashboard For ThinkOrSwim | Custom | 3 | |
S | Super 6x: RSI, MACD, Stoch, Loxxer, CCI, & Velocity [Loxx] for ThinkOrSwim | Custom | 33 | |
S | [blackcat] L3 Jurik MACD for ThinkOrSwim | Custom | 0 |
Start a new thread and receive assistance from our community.
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.
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.