Help on a simple reversal thinkscript

gregoryK

New member
VIP
new to coding so this may be very simple, but I'm trying to create a reversal scan that tells me when price hits the 34EMA (touches or crosses) and then crosses back up to cross the 8EMA. Not the EMAs crossing but the price bars (on the 15, but obviously the code will work on any time frame). It would also be nice, if possible if I could have it alert if the price comes NEAR the 34EMA - though I don't know how you'd do that. Once I create that scan I'd like to put it in my watchlist with a color indicator to alert me when this activity has occurred.

As for PUTs, I think the inverse would be when price touches the 8EMA then falls below the 34.

If I'm asking something that's already been done, and you don't mind sending me a link, I'd appreciate it and if this isn't clear, I'm happy to qualify. I know in TOS you can set a scan for these activities individually I'm just not sure how to do it for a sequence of activities.
 
sure I'll show 2:

the 34 is the blue line and the 8 is the dotted yellow:

here is LVS on the 15 from today:

hmmm....I'm embarrassed to say I have no idea how to import an image into here. it's asking for a link but these are shots I put on the desktop. can you tell me how to import a screenshot into this thread?

well didn't know how to do it...but this seems like a method, though it's not embedded - apologies.

this is LVS and you'll see the stock hit the 34 EMA then bounced up and crossed the 8, this is potentially a sign of a reversal for the day

RMVxbc0.png


another example:

SWN same thing as the 2nd and 3rd bar on the 15 SWN crossed the 34 (touching or crossing is fine) then it bounced up and through the 8EMA...and continued for the rest of the day

3VqqHnK.png


in both cases and many more I could include this is a nice indicator to see if a stock is potentially reversing.
 
Last edited by a moderator:
an update to my request...I have tried something but can't quite make it work in terms of an alert on my watchlist. I'm new to thinkscript so ...be kind :) the idea is that I get an alert when a bar goes near the 34 (thus I used the 32) and then moves back up through the 8

def EMA32 = low crosses below ExpAverage(low(), 32) within 10 bars;
def EMA8 = close crosses above ExpAverage(low(), 8) within 5 bars;
plot signal = ema32 and ema8;
signal.AssignValueColor(if signal then Color.PLUM else Color.BLACK);

this does not work for a watchlist and any assistance would be greatly appreciated.
 
an update to my request...I have tried something but can't quite make it work in terms of an alert on my watchlist. I'm new to thinkscript so ...be kind :) the idea is that I get an alert when a bar goes near the 34 (thus I used the 32) and then moves back up through the 8

def EMA32 = low crosses below ExpAverage(low(), 32) within 10 bars;
def EMA8 = close crosses above ExpAverage(low(), 8) within 5 bars;
plot signal = ema32 and ema8;
signal.AssignValueColor(if signal then Color.PLUM else Color.BLACK);

this does not work for a watchlist and any assistance would be greatly appreciated.
Hi All,
i'm new to thinkscript as well. I have tried to do this in TOS as well but i do get false breakouts. what i would like is to see is a stock in an uptrend or downtrend for about 2 weeks first before they cross over. Does anyone know how to do this?

Regards,
LeonRossi
 

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
522 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