Im looking to algorithmically execute future trades (e.g. ES) from analysis of spot index (e.g. ^SP500) using limit orders. This requires a reasonable approximation of where the future price should be relative to the spot index value.
The question is, how would you do it?
Currently, Im am looking to algorithmically:
Calculate the basis (spread between future price and spot index value) for each bar/period (e.g. 30mins) during cash hours.
Construct line of best fit for recent history of basis to approximate current basis level I am yet to define recent though it should be long enough to capture the contango / backwardation effect (attached).
Form a distribution of spread values minus the best fit estimates to understand the variability of actual futures prices around best fit estimates.
Use the index value adjusted by the derived basis estimate as the future limit price.
While high level, I believe this approach would provide a price with which to execute a limit order and the probability of being filled.
Would you do it the same? Differently? What holes can you see?