I have an 'indicator' which allows two fx pairs to be overlayed. I then measure the separation between the two on the current bar before making a decision to enter a statistical arbitrage. However, this distance between the fx changes according to the size of the window and number of bars in the window. This is fine as I've got to know what is in and out of line before I trade a stat arb. However, I'd like to try to create on EA to backtest but I'm not sure if it's possible to code this situation. Hopefully you can understand what I mean and if so can this be coded ?
If it can I will then go ahead and add the rest of fairly simple instructions for the coder to create the EA. Thanks