NexusFi: Find Your Edge


Home Menu

 





Easylanguage Strategy using EMAs


Discussion in TradeStation

Updated
    1. trending_up 1,664 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 5 posts
    2. attach_file 7 attachments




 
Search this Thread

Easylanguage Strategy using EMAs

  #1 (permalink)
drummerman9421
Holmdel NJ/US
 
Posts: 6 since Oct 2019
Thanks Given: 1
Thanks Received: 0

I am new to the game but have found some gains while trading ES futures when four EMAs align and I normally follow it up or down long or short. Curious if anyone has automated a strategy like this? I have one now but there is signifcant drawdown.

Thank you

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Better Renko Gaps
The Elite Circle
Cheap historycal L1 data for stocks
Stocks and ETFs
What broker to use for trading palladium futures
Commodities
Trade idea based off three indicators.
Traders Hideout
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
  #2 (permalink)
 semiopen 
hillsborough nj
 
Experience: Advanced
Platform: Tradestation/Excel
Broker: TradeStation
Trading: emicro
Posts: 98 since Sep 2018
Thanks Given: 18
Thanks Received: 46

I've posted several times about above and below states of various indicator levels.

Your proposal apparently is to go long when current price (whatever that is) is above four different EMA levels.

That should make money over the long term but you are taking a hit when you buy and when you sell. Moreover, it is not like the instrument will not do well when that alignment isn't there. Shorting equity indexes has generally been questionable for the last ten years or so.

The table below shows the profit for SPY since 10/15/2015 through yesterday for trading four reasonable combinations of four EMAs. Each combination buys $10K worth of SPY for each trade.




The FProf numbers aren't consistent so one can't make a generalization about which is "better" to play, but E13E21E31E43 has the best results for that period. Note Win % is a little less than 50. AR0 and AR1e shows one loses 67 basis points on average on entries and 74 basis points on exits.

The table below shows the results of trading all the states. Sort of typical numbers. AAAA and BBBB consistently make money, the other states are rare and somewhat questionable.



BBBB should generally make about the same as AAAA. The four year period we are looking at slightly favors AAAA. Note AR0 and AR1e for BBBB shows gains compared to AAAA.

The two tables below show results for SPY, QQQ and IWM for this period.





Note ALen and TLen for AAAA and BBBB. BBBB makes money with much less time in the market. The win % for BBBB is almost always better than AAAA and above 50%.

The strategy itself is pretty naive and automation doesn't buy much.

Reply With Quote
Thanked by:
  #3 (permalink)
drummerman9421
Holmdel NJ/US
 
Posts: 6 since Oct 2019
Thanks Given: 1
Thanks Received: 0


Hey Semiopen:

Thanks for reply. I have been working on doing it with NQ futures on 5 min intervals. Ideally 6 contracts. 3 contracts have a close target and the others run. Stop losses have IBOG on. As long as the four emas fast>medium>slow> super slow you go long and the opposite for short. I added a slope variable to filter out getting in on stagnant moves. The strategy is naive but when the markets are taking these big swings it is profitable. I don't know........

Reply With Quote
  #4 (permalink)
 semiopen 
hillsborough nj
 
Experience: Advanced
Platform: Tradestation/Excel
Broker: TradeStation
Trading: emicro
Posts: 98 since Sep 2018
Thanks Given: 18
Thanks Received: 46

Cool, I haven't looked at intraday action carefully.

Sorry for the "naive" comment, just felt to urge to use it in a sentence. Tradestation and the other platforms I'm familiar with are running with 40 year old software, and they are not suitable for serious development. I doubt if making money has anything to do with their tools, not a whole lot better than a pencil and paper.

