stockparfait / experiments

Statistical experiments with financial data
Apache License 2.0
0 stars 0 forks source link

Refine modeling by variable MAD #122

Open sergey-a-berezin opened 1 year ago

sergey-a-berezin commented 1 year ago

Testing the stability of MAD for daily log-profits reveals that it is not as stable as expected. My previous experiments on auto-independence indicated that variance is indeed dependent on recent history - large moves temporarily increase variance for a few days.

Idea:

sergey-a-berezin commented 1 year ago

Note, that this stateful MAD is observed at many frequencies: minutely MAD seems to be affected as far as 10-20 minutes after a large move, daily MAD - up to 10 days later (IIRC). While modeling such long-term dependency at the high frequency level may be too complex, a reasonable approximation could be made by modeling log(open) - log(previous close) and then minutely log-profits from open to close separately.

sergey-a-berezin commented 1 year ago

An idea to quantify the temporal dependency of MAD on the previous move: study the auto-correlation of the absolute values of log-profits rather than log-profits themselves (which we now know don't auto-correlate). If there is an obvious correlation, then we can represent the next log-profit as a recurrence:

X(t+1) = (1 + c*EMA[d](|X(t)|) * R(t+1)

where R is some random variable and EMA[d](Y) is the exponential moving average of "length" d:

K = 2/(d+1)
EMA[d](Y[0]) = Y[0]
EMA[d](Y[t+1]) = Y[t]*K + EMA[d](Y[t]) * (1 - K)

and c is some constant. Both c and d are tuned to produce the auto-correlation pattern observed in practice.