Attached is a Kalman filter for trend analysis. Kalman filters behave similarly to moving averagers, except that they give information about the current state rather than the state as it was half your averaging period ago, and are more sensitive to transitions in the state, so they "lock on" to the trend faster, but without lots of overshoot or or Gibbs (i.e. ringing). They are also "smart" in the sense that they keep track of their errors, and correct the next step forward to account for that. (Very loosely speaking). It's set up as a custom indicator. Notes on its use are in the top of the file; feedback welcome. It should be fast (at least an order of magnitude faster than the least squares estimator). GL/GT.
Attached File(s)
GRFKalman.mq4
14 KB
|
3,110 downloads