SuperTrend Of MACD and Matrix

depandora

New member
Could you please add SuperTrendMACD https://usethinkscript.com/threads/supertrend-of-macd-and-avg-rsi.1720/#post-15991
to the Matrix Indicator :

this is the code:

#Matrix Series for ThinkorSwim V1.0
#
#CREDITS
# glaz
# https://www.tradingview.com/script/2X2cVLhb-Matrix-Series/
#
#CHANGELOG
# 2019.12.06 1.0 @diazlaz - Initial Port
#
#LINKS
# https://www.wisestocktrader.com/indicators/2739-flower-indicator
# https://www.wisestocktrader.com/indicators/1087-matrix-series
#
#
#DESCRIPTION
#Please use the following AFL on your exisitng AMIBROKER Chart & get a edge in
#identifying Accumulation/Distribution zone of any market.
#Each levels can act like support & resistance
#( watch for +/- 200 levels & the dots when appear on the chart )
#Title of the Flower Chart will go RED if we are entering in a Distribution
#phase & Green for Accumulation.
#This is a modified RENKO chart & should be used with MPLITE & any Momentum
#indicator combination for best results.
#
#There’re 3 ways to use it. I usually get entry position when :
#1. Candle upward before / after cross the zero line
#2. Candle downward but real candle is sideways. This will be best when price is in oversold area.
#3. Candle downward and begin to change from big to small. It is usually followed by significant movement.
#When down candle with the red real candle is occur, it almost certainly bearish signal.
#FYI, I use it in daily chart.

declare lower;

#INPUTS
input Smoother = 5;
input SupResPeriod = 50;
input SupResPercentage = 100;
input PricePeriod = 16;
input ob = 200;
input os = -200;
input showColorBars = no; #COLOR BARS
input showDynamics = no; #Dynamic zones
input showOBOS = yes; #Show OB/OS

#LOGIC
def nn = Smoother;
def ys1 = (high + low + close * 2) / 4;
def rk3 = ExpAverage(ys1, nn);
def rk4 = StDev(ys1, nn);
def rk5 = (ys1 - rk3) * 200 / rk4;
def rk6 = ExpAverage(rk5, nn);
def up = ExpAverage(rk6, nn);
def down = ExpAverage(up, nn);
def Oo = If(up < down, up, down);
def Hh = Oo;
def Ll = If(up < down, down, up);
def Cc = Ll;


def Lookback = SupResPeriod;
def PerCent = SupResPercentage;
def Pds = PricePeriod;

def C3 = CCI(length = Pds);

def Osc = C3;
def Value1 = Osc;
def Value2 = Highest(Value1, Lookback);
def Value3 = Lowest(Value1, Lookback);
def Value4 = Value2 - Value3;
def Value5 = Value4 * (PerCent / 100);
def ResistanceLine = Value3 + Value5;
def SupportLine = Value2 - Value5;

#CUSTOM CANDLES
def cUpO;
def cUpH;
def cUpL;
def cUpC;
if up > down
then {
cUpO = oo;
cUpH = hh;
cUpL = ll;
cUpC = cc;
} else {
cUpO = Double.NaN;
cUpH = Double.NaN;
cUpL = Double.NaN;
cUpC = Double.NaN;
}

def cDnO;
def cDnH;
def cDnL;
def cDnC;
if up < down
then {
cDnO = Oo;
cDnH = Hh;
cDnL = Ll;
cDnC = Cc;
} else {
cdnO = Double.NaN;
cdnH = Double.NaN;
cdnL = Double.NaN;
cdnC = Double.NaN;
}

AddChart(high = cUpH, low = cUpL, open = cUpC, close = cUpO, type = ChartType.CANDLE, COLOR.GREEN);
AddChart(high = cDnH, low = cDnL, open = cDnO, close = cDnC, type = ChartType.CANDLE, COLOR.RED);
AddChart(high = cUpH, low = cUpL, open = cUpO, close = cUpC, type = ChartType.CANDLE, growcolor = COLOR.GREEN);
AddChart(high = cDnH, low = cDnL, open = cDnC, close = cDnO, type = ChartType.CANDLE, growcolor = COLOR.RED);

#COLORBARS
AssignPriceColor(if showColorBars then
if Oo > Cc then COLOR.RED else if up > down then COLOR.GREEN
else COLOR.RED
else
COLOR.CURRENT
);

#PLOTS
plot pResistanceLine = ResistanceLine;
pResistanceLine.SetHiding(!showDynamics);

plot pSupportLine = SupportLine;
pSupportLine.SetHiding(!showDynamics);

def UpShape = if up > ob and up > down then highest(up,1) + 20 else if up > ob and up < down then highest(down,1) + 20 else Double.NaN;

def DownShape = if down < os and up > down then lowest(down,1) - 20 else if
down < os and up < down then lowest(up,1) - 20 else Double.NaN;

def sState = if !isNan(UpShape) then 100 else if !isNan(DownShape) then -100 else sState[1];

plot pUP = UpShape;
pUP.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
pUP.SetDefaultColor(Color.CYAN);
pUP.SetLineWeight(1);

plot pDown = DownShape;
pDown.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
pDown.SetDefaultColor(Color.CYAN);
pDown.SetLineWeight(1);
;

plot pOB = OB;
pOB.SetHiding(!showOBOS);

plot pOS = OS;
pOS.SetHiding(!showOBOS);
 
Last edited by a moderator:
Solution
try to combine it with SuperTrend Indicator !! if this combination will be like this :)
7.png
Sorry, no one took interest in your project. You could try to take on the project yourself:
https://usethinkscript.com/threads/combine-studies-indicators-in-thinkorswim.8766/
Sure gives an idea which way the trend is. When you get the approved code Plz post it

As long as it works on the desktop, on my watchlist on some of the symbols it gets compressed
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Thread starter Similar threads Forum Replies Date
N Looking For SuperTrend Questions 1
rvaidyamath TTM with SuperTrend Questions 0
PAYtience Supertrend with 2 timeframes Questions 0
F SuperTrend RSI Strategy Help Questions 1
M Supertrend indicator Questions 3

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
496 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