Jason Posted April 30, 2023 Report Share Posted April 30, 2023 Have wanted to know, how periods back does MT use when calculating the 20 EMA? Quote Link to comment Share on other sites More sharing options...
wilburpost2 Posted May 1, 2023 Report Share Posted May 1, 2023 Am I simplistic in thinking that the 20 period/bar EMA refers to the last 20 bars with the most recent bars having a higher weighting? Quote Link to comment Share on other sites More sharing options...
Mike Medved Posted May 1, 2023 Report Share Posted May 1, 2023 Are you asking about charts? It goes back to the beginning of the chart. Are you asking about paintbars? For intraday, usually to the beginning of the day, unless some indicator in the paintbar requires more or you specify more by calling the SetDaysNeeded function. Quote Link to comment Share on other sites More sharing options...
Jason Posted May 1, 2023 Author Report Share Posted May 1, 2023 Awesome Mike, that's what I was wondering about. Have heard of other software using a large fixed value of days back. I'm experimenting with a few things and wanted to be able to replicate the results produced by MT. Quote Link to comment Share on other sites More sharing options...
Mike Medved Posted May 3, 2023 Report Share Posted May 3, 2023 If you wanted to go back a long way on a scan, you can use the SetDaysNeeded function. We try not to overdo that so that the initial backfills on scans don't take a really long time. Quote Link to comment Share on other sites More sharing options...
wilburpost2 Posted May 3, 2023 Report Share Posted May 3, 2023 Have you found a significant different in the 20 bar EMA current bar value when looking back just 20 bars or as Mike said, going back many days? In my code I have found the difference to be small so I try to limit the data points to achieve a faster paintbar, especially for symbols such as SPY. Quote Link to comment Share on other sites More sharing options...
Mike Medved Posted May 5, 2023 Report Share Posted May 5, 2023 The formula for EMA is simple: 1. Mult = 2/(1+period) 2. EMA = PrevEMA+Mult*(Value-PrevEMA) So - take a set of data. Let's say 1000 points. And do EMA using the last 20, then last 40, then last 60 etc. And compare the values You can even do that in excel... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.