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:
Below is the Code showing version ( MACD-V - adjusted for LBR310 ) to be used for the scan:
----
Any help would be greatly appreciated.
Cheers
Hushhhh
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:
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: