Repaints MTF Incredible Hulk Indicator For ThinkOrSwim

Repaints

Bingy

Member
Here is an indictor I created and have been toying around with for a while now. It's my unique take on the traditional RSI and it essentially seeks to find strong long positions. Like big moves, not tiny ones. The point is to wait until there has been a long period of all grey lines, then to wait for the first time all 3 lines go green simultaneously in live time and for the top left to say "HULK SMASH". Then waiting for that current candle to close. It uses MTF's, so it repaints, making it difficult to back-test, but you can most certainly use the "OnDemand" feature to see how it operates. There are other potential uses for this that aren't hard coded in to generate signals. Looking at it long enough may help to reveal something. It works best on the 15min time-frame. Enjoy!



Code:
declare lower;


###################
#Four Hour RSI
###################

input length_Fourhour = 14;
input over_Bought_Fourhour = 70;
input over_Sold_Fourhour = 38;
input power = 42; #50
input price_Fourhour = close;
input averageType_FourHour = AverageType.WILDERS;
input showBreakoutSignals_Fourhour = no;

def FourhourClose = close(period = AggregationPeriod.FOUR_HOURS);
def NetChgAvg = MovingAverage(averageType_FourHour, FourhourClose - FourhourClose[1], length_Fourhour);
def TotChgAvg = MovingAverage(averageType_FourHour, AbsValue(FourhourClose - FourhourClose[1]), length_Fourhour);
def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;

def RSI_Fourhour = 50 * (ChgRatio + 1);


####################
#DAILY RSI
####################

input length_Daily = 14;
input over_Bought_Daily = 70;
input over_Sold_Daily = 35;
input powerline = 50;
input DailyMiddleLine = 45;
input price_Daily = close;
input averageType_Daily = AverageType.WILDERS;
input showBreakoutSignals_Daily = no;

def DailyClose = close(period = AggregationPeriod.DAY);
def DAILYNetChgAvg = MovingAverage(averageType_Daily, DailyClose - DailyClose[1], length_Daily);
def DAILYTotChgAvg = MovingAverage(averageType_Daily, AbsValue(DailyClose - DailyClose[1]), length_Daily);
def DAILYChgRatio = if DAILYTotChgAvg != 0 then DAILYNetChgAvg / DAILYTotChgAvg else 0;

def RSI_Daily = 50 * (DAILYChgRatio + 1);
def OverSold_Daily = over_Sold_Daily;
def OverBought_Daily = over_Bought_Daily;
def DailyMid = DailyMiddleLine;
def Dailypowerline = powerline;

################
#Regular RSI
################

input RSIlength = 14;
input over_Bought = 70;
input Mid_line = 50;
input over_Sold = 30;
input RSIprice = close;
input RSIaverageType = AverageType.EXPONENTIAL;

def RegularNetChgAvg = MovingAverage(RSIaverageType, RSIprice - RSIprice[1], RSIlength);
def RegularTotChgAvg = MovingAverage(RSIaverageType, AbsValue(RSIprice - RSIprice[1]), RSIlength);
def RegularChgRatio = if RegularTotChgAvg != 0 then RegularNetChgAvg / RegularTotChgAvg else 0;

def RSI = 50 * (RegularChgRatio + 1);

def RSIPlot = RSI;
def RSIOverSold = over_Sold;
def RSIOverBought = over_Bought;
def Midline = Mid_line;

# Calculate SMA of RSI values
input SMA_length = 5;
def RSI_SMA = MovingAverage(RSIaverageType, RSI, SMA_length);

def RSISMAPlot = RSI_SMA;

##################
#Plots
##################



# Plot the RSI lines
plot RSI_Fourhour_Line = RSI_Fourhour;
RSI_Fourhour_Line.AssignValueColor(if RSI_Daily > Dailypowerline and RSI_Fourhour > power and RSI_Fourhour > RSI_Daily then Color.GREEN else GetColor(3));  # Change color to your preference

plot RSI_Daily_Line = RSI_Daily;
RSI_Daily_Line.AssignValueColor(if RSI_Daily > Dailypowerline then Color.GREEN else GetColor(3));

def RSI_Change = RSI - RSI[1];

# Define the condition for RSI_Daily increase by 5.75 or more
def RSI_Increase = RSI_Change >= 10.00;



