# Re: Moving Average Crossover

Home 21090308 Forums Re: Moving Average Crossover

#1988
osigrtoelt
Member

1) It is not using the weighted average (instead of AR) that causes the complexity of the optimization problem. Fitting AR(p) is still an optimization problem (unconstrained) with (p + 2) parameters except that the objective function is much simpler. If we denote the original process by $${X_t}$$, then AR(p) minimizes $$sum(X_t – hat{X}_t)^2$$; whereas in our configuration, the objective function is strategy specific and is of a much more complex form $$f(X_t, hat{Y}_t, mathcal{F}_{t-})$$, where $$hat{Y}_t$$ is the (fitted) indicator at time t and $$mathcal{F}_{s}$$ represents the filtration at time s.
2) Fitting an AR model to the original price process wouldn’t help much in generating this kind of indicators, since $${Y_t}$$ is different from the original price process $${X_t}$$ and $${Y_t}$$ itself is not expected to be AR. (We could use ArmaModel.armaMean to generate the indicators though, since $$Y_t = sum{a_i X_{t-i}}$$.) In fact, if the original price process $${X_t}$$ were indeed a stationary AR process, we wouldn’t expect to make much money at all using this strategy. A mean-reverting strategy would probably be much better. Also, for an AR(p2) model, there are actually (p2 + 2) parameters to estimate (including the constant and the variance of error) not just 1.