Stacked EMA Strategy

One0926

New member
VIP
Hi Community

I'm wondering if the below code is the most efficient manner in which to approach this script (from a syntax perspective).
Code:
def price = close;
def ema3 = expAverage(close,3);
def ema15 = expAverage(close,15);
def ema30 = expAverage(close,30);
def ema60 = expAverage(close,60);
def emadistmembrane1pct = (ema15 / ema30) - 1;
def ascension = ema30 crosses above ema60;
def descension = ema30 crosses below ema60;

Plot ema5Up = if close crosses above ema3 and ema3<ema15 and ema15<ema30 and ema60>ema30 and emadistmembrane1pct>-0.02 then 1 else close crosses above ema60 and ema30>ema15 and ema15 crosses above ema60[8]and ascension[8];

Plot ema5Dn = if close crosses below ema3 and ema3>ema15 and ema15>ema30 and ema30>ema60 and emadistmembrane1pct<0.02 then 1 else close crosses below ema60 and ema15>ema30 and ema15 crosses below ema60[8] and descension[8];


The idea here is as close passes through the stack of ema's and the distance between ema's 15 and 30 as price action ascends >-0.02 percent with the reverse being true if price action descends <0.02 percent.
I hope the information provided is helpful and welcome all the correction and help I can get.
shared chart link: http://tos.mx/!JCaU8i71 MUST follow these instructions for loading shared links.

1729108420578.png
 
Last edited by a moderator:
@One0926 Oh my, where to start...!!! That chart would like to eat the soul out of my TOS install... Now that you've thrown everything but the kitchen sink onto that poor chart it's time to start clearing out some of that hoard... Seriously...!!!

You could easily gut 75% of those indicators off of that chart and still have more than plenty to trade effectively... As it stands now, you'll be spending all of your time trying to monitor and decipher that plethora of information while barely being able to see the actual candles on the chart... I know it may be tough to hear such bluntly honest advise but sometimes what we need to hear isn't exactly what we want to hear... I used to load up my charts with far more indicators than needed until I realized I could trim the indicator count down to a point where I only use as many as I need to make two important decisions, when to enter and when to exit... And I could still cull a few more off of my charts now... Just because I can code indicators to provide lots of information doesn't mean I should load my chart up with superfluous amounts of data... I currently have a total of 13 labels on my charts, with 5 of those giving me a single piece of information, and could realistically reduce that number to 6 for a mere 2 pieces of information...

As for moving averages, more than 3 starts getting to be too many to be beneficial... Pick a specific trading strategy and stick with it, eliminating everything that doesn't support that one strategy, otherwise you'll be spending too much time sweating the details and trading will feel far more like work than an enjoyable endeavor... Work smarter, not harder...!!!

As a case in point, you have a Strategy running on your chart that as of the time of my review was showing a profit of $1,667.50 from 348 trades for an average profit per trade of less than $5 per trade over a 3 day period... Realizing that roughly 1/3 of that would go towards commissions, or more considering your Strategy is trading 25 contracts per trade, doesn't leave much left in net gains... Now, I've stated many times that TOS Strategy results are far from realistic but, hopefully, those results will tell us if we are headed in the right direction with our logic...

Now, @One0926, I'm sure you'll feel a bit beat down by my critique of your efforts but that's more or less why you started this topic - for honest critique... In short, there are simpler chart layouts that will yield more profits more easily... There are more than a few setups posted here in these forums, including several that I have used over the years... My trading style has evolved over the past 40 years and I even fell into the indicator overload rabbit hole myself... I no longer monitor the entire Stock Market and have narrowed the number of symbols I now monitor substantially (13), and now only actively trade Options for a single symbol which is SPY... And now I have a chart layout that works well with multiple candle/bar styles and timeframes/tick counts... I know at a quick glance whether or not I can enter either a Call or Put trade... Again, working smarter, not harder... What I use works for me... What you need to do is find out a simple yet effective chart setup that works for you and stick with it... Bouncing from indicator to indicator, setup to setup, is an act of futility... From my standpoint of experience, I don't see what you've provided as effective and efficient, and would be difficult to use profitably...

Just my two cents... I'm here in these forums to help as well as on Discord... With a little background information I'm sure we can get you to where you want to be... Good luck...

Edited to add: It's true that I didn't answer your initial question regarding that short snippet of code but that's because there is far more to be addressed than that code...
 
Last edited:

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

Thread starter Similar threads Forum Replies Date
K Stacked EMA Dashboard For ThinkOrSwim Questions 2
5 add cloud to the stacked EMA Questions 2
qwashing411 Stacked EMA Questions 1
P MTF Stacked Averages? Questions 0
E MTF Stacked Moving Averages Questions 3

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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