My guess is that 2 or 3 indicators (4 or 8 state) would "work" at least as well as 4 indicators. In general, AA or AAA will make money but waiting for one of the indicators to go below is not the ideal way to get out. Average Max (AMax), Average Min (AMin), and Average exit in range (AMaMi) are important. You want to exit before one of the indicators goes to B, of course if you don't, that's not the end of the world. If AMaMi is 50 it makes sense to look at getting out when AMaMi is above that level, say 90. There is a subtle bug I discovered in my Max/Min routine, I corrected that recently, but the tables I put up have questionable numbers for that.

I think High-dimensional statistics is important for this type of analysis.

"...the field of high-dimensional statistics studies data whose dimension is larger than dimensions considered in classical multivariate analysis. High-dimensional statistics relies on the theory of random vectors."

High-Dimensional Probability looks like a good book on the subject, but I'll probably look at some youtubes before buying it.

"High-dimensional probability offers insight into the behavior of random vectors, random matrices, random subspaces, and objects used to quantify uncertainty in high dimensions. Drawing on ideas from probability, analysis, and geometry, it lends itself to applications in mathematics, statistics, theoretical computer science, signal processing, optimization, and more."

I think trading can (and soon will be) be totally computerized. The technical stuff in a social network like this seems quite crude, but after all it isn't a university.

It is useful to monitor the shortest period, for example, when AAAA happens and turns into AAAB, does that tend to deteriorate further or does it tend to resolve back into AAAA.

I suspect using only a single set of averages is wrong. The reason is that these can randomly produce negatives when just slightly different averages can be positive and that action is not predictable. I'm working on consensus (or at least looking at multiple lengths simultaneously) for decision making. Probably will post more detail soon.

Reply With Quote
  #5 (permalink)
drummerman9421
Holmdel NJ/US
 
Posts: 6 since Oct 2019
Thanks Given: 1
Thanks Received: 0

I too myself use tradestation. Don't get me started lol. I wanted to optimize 4 inputs of one of my variables. The optimization took 2.5 days. My exits right now are if slope or if the fast becomes <= slow, it will get out. Definitely need more indicators. Let me know consensus you work on and if you dive deeper into high dimensional probability.

EMA
fast- 5
medium- 7
slow- 14
super slow- 21

Thank you

Reply With Quote
  #6 (permalink)
 semiopen 
hillsborough nj
 
Experience: Advanced
Platform: Tradestation/Excel
Broker: TradeStation
Trading: emicro
Posts: 98 since Sep 2018
Thanks Given: 18
Thanks Received: 46

There is another way to optimize strategies on Tradestation that is much faster, but not many people use it. That being said, the way you optimized those variables is quite questionable - of course if the current settings are making you piles of money, never mind.

I thought as recently as a few weeks ago that one could conceivably select various parameter values that are playing well for a given period and then use those until they deteriorate. I don't think that idea is sound anymore based on looking at the data. I think that can be proven mathematically, which is why I mentioned high dimensional probability, as a discipline that might yield a more conclusive opinion.

I use EMAs in my analysis but they have few clear benefits over SMAs. The biggest advantage seems to be that when price is above an EMA the slope of the EMA is positive and if below the slope is negative. That saves a calculation if one is analyzing slope direction.

A sample of my latest analysis is below.



The top part has a closing quote for IWM and it's buy and hold performance (on a $10K investment) for the date range indicated. HProf (Buy and hold profit) is $20.

I think I've finally got a handle on the Max/Min/MaMi issues. I think that is very important to keep track of.

The bottom right section shows the current market position based on 5 different lengths of M (SMA), R (Rate of Change), and L (Least Square MA). The bottom left section shows the performance of each of the current states for the period analyzed.

TProf is total profit investing $10K for each trade. RProf is the total profit if one reinvests profits earned in that state in subsequent trades.

Len and ALen are useful to keep in mind. You want short lengths if investing in below conditions and long lengths above. The fact that length is getting longer than ALen in the above conditions is not an impending reversal sign. However, MaMi much higher than AMaMi and the questionable recent historical numbers makes it reasonable to consider taking some profits here.

Analysis for QQQ and SPY is below.




Reply With Quote




Last Updated on October 27, 2019


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts