MACD-V - adjusted for LBR310 scan

HushPuppy

New member
VIP
The Thinkscript code was put together by @DaysOff (https://usethinkscript.com/threads/macd-v-for-thinkorswim.19214/#post-147429)
Base on the original work of Alex-Spiroglou - https://www.naaim.org/wp-content/uploads/2022/05/MACD-V-Alex-Spiroglou-WEB.pdf

My request, can a scan be created that captures the slow lines crossing from the bottom, up through the: -125 ( MACD-V - adjusted for LBR310 ) indicator?

Picture:
1730308225348.png


Below is the Code showing version ( MACD-V - adjusted for LBR310 ) to be used for the scan:

Code:
# MACD-V Indicator for ThinkOrSwim
# From Alex Spirolglou
# https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4099617


declare lower;

input fast_len = 3;
input slow_len = 10;
input signal_len = 9;
input atr_len = 10;
input overbought_bounds = 125;
input oversold_bounds = -125;
input price = close;

# Indicator calculation
def fast_ema = ExpAverage(price, fast_len);
def slow_ema = ExpAverage(price, slow_len);
def atr = ATR(atr_len);

def macd = ((fast_ema - slow_ema) / atr) * 100;
def signal = ExpAverage(macd, signal_len);
def hist = macd - signal;

# Plotting
plot MACDLine = macd;
plot SignalLine = signal;
plot Histogram = hist;
plot mylineup = 100;
plot mylinedown = -100;


MACDLine.SetDefaultColor(CreateColor(41, 98, 255)); # Blue
SignalLine.SetDefaultColor(CreateColor(255, 109, 0)); # Orange

Histogram.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Histogram.SetLineWeight(3);
Histogram.AssignValueColor(if hist >= 0 then
(if hist > hist[1] then CreateColor(38, 166, 154) else CreateColor(178, 223, 219))
else
(if hist > hist[1] then CreateColor(255, 205, 210) else CreateColor(255, 82, 82)));

# Overbought and Oversold bounds
plot UpperBand = overbought_bounds;
plot LowerBand = oversold_bounds;


UpperBand.SetDefaultColor(CreateColor(0, 0, 47)); # Grey
LowerBand.SetDefaultColor(CreateColor(0, 0, 47)); # Grey
Mylineup.SetDefaultColor(CreateColor(12, 100, 100)); # Red
Mylinedown.SetDefaultColor(CreateColor(120, 100, 80)); # Green
UpperBand.SetStyle(Curve.SHORT_DASH);
LowerBand.SetStyle(Curve.SHORT_DASH);

# Filling between the lines and the bounds if overbought or oversold
AddCloud(if macd > overbought_bounds then macd else Double.NaN, overbought_bounds, CreateColor(255, 200, 200), CreateColor(255, 200, 200));
AddCloud(if macd < oversold_bounds then macd else Double.NaN, oversold_bounds, CreateColor(200, 255, 200), CreateColor(200, 255, 200));

# Extending out the boundaries
plot ExtendedUpperBand = overbought_bounds;
plot ExtendedLowerBand = oversold_bounds;

ExtendedUpperBand.SetDefaultColor(CreateColor(200, 200, 200));
ExtendedLowerBand.SetDefaultColor(CreateColor(200, 200, 200));
ExtendedUpperBand.SetStyle(Curve.LONG_DASH);
ExtendedLowerBand.SetStyle(Curve.LONG_DASH);


----
Any help would be greatly appreciated.

Cheers

Hushhhh
 
Last edited:

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