plot RSI_Regular_Line = RSIPlot;
RSI_Regular_Line.AssignValueColor(if RSI_Daily > Dailypowerline and RSI_Fourhour > power and RSI_Fourhour > RSI_Daily and RSI > RSI_Daily and RSI > RSI_Fourhour and RSI_Increase then Color.GREEN else GetColor(3));  # Change color to your preference
RSI_Regular_Line.SetLineWeight(2);  # Adjust the width as needed


def HulkSmash = RSI_Daily > Dailypowerline and RSI_Fourhour > power and RSI_Fourhour > RSI_Daily and RSI > RSI_Daily and RSI > RSI_Fourhour and RSI_Increase;

def Not_HulkSmash = !RSI_Daily > Dailypowerline and RSI_Fourhour > power and RSI_Fourhour > RSI_Daily and RSI > RSI_Daily and RSI > RSI_Fourhour and RSI_Increase;

AddLabel(yes, if HulkSmash then "HULK SMASH!" else if Not_HulkSmash then "Stay Patient" else "Stay Patient", if HulkSmash then Color.GREEN else if Not_HulkSmash then Color.GRAY else Color.GRAY);

# Define the buy conditions
def buyCondition = RSI_Fourhour < over_Sold_Fourhour &&
                  RSI_Daily < over_Sold_Daily &&
                  RSIPlot crosses above RSIOversold;

# Plot a marker when the buy conditions are met
#plot BuySignal = buyCondition;
#BuySignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
#BuySignal.SetDefaultColor(Color.GREEN);
#BuySignal.SetLineWeight(2);
 
Last edited:
This thing really does work well. Just saying, keep it on your chart for a few weeks and watch what it tells you. It works super good after a big move and there is a period of tight consolidation. If you simply draw a line of resistance above that consolidating area and wait for the indicator to tell you "Hulk Smash" you can get it on really big moves to the upside. Look at the giant spike up on /ES at 8:30 on 11/14, photo below to depict what I mean. With this being a break of support you didn't even really need to wait until the candle close, though it's advisable and would have still be very profitable even if you did.

It also caught the move today 11/20/23 on /ES at 13:00. These are strong moves. "Incredible Hulk"...
 

Attachments

  • Hulk Smash.png
    Hulk Smash.png
    73.9 KB · Views: 531
Last edited:
Here is an indictor I created and have been toying around with for a while now. It's my unique take on the traditional RSI and it essentially seeks to find strong long positions. Like big moves, not tiny ones. The point is to wait until there has been a long period of all grey lines, then to wait for the first time all 3 lines go green simultaneously in live time and for the top left to say "HULK SMASH". Then waiting for that current candle to close. It uses MTF's, so it repaints, making it difficult to back-test, but you can most certainly use the "OnDemand" feature to see how it operates. There are other potential uses for this that aren't hard coded in to generate signals. Looking at it long enough may help to reveal something. It works best on the 15min time-frame. Enjoy!



Code:
declare lower;


###################
#Four Hour RSI
###################

input length_Fourhour = 14;
input over_Bought_Fourhour = 70;
input over_Sold_Fourhour = 38;
input power = 42; #50
input price_Fourhour = close;
input averageType_FourHour = AverageType.WILDERS;
input showBreakoutSignals_Fourhour = no;

def FourhourClose = close(period = AggregationPeriod.FOUR_HOURS);
def NetChgAvg = MovingAverage(averageType_FourHour, FourhourClose - FourhourClose[1], length_Fourhour);
def TotChgAvg = MovingAverage(averageType_FourHour, AbsValue(FourhourClose - FourhourClose[1]), length_Fourhour);
def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;

def RSI_Fourhour = 50 * (ChgRatio + 1);


####################
#DAILY RSI
####################

input length_Daily = 14;
input over_Bought_Daily = 70;
input over_Sold_Daily = 35;
input powerline = 50;
input DailyMiddleLine = 45;
input price_Daily = close;
input averageType_Daily = AverageType.WILDERS;
input showBreakoutSignals_Daily = no;

def DailyClose = close(period = AggregationPeriod.DAY);
def DAILYNetChgAvg = MovingAverage(averageType_Daily, DailyClose - DailyClose[1], length_Daily);
def DAILYTotChgAvg = MovingAverage(averageType_Daily, AbsValue(DailyClose - DailyClose[1]), length_Daily);
def DAILYChgRatio = if DAILYTotChgAvg != 0 then DAILYNetChgAvg / DAILYTotChgAvg else 0;

