Here's the last version...quick hack job.
I'm sure it can be improved, but this is a rough sketch, code wise.
The strategy works in range bound enviroments, so cointegrated pairs like AUDCAD will shine with it.
Cheers,
Ivan Labrie
Time at Mode FX
Still working on fixing the code 100%.
Will update with a new version soon.
This one's fine tuned for gold (tp and sl size, and contract size for a 100k account)
Cheers,
Ivan Labrie
Time at Mode FX