1 Minute TSI with 10 Minute EMA Cloud Momentum Indicator

a1cturner

Well-known member
I need help with the last part of this study. Updated Code: http://tos.mx/t0QVyfO

Background. This will only work on a One Minute Chart. It measures that the True Strength Index is above 25 on a 1 minute chart and both the 5/12 EMAs and 34/50EMAs are Bearish on a 10 minute chart or vice versa that the True Strength Index is below -25 on a 1 minute chart and both the 5/12 EMAs and 34/50 EMAs are Bullish on a 10 minute chart.

It plots a green arrow on the lower study when I am to set a TRAILING buy order to catch a short reversal in a strong trend.

So far it looks very promising except for when the reversal turns out to more than a short reversal and turns into a trend change.

The difference for me between a short reversal and a trend change is when the bearish 5 EMA crosses back above the 12 EMA or vice versa when the bullish 5 EMA crosses back below the 12 EMA.

All I want to do is add something (a red arrow) to the end of the code that visually tells me that the signal is no longer valid because of the trend change (5EMA crosses above 12EMA or vice versa 5EMA crosses below 12EMA).

I have tried a few different things but it just changes my original arrows to red.

If someone can give it a shot please I would appreciate it! It shouldn't be more than 2-4 more lines of code.

P.S. Every chart that I have looked at where this triggers would have worked out perfectly except one or two.

Once I get it perfected then I can build a scanner.

S3lbvil.png



If I had a trailing buy order in I would have just canceled it when the EMAs crossed and I have full confidence that it would not have been a problem.


l68G9Xk.png
 
Last edited:
Added a VIX EMA parameter to the code so you get a red arrow if you are buying against the market trend as defined by VIX.

http://tos.mx/F4qZEXj

#JT MOMENTUM CHANGE INDICATOR

#USED TO IDENTIFY SHORT REVERSALS IN LONGER TRENDS FOR SCALPS OR DAY TRADES ONLY.
#USE ON 1 MINUTE CHART ONLY BUT IN CONJUNCTION WITH 10 MINUTE CHART.
#I USE 5/12 AND 34/50 EMA CLOUDS ON MY 10 MINUTE CHART ALONG WITH A FASTER MACD (10, 22, 8) AND RSI.

#ONCE THE INDICATOR IS TRIGGERED WITH ARROW UP I WILL SUBMIT A 50ish DELTA CALL, 10% TRAILING STOP, BUY ORDER, ON THE BID.
#ONCE THE INDICATOR IS TRIGGERED WITH ARROW DOWN I WILL SUBMIT A 50ish DELTA PUT, 10% TRAILING STOP, BUY ORDER, ON THE BID.

#ALWAYS LOOK AT THE VOLUME OF THE OPTION YOU ARE BUYING!#

#PLAY STOCKS THAT YOU KNOW WHERE SUPPORT/RESISTANCE ARE IF POSSIBLE#

#IF THE SIGNAL STOPS BEFORE YOUR BUY TRIGGERS THAN CANCEL THE ORDER AND MOVE ON TO THE NEXT OPPURTUNITY#

#EXIT IS YOUR PREFERENCE BUT I WATCH THE 10 MINUTE 5/12 EMA CLOUD, MACD, VOLUME ETC TO TIME MY EXIT.
#I AM ALSO COMFORTABLE WITH A 50% LOSS BECAUSE I BELIEVE THAT I CAN ACHIEVE A 100% GAIN MORE OFTEN THAN NOT.
#IF I AM BEING CONSERVAITVE THOUGH I WILL WATCH FOR THE PRICE TO EXTEND SIGNIFICANTLY FROM THE 5/12 EMA AND THEN SET A 10%-15% TRAILING SELL ORDER ON THE ASK.

declare lower;

input MovAvg = AverageType.EXPONENTIAL;
input TSITimeShort = aggregationPeriod.MIN;
input TSITimeLong = aggregationPeriod.TEN_MIN;
input EMATime = aggregationPeriod.TEN_MIN;
input MACDTime = aggregationPeriod.TEN_MIN;
input TSILongLength = 34;
input TSIShortLength = 5;
input TSISignalLength = 5;
input EMAFast1 = 5;
input EMAFast2 = 12;
input EMASlow1 = 34;
input EMASlow2 = 50;
input MACDFast = 10;
input MACDSlow = 22;
input MACDLength = 8;
input Symbol = "VIX";

