Hi Mata Nui,
I downloaded the zip in post #5. It contains the ex4 files (which i appreciate very much). Would you be willing to share the mql4 source code files?
Thanks Mata Nui! I appreciate them very much. If you have any interest in continued development and possibly trading with these and other indicators in a statistical arbitrage system, I’d be open to discussing a few ideas with you. Your code looks excellent. I am a programmer as well and have quite a bit of experience with stat arb trading using cointegration. I did find one small error in the way the mean and StDev are being calculated. If you’d like to discuss it let me know. I could also just apply the fix (as I understand it) and send you the code. Thanks again.
I am not a mathematician so i had to do a lot of hunting around to get that far. What changes would you make to the mean and stdev? I haven’t looked at this code for a while but looking at it now i see a bit i am not sure is correct.
Have you traded stat arb before? The main problem i found with these indicators (and statarb in general) is that you are always using a mean of some sort. Obviously the point of it is that price deviates from that mean then reverts. The issue is though that if the move continues for a while then rather than the price difference reverting to the mean (profit), the mean changes to move closer to the current price difference (resulting in loss). I couldnt find a way around this. Obviously if you have any ideas on effective use of these indicators i would be interested.