@xiaoriver this might be it:

#START OF RSI/Stochastic/MACD Confluence combo for ThinkOrSwim

#

#CHANGELOG

# 2020.10.27 V1.0

@cos251 - Added RSI, StochasticSlow and MACD to same indicator; this will plot only MACD but also

# - calculates RSI and Sotchasit; Will shade the lower plot area of the following conditions are met

# Shade GREEN = RSI > 50 and SlowK > 50 and (macd)Value > (macd)Avg

# Shade RED = RSI < 50 and SlowK < 50 and (macd)Value < (macd)Avg

#

#REQUIREMENTS - RSI Set to 7, EXPONENTIAL

# Stoch Slow 5(not14) and 3 WILDERS

# MACD 12,26,9 WEIGHTED

#

#

#CREDITS

# requesed by "

@Joseph Patrick 18"

#

#LINK

#

https://rockwell-files.s3.amazonaws.com/PXCompanionGuide2ndEd_cover.pdf
# Markus Heikoetter who is the author of the Power X Strategy

#

https://usethinkscript.com/threads/mimicking-power-x-strategy-by-markus-heitkoetter.4283/
#

#USAGE

#

declare lower;

################################################################

########## MACD #########

################################################################

input fastLengthMACD = 12;

input slowLengthMACD = 26;

input MACDLength = 9;

input averageTypeMACD = AverageType.WEIGHTED;

input showBreakoutSignals = no;

plot Value = MovingAverage(averageTypeMACD, close, fastLengthMACD) - MovingAverage(averageTypeMACD, close, slowLengthMACD);

plot Avg = MovingAverage(averageTypeMACD, Value, MACDLength);

plot Diff = Value - Avg;

plot ZeroLine = 0;

plot UpSignalMACD = if Diff crosses above ZeroLine then ZeroLine else Double.NaN;

plot DownSignalMACD = if Diff crosses below ZeroLine then ZeroLine else Double.NaN;

UpSignalMACD.SetHiding(!showBreakoutSignals);

DownSignalMACD.SetHiding(!showBreakoutSignals);

Value.SetDefaultColor(Color.GREEN);

Avg.SetDefaultColor(Color.RED);

Diff.SetDefaultColor(GetColor(5));

Diff.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);

Diff.SetLineWeight(4);

Diff.DefineColor("Positive and Up", Color.GREEN);

Diff.DefineColor("Positive and Down", Color.DARK_GREEN);

Diff.DefineColor("Negative and Down", Color.RED);

Diff.DefineColor("Negative and Up", Color.DARK_RED);

Diff.AssignValueColor(if Diff >= 0 then if Diff > Diff[1] then Diff.color("Positive and Up") else Diff.color("Positive and Down") else if Diff < Diff[1] then Diff.color("Negative and Down") else Diff.color("Negative and Up"));

ZeroLine.SetDefaultColor(GetColor(0));

UpSignalMACD.SetDefaultColor(Color.UPTICK);

UpSignalMACD.SetPaintingStrategy(PaintingStrategy.ARROW_UP);

DownSignalMACD.SetDefaultColor(Color.DOWNTICK);

DownSignalMACD.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);

################################################################

########## RSI #########

################################################################

input lengthRSI = 7;

input over_BoughtRSI = 70;

input over_SoldRSI = 30;

input price = close;

input averageTypeRSI = AverageType.EXPONENTIAL;

#input showBreakoutSignals = no;

def NetChgAvg = MovingAverage(averageTypeRSI, price - price[1], lengthRSI);

def TotChgAvg = MovingAverage(averageTypeRSI, AbsValue(price - price[1]), lengthRSI);

def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;

def RSI = 50 * (ChgRatio + 1);

################################################################

########## Stochastic Slow #########

################################################################

input over_boughtSt = 80;

input over_soldSt = 20;

input KPeriod = 5;

input DPeriod = 3;

input priceH = high;

input priceL = low;

input priceC = close;

input averageTypeStoch = AverageType.WILDERS;

input showBreakoutSignalsStoch = {default "No", "On SlowK", "On SlowD", "On SlowK & SlowD"};

def SlowK = reference StochasticFull(over_boughtSt, over_soldSt, KPeriod, DPeriod, priceH, priceL, priceC, 3, averageTypeStoch).FullK;

def SlowD = reference StochasticFull(over_boughtSt, over_soldSt, KPeriod, DPeriod, priceH, priceL, priceC, 3, averageTypeStoch).FullD;

################################################################

########## Check for signals > 50 and macd Value > Avg ########

################################################################

def rsiGreen = if RSI >= 50 then 1 else Double.NaN;

def rsiRed = if RSI < 50 then 1 else Double.NaN;

def stochGreen = if SlowK >= 50 then 1 else Double.NaN;

def stochRed = if SlowK < 50 then 1 else Double.NaN;

def macdGreen = if Value > Avg then 1 else Double.NaN;

def macdRed = if Value < Avg then 1 else Double.NaN;

#################################################################

############ Shade areas based on criteria; adjust as needed ##

#################################################################

AddCloud(if rsiGreen and stochGreen and macdGreen then Double.POSITIVE_INFINITY else Double.NaN, if rsiGreen and stochGreen then Double.NEGATIVE_INFINITY else Double.NaN, Color.LIGHT_Green);

AddCloud(if rsiRed and stochRed and macdRed then Double.POSITIVE_INFINITY else Double.NaN, if rsiRed and stochRed then Double.NEGATIVE_INFINITY else Double.NaN, Color.LIGHT_RED);