#CLOSE
def TSICloseShort = close(period=TSITimeShort);
def TSICloseLong = close(period=TSITimeLong);
def EMAClose = close(period=EMATime);
def MACDClose = close(period=MACDTime);
def Data = close(Symbol, period=EMATime);

#TRUE STENGTH INDEX(TSI)
def DiffShort = TSICloseShort - TSICloseShort[1];
def DiffLong = TSICloseLong - TSICloseLong[1];
def DoubleSmoothedAbsDiffShort = MovingAverage(MovAvg, MovingAverage(MovAvg, AbsValue(diffShort), TSILongLength), TSIShortLength);
def DoubleSmoothedAbsDiffLong = MovingAverage(MovAvg, MovingAverage(MovAvg, AbsValue(diffLong), TSILongLength), TSIShortLength);

#TSI 1 Min
plot TSIShort;
plot SignalShort;

TSIShort = if DoubleSmoothedAbsDiffShort == 0 then 0
else 100 * (MovingAverage(MovAvg, MovingAverage(MovAvg, DiffShort, TSILongLength), TSIShortLength)) / DoubleSmoothedAbsDiffShort;
SignalShort = MovingAverage(MovAvg, TSIShort, TSISignalLength);

def ZeroLine2 = 0;

TSIShort.SetDefaultColor(GetColor(1));
SignalShort.SetDefaultColor(GetColor(8));
SignalShort.hide();

plot HighLvl1 = 25;
HighLvl1.setDefaultColor(color.dark_green);
HighLvl1.hidebubble();
HighLvl1.hidetitle();

plot LowLvl1 = -25;
LowLvl1.setDefaultColor(color.dark_red);
LowLvl1.hidebubble();
LowLvl1.hidetitle();

#TSI 10 Min
def TSILong;
def SignalLong;

TSILong = if DoubleSmoothedAbsDiffLong == 0 then 0
else 100 * (MovingAverage(MovAvg, MovingAverage(MovAvg, DiffLong, TSILongLength), TSIShortLength)) / DoubleSmoothedAbsDiffLong;
SignalLong = MovingAverage(MovAvg, TSILong, TSISignalLength);

def ZeroLine1 = 0;

#EMAs
def EMA1 = MovingAverage(MovAvg, EMAClose, EMAFast1);
def EMA2 = MovingAverage(MovAvg, EMAClose, EMAFast2);
def EMA3 = MovingAverage(MovAvg, EMAClose, EMASlow1);
def EMA4 = MovingAverage(MovAvg, EMAClose, EMASlow2);
def CompareEMA1 = MovingAverage(MovAvg, Data, EMAFast1);
def CompareEMA2 = MovingAverage(MovAvg, Data, EMAFast2);

#EMA PERCENT
def EMApct = ((ema1 / ema2)*100)-100;
plot EMApctRound = round(EMApct, 2);

#MACD
def MACD = MovingAverage(MovAvg, MACDClose, MACDFast) -
MovingAverage(MovAvg, MACDClose, MACDSlow);
def MACDVar = MovingAverage(MovAvg, MACD, MACDLength);
def MACDDiff = round((MACD - MACDVar), 4);

#GET READY INDICATOR
Plot ArrowUp1 = if (TSIShort between -18 and -24.99) and (EMA1>EMA2) and (EMA3>EMA4) and (MACDDiff > 0) and (CompareEMA1 < CompareEMA2)
then -25
else double.nan;
Arrowup1.SetPaintingStrategy(PaintingStrategy.arrow_up);
ArrowUp1.SetLineWeight(2);
ArrowUp1.SetDefaultColor(Color.orange);
plot ArrowDN1 = if (TSIShort between 18 and 24.99) and (EMA1<EMA2) and (EMA3<EMA4) and (MACDDiff < 0) and (CompareEMA1 > CompareEMA2)
then 25
else double.nan;
ArrowDN1.SetPaintingStrategy(PaintingStrategy.arrow_down);
ArrowDN1.SetLineWeight(2);
ArrowDN1.SetDefaultColor(Color.orange);