def RSI_Daily = 50 * (DAILYChgRatio + 1);
def OverSold_Daily = over_Sold_Daily;
def OverBought_Daily = over_Bought_Daily;
def DailyMid = DailyMiddleLine;
def Dailypowerline = powerline;

################
#Regular RSI
################

input RSIlength = 14;
input over_Bought = 70;
input Mid_line = 50;
input over_Sold = 30;
input RSIprice = close;
input RSIaverageType = AverageType.EXPONENTIAL;

def RegularNetChgAvg = MovingAverage(RSIaverageType, RSIprice - RSIprice[1], RSIlength);
def RegularTotChgAvg = MovingAverage(RSIaverageType, AbsValue(RSIprice - RSIprice[1]), RSIlength);
def RegularChgRatio = if RegularTotChgAvg != 0 then RegularNetChgAvg / RegularTotChgAvg else 0;

def RSI = 50 * (RegularChgRatio + 1);

def RSIPlot = RSI;
def RSIOverSold = over_Sold;
def RSIOverBought = over_Bought;
def Midline = Mid_line;

# Calculate SMA of RSI values
input SMA_length = 5;
def RSI_SMA = MovingAverage(RSIaverageType, RSI, SMA_length);

def RSISMAPlot = RSI_SMA;

##################
#Plots
##################



# Plot the RSI lines
plot RSI_Fourhour_Line = RSI_Fourhour;
RSI_Fourhour_Line.AssignValueColor(if RSI_Daily > Dailypowerline and RSI_Fourhour > power and RSI_Fourhour > RSI_Daily then Color.GREEN else GetColor(3));  # Change color to your preference

plot RSI_Daily_Line = RSI_Daily;
RSI_Daily_Line.AssignValueColor(if RSI_Daily > Dailypowerline then Color.GREEN else GetColor(3));

def RSI_Change = RSI - RSI[1];

# Define the condition for RSI_Daily increase by 5.75 or more
def RSI_Increase = RSI_Change >= 10.00;



plot RSI_Regular_Line = RSIPlot;
RSI_Regular_Line.AssignValueColor(if RSI_Daily > Dailypowerline and RSI_Fourhour > power and RSI_Fourhour > RSI_Daily and RSI > RSI_Daily and RSI > RSI_Fourhour and RSI_Increase then Color.GREEN else GetColor(3));  # Change color to your preference
RSI_Regular_Line.SetLineWeight(2);  # Adjust the width as needed


def HulkSmash = RSI_Daily > Dailypowerline and RSI_Fourhour > power and RSI_Fourhour > RSI_Daily and RSI > RSI_Daily and RSI > RSI_Fourhour and RSI_Increase;

def Not_HulkSmash = !RSI_Daily > Dailypowerline and RSI_Fourhour > power and RSI_Fourhour > RSI_Daily and RSI > RSI_Daily and RSI > RSI_Fourhour and RSI_Increase;

AddLabel(yes, if HulkSmash then "HULK SMASH!" else if Not_HulkSmash then "Stay Patient" else "Stay Patient", if HulkSmash then Color.GREEN else if Not_HulkSmash then Color.GRAY else Color.GRAY);

# Define the buy conditions
def buyCondition = RSI_Fourhour < over_Sold_Fourhour &&
                  RSI_Daily < over_Sold_Daily &&
                  RSIPlot crosses above RSIOversold;

# Plot a marker when the buy conditions are met
#plot BuySignal = buyCondition;
#BuySignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
#BuySignal.SetDefaultColor(Color.GREEN);
#BuySignal.SetLineWeight(2);

Really good strategy. Is there a way to put an alert on this?
 
Really good strategy. Is there a way to put an alert on this
It just worked again on 12/13 on futures. Whoever said MTF cant be used for entries isn't using MTF correctly. It does work, if done correctly.
 
Last edited by a moderator:
mod note:
Yes, repainters look amazing on days like 12/13.
Gotta love good Fed News days!
psdlS3n.png

If you are only going to trade on historical record days like 12/13, then you might consider using repainting stock indicators. These indicators give a visually appealing appearance and can seem quite accurate under such circumstances.

However, conventional wisdom in trading, as outlined in most textbooks and research studies, emphasize that the necessary higher timeframe comprehensive view of the market dynamics cannot be attained with a repainting multi-timeframe indicator.

