I don’t really understand the question or your suggestion. Moving average is calculated N days backwards. But it’s done for every day in the set of days in the chart. So it forms a moving line. Maybe you can clarify what you mean.

summing N/2 days from the "past" and N/2 days of the "future" for each data point.

When I was studying statistics in the university we did such calculations for random “time series”. Unfortunately I don’t remember the context of that data, though. I guess, we got that from some “probablistic” random number generators we had implemented in the same course before.

Just wondering if it makes sense to calculate moving average in this way for financial timeline data.

Just wondering if it makes sense to calculate moving average in this way for financial timeline data.

Not that I know of. The problem is that you can’t look into the future. So that would only be a historical indicator. Because if I use your formula, I can’t get the moving average for today since I don’t have the data for N/2 days ahead.

Greetings Filip, I have heard something about a 20 day moving average line crossing a 200 day moving average line and vise versa. Is this a change in trend? What does it mean? Thank you for the excellent information so far.

Yes, usually it’s MA50 crossing MA200 that’s called the Golden Cross or the Death Cross. Depending on where it’s crossed from. It generally indicates that the longer term is starting to switch. You can read more about it here: https://www.investopedia.com/terms/d/deathcross.asp

Hi Filip,
Thank you for the great content.
Your example shows the MA20, what is the best MA or EMA period to look at when trying to figure out the switch between the bull run trend and the beginning of the bear market?
The 2017 crash after the peak occurred in just a few days, let’s say a week.
Does it means we should mainly look at let’s say the MA/EMA,7 to anticipate such a market switch on a daily scale?
Cheers

There is no easy way of determining which MA/EMA is “the best”. As I think I said in the video, the longer MA’s are obviously more correct in that they have less false signals, but they are very delayed indicators. Shorter MA’s are more prone to false signals but will switch faster.

It all depends on how you are going to implement and use it. You need to backtest those ideas and see what works for different instruments and markets.

Unfortunately there is no easy answer. The best I can tell you is that it’s all relative. A trend that has lasted for 10 years is a very strong trend, and the consequences of breaking that trend will be bigger.

A trend that has made 1 or 2 higher highs/lows could be the start of a trend but you can never get a “confirmation” since no one know if the trend will break in the next hour. So you need to treat the trends according to how strong they are, relatively speaking. So if a trend has made 20 higher highs on the daily timeframe, you should pay more attention to that trend and its trendlines compared to a trend that just made 5 higher highs. You get my point?

Yes, makes sense now - to see the trend in the larger context rather than on an isolated time frame. Also, I was palying around with the indicators and oscillators and it seems like a good idea to test the trend’s strogness using MA, for instance?