To Use The Matrix Series Indicator in the Scan Hacker
To Filter For: when Matrix Indicator candle (in downtrend) touches -200 or candle (uptrend) touches +200.
Save the code below in your study tab
The scan filters are:
To set up the scan filters in the Scan Hacker, follow this tutorial:
https://usethinkscript.com/threads/how-to-use-thinkorswim-stock-hacker-scans.284/
@Cedar
To Filter For: when Matrix Indicator candle (in downtrend) touches -200 or candle (uptrend) touches +200.
Save the code below in your study tab
The scan filters are:
ordowntrend200 is true
uptrend200 is true
To set up the scan filters in the Scan Hacker, follow this tutorial:
https://usethinkscript.com/threads/how-to-use-thinkorswim-stock-hacker-scans.284/


Ruby:
#Matrix Series Scanner ONLY
# To Filter For: when Matrix Indicator candle (in down trend) touches -200 or candle (uptrend) touches +200.
#INPUTS
input Smoother = 5;
input SupResPeriod = 50;
input SupResPercentage = 100;
input PricePeriod = 16;
input ob = 200;
input os = -200;
#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 Ll = If(up < down, down, up);
def Cc = Ll;
def trend = if Oo > Cc then 0 else if up > down then 1 else 0;
plot downtrend200 = Cc crosses below -200; downtrend200.hide();
plot uptrend200 = Cc crosses above 200 ; uptrend200.hide();
addchartbubble(downtrend200, high, " ", color.dark_green);
addchartbubble(uptrend200, high, " ", color.dark_red);
@Cedar