Help Coding Arrows for EMAs Set Up

Legend2.0

New member
Plus
Hello,

I'm new to the think script world, and I was wondering if someone can assist me in coding this set up for me.
$SPY: https://tos.mx/!xzSvDpTp
$QQQ: https://tos.mx/!ncmYlx34

I've been analyzing this strategy for the past few months now and it does have a good R:R ratio. I haven't tested it individual stocks but it works greatly on ETFs (SPY, QQQ, IWM, etc) for option trading.

The strategy uses 13 EMA, 48EMA, 200 EMA. Along with it are the levels of PMH, PML, including Previous Day's Highs and Lows.

For instance, If the stock is above 200EMA we would look to go long, but if it's under it we look to go short. However we need some confirmation on when to enter long or short, for which the 13EMA, 48EMA, and the levels mentioned above does help. I would look for confirmation on 2-minute chart whether to enter long or short. The 13EMA is used to ride out the winners and is also sometimes helpful to enter as a pullback entry. 48EMA is used for mostly pullback entries.

Essentially I would like to see an upward trend and wait for the stock to pullback to 13EMA or 48EMA. Once it confirms on 2 minute chart that the EMAs are holding. I would like to see a green paint arrow showing that it's good to go long. We would then ride out the 13EMA until it breaks or we reach a resistance zone. OR if it's on a downtrend wait for the stock to pullback to 13EMA or 48EMA. Once it confirms on 2 minute chart that the EMAs are holding. I would like to see a red paint arrow showing that it's good to go short. We would then ride out the 13EMA until it breaks above or we reach a support zone.

White Line - 13EMA
Red Line - 48EMA
Blue Line - 200 EMA
Gold Line - VWAP
Here are some Examples:

$SPY
1724946016786.png


$QQQ
1724955536170.png



Hope this makes sense!
 
Last edited by a moderator:
  • I'm watching this!
Reactions: sum

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

Hello,

I'm new to the think script world, and I was wondering if someone can assist me in coding this set up for me.
$SPY: https://tos.mx/!xzSvDpTp
$QQQ: https://tos.mx/!ncmYlx34

I've been analyzing this strategy for the past few months now and it does have a good R:R ratio. I haven't tested it individual stocks but it works greatly on ETFs (SPY, QQQ, IWM, etc) for option trading.

The strategy uses 13 EMA, 48EMA, 200 EMA. Along with it are the levels of PMH, PML, including Previous Day's Highs and Lows.

For instance, If the stock is above 200EMA we would look to go long, but if it's under it we look to go short. However we need some confirmation on when to enter long or short, for which the 13EMA, 48EMA, and the levels mentioned above does help. I would look for confirmation on 2-minute chart whether to enter long or short. The 13EMA is used to ride out the winners and is also sometimes helpful to enter as a pullback entry. 48EMA is used for mostly pullback entries.

Essentially I would like to see an upward trend and wait for the stock to pullback to 13EMA or 48EMA. Once it confirms on 2 minute chart that the EMAs are holding. I would like to see a green paint arrow showing that it's good to go long. We would then ride out the 13EMA until it breaks or we reach a resistance zone. OR if it's on a downtrend wait for the stock to pullback to 13EMA or 48EMA. Once it confirms on 2 minute chart that the EMAs are holding. I would like to see a red paint arrow showing that it's good to go short. We would then ride out the 13EMA until it breaks above or we reach a support zone.

White Line - 13EMA
Red Line - 48EMA
Blue Line - 200 EMA
Gold Line - VWAP
Here are some Examples:

$SPY
$QQQ
Hope this makes sense!

i tend to be blunt and ask a lot of questions.
i try to get people to understand how to describe their question better.

your post is confusing , especially since you didn't tell us what the links contained.
why did you post 2 links, that have the same studies?
why did you post links to studies, that you don't even mention in all of your words?
..2 shared studies, vwap, and 3 averages. what are we supposed to do with the shared studies? or the vwap?

what is pmh, pml? don't use abbreviations.
confimation sounds good, but useless. need a logical expression, a formula.
upward trend? what defines it?
confirms emas holding? what does this mean? what is the formula?
what defines a resistance zone?
ride out 13ema til breaks? what does this mean? what breaks what? what is the formula?

next time when posting pics, draw numbers next to each area. then write words to describe each number.
you have 3 green circles. i don't know which rules they are related to?

also, you need to think about when to cancel the rules and start over.
if it rises, but takes 30 bars to pull back , is that too many? or do you keep waiting?


my guesses at a template,

long position
..up trend , x bars of higher highs?
..pull back , low < ema13 or low < ema48
..holding , x bars with each low > (the 1st low that crossed below )* 0.99) , then a higher low?
....green up arrow , open long position
..close long pos. , close < ema13 or close > resistance level
 
Screenshot 2024-08-30 145330.jpg


To halcyonguy's point, what's the difference between the 3 green levels you highlighted and the yellow one in between that I circled? You need to define the conditions as to what a "pullback" means. Under what conditions would you ignore the 13 and wait for the 48? It's easy to point to a chart after the fact and go "I would have liked to get in here and there". Much more difficult to tell a program that's live until well after the thing you're looking for has passed. (It's why repainting indicators are pretty useless other than to make pretty charts after the fact)

whatever your definition, just assume you'll likely be looking at 2-3 bars beyond where you circled before you would have the signal you're looking for.
 
Thank you so much for all the points. I do understand my post was very vague, which is why I did mention I'm new to this. If it is codable, it would just give a greater assurance when to enter allowing many of us the extra confirmation whether to enter the trade or not. I do understand if it is cumbersome to code as there are so many variables in play. However, I'll try to explain this as much as possible.

The custom studies I posted only markets PreMarketHigh and PreMarketLow for me. The white zones being shown are levels marked which are the previous day's high and low.

To answer @halcyonguy:
  1. I consider upward/downtrend by looking at the structure such as HigherHigh/HigherLow or LowerLow/LowerHigh.
  2. For me, the confirmation that the 13EMA holds is by looking at the wicks and seeing where the body is close. For instance, if there is a Doji that touches the 13EMA or 48EMA but doesn't penetrate it then it can be a sign that the EMA level is holding and we can enter. But, if the body passes through the EMA, it means that the EMA is not a good support or resistance, and we need to look for other confirmation.
  3. The green circles and green/red arrows were drawn by me to showcase that it wicked the 13EMA, however, the body closed above/beneath the 13EMA.
  4. As for riding the 13EMA mostly means we would have our position until the candle closes beneath/above the EMA level then we can safely assume to exit.
To answer @JoeDV:
  1. The yellow circle had the candle body closing below the 13EMA which is why I didn't circle it because it means that the 13EMA was not a strong support, which later led to a flush.
  2. We would wait for 48EMA if the 13ema breaks by looking at the body candle closing in the 2-minute chart or 5-minute chart. Once it gets to the 48EMA we would see if the candle wicks off the 48EMA or not. If it passes through it then it means both the EMA levels are not strong levels that the stock is currently respecting.

Hopefully, I have answered the majority of the questions. Sorry to be vague in my initial post.
Once again, Thank you so much for taking out the time to explain everything, and my sincerest apologies again for not being thorough.


Abbreviations:
PML - PreMarket Low; PMH - PreMarketHigh
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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