#BUY INDICATOR
Plot ArrowUp2 = if (TSIShort < -25) and (EMA1>EMA2) and (EMA3>EMA4) and (MACDDiff > 0) and (CompareEMA1 < CompareEMA2)
then -25
else double.nan;
Arrowup2.SetPaintingStrategy(PaintingStrategy.arrow_up);
ArrowUp2.SetLineWeight(2);
ArrowUp2.SetDefaultColor(Color.green);
plot ArrowDN2 = if (TSIShort > 25) and (EMA1<EMA2) and (EMA3<EMA4) and (MACDDiff < 0) and (CompareEMA1 > CompareEMA2)
then 25
else double.nan;
ArrowDN2.SetPaintingStrategy(PaintingStrategy.arrow_down);
ArrowDN2.SetLineWeight(2);
ArrowDN2.SetDefaultColor(Color.green);

#AGAINST MARKET TREND
Plot ArrowUp3 = if (TSIShort between -18 and -24.99) and (EMA1>EMA2) and (EMA3>EMA4) and (MACDDiff > 0) and (CompareEMA1 > CompareEMA2)
then -25
else double.nan;
Arrowup3.SetPaintingStrategy(PaintingStrategy.arrow_up);
ArrowUp3.SetLineWeight(2);
ArrowUp3.SetDefaultColor(Color.cyan);
plot ArrowDN3 = if (TSIShort between 18 and 24.99) and (EMA1<EMA2) and (EMA3<EMA4) and (MACDDiff < 0) and (CompareEMA1 < CompareEMA2)
then 25
else double.nan;
ArrowDN3.SetPaintingStrategy(PaintingStrategy.arrow_down);
ArrowDN3.SetLineWeight(2);
ArrowDN3.SetDefaultColor(Color.cyan);

#AGAINST MARKET TREND2
Plot ArrowUp4 = if (TSIShort <-25) and (EMA1>EMA2) and (EMA3>EMA4) and (MACDDiff > 0) and (CompareEMA1 > CompareEMA2)
then -25
else double.nan;
Arrowup4.SetPaintingStrategy(PaintingStrategy.arrow_up);
ArrowUp4.SetLineWeight(2);
ArrowUp4.SetDefaultColor(Color.red);
plot ArrowDN4 = if (TSIShort >25) and (EMA1<EMA2) and (EMA3<EMA4) and (MACDDiff < 0) and (CompareEMA1 < CompareEMA2)
then 25
else double.nan;
ArrowDN4.SetPaintingStrategy(PaintingStrategy.arrow_down);
ArrowDN4.SetLineWeight(2);
ArrowDN4.SetDefaultColor(Color.red);
#SCANNER
#CALL SCANNER
#http://tos.mx/Q8TQIeB
#PUT SCANNER
#http://tos.mx/GXBvdf0
 
Last edited:
This is what the buy indicators should look like on your watch list. All you have to do is go to look at the volume and then check the chart and make a decision on what you think the market will do.

This is just another tool and definitely not the end all be all.

bn4IGb0.png
can you share the macd and ema watchlist indicators?
 
thank you so much. I just put your script into tos and started scrolling through the actionable signals and its impressive, I like how it seems to work out right away and if not then you can easily exit with a small loss. I‘m looking forward to following along with your posts and thanks again.
 
Whelp today didn't work out. I had some XOM swings from yesterday that I sold WAY too early (up 300% from my sell price already at 9:20 CST). That has nothing to do with the indicator except it did plot a PUT buy against the market trend, which was wrong. I then revenge traded QQQ because of the CALL indicator with the market trend, which failed.

I don't know if this is a fluke, the market is irrational, I **** at trading, or if this indicator is just another one that didn't work.

I will keep watching and trying as long as my account can support it.

Any success stories would be great! Haha
 

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

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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