Trading decisions based on a single repainting candle are generally not considered a reliable trading strategy. It's essential to use multiple indicators that don't correlate too closely with each other. When you have several non-collinear indicators that confirm a trading signal on your three timeframes, the reliance on a repainting indicator becomes less necessary or even unnecessary at that point.
 
Last edited:
mod note:
Yes, repainters look amazing on days like 12/13.
Gotta love good Fed News days!
psdlS3n.png

If you are only going to trade on historical record days like 12/13, then you might consider using repainting stock indicators. These indicators give a visually appealing appearance and can seem quite accurate under such circumstances.

However, conventional wisdom in trading, as outlined in most textbooks and research studies, emphasize that the necessary higher timeframe comprehensive view of the market dynamics cannot be attained with a repainting multi-timeframe indicator.

Trading decisions based on a single repainting candle are generally not considered a reliable trading strategy. It's essential to use multiple indicators that don't correlate too closely with each other. When you have several non-collinear indicators that confirm a trading signal on your three timeframes, the reliance on a repainting indicator becomes less necessary or even unnecessary at that point.
Hey @MerryDay,

I highly respect your opinion, but I'd also like to challenge it a bit. Have you ever created a MTF strategy that runs the risk of repainting, then backed the parameters down slightly to allow it to turn against you a little bit to lessen the risk of the repaint? And have you ever tried making an exit/stop loss strategy that would kick in first before the lessened criteria has a chance to repaint?

I've posted an example below of where I do this. You can see the move turned against me considerably and it doesn't repaint. It doesn't do it in live time either. We're talking $4607 to $4573 with no repaint on /ES. I have also included a time when this MTF signal loses(second image) and it doesn't repaint(also in live time).

I'm of the opinion that it's possible to do because I've done it.

I implore you to fiddle around with the idea yourself...
 

Attachments

  • image (10).png
    image (10).png
    18.6 KB · Views: 129
  • image (11).png
    image (11).png
    23.1 KB · Views: 132
Last edited:
MTF indicators repaint on every tick. Think about it, obviously there is repainting because it is not possible to predict what the close of the 4hr candle is going to be on the 15min chart. It has to go back and repaint sixteen 15min candles after the close of each 4hr candle.

Whether the repainting effects your strategy depends on what type of trading day is occurring. On a strong bullish trending day, such as you saw on 12/13; it will probably start with a bullish signal and end with a bullish signal.

However, from 1999 – 2019, the stock market, as defined by the S&P 500, has had mixed trading, for 70% of the days. On those types of days, as well as, on the more recent highly volatile trading days, you are more likely to get mixed signals during the repainting of the 16 bars, only to have the signals disappear at the end or have a signal suddenly be repainted back to 16 bars previous.

The real power in the use of Multi-Timeframe (MTF) indicators lies not in tracking the immediate tick activity on both timeframes, but in recognizing the cyclical nature of stocks.

MTF indicators gain power when you use them to assess the historical data over the last 200 bars on a higher timeframe. This helps determine the current position in the cycle and, consequently, aids in forecasting the likely future movements on the lower timeframe.

Hope This Helps.
 
Last edited:
MTF indicators repaint on every tick. Think about it, obviously there is repainting because it is not possible to predict what the close of the 4hr candle is going to be on the 15min chart. It has to go back and repaint sixteen 15min candles after the close of each 4hr candle.

Whether the repainting effects your strategy depends on what type of trading day is occurring. On a strong bullish trending day, such as you saw on 12/13; it will probably start with a bullish signal and end with a bullish signal.

However, from 1999 – 2019, the stock market, as defined by the S&P 500, has had mixed trading, for 70% of the days. On those types of days, as well as, on the more recent highly volatile trading days, you are more likely to get mixed signals during the repainting of the 16 bars, only to have the signals disappear at the end or have a signal suddenly be repainted back to 16 bars previous.

The real power in the use of Multi-Timeframe (MTF) indicators lies not in tracking the immediate tick activity on both timeframes, but in recognizing the cyclical nature of stocks.

MTF indicators gain power when you use them to assess the historical data over the last 200 bars on a higher timeframe. This helps determine the current position in the cycle and, consequently, aids in forecasting the likely future movements on the lower timeframe.

Hope This Helps.
Took me a bit but, Merry banged it into my head as well. She is right.
 
Bingy, does it follow that the exit signal is when the three lines turn gray again? Also, the indicator I loaded doesn't display the red line on the lower panel.
 
Last edited:

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

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
343 Online
Create Post

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