No ... by 'spread' I mean the difference between the two currency pair prices, but adjusted for a pip value. Here is the calculation I used i R to do it:
I think for the first iteration of this ... the following below should be sufficient. We may have to modify it a bit later (adjust for pip value), but lets keep it simple.
Chart will run on the base pair, Pair 2 is the 2nd pair used for the spread calculation.
User input:
Coefficient CF
Pair2
Positive1Stdev
Negative1Stdev
MeanLine (to close positions)
Spread = Basepair - CF*Pair2
Closing prices will be used for Base pair & Pair 2, and spread will be printed in on the chart just for reference.
Now the EA calculates the spread, and if spread is < Neg1Stdev (user input), then EA buy's BasePair, and shorts CF units of Pair 2.
I would do all of the analysis occasionally (bi-weekly or so) to provide an excel sheet with:
Coefficient CF
Pair2
Positive1Stdev
Negative1Stdev
MeanLine
The user sets the EA on a base pair with the inputs selected from the spreadsheet, and waits for the trade to be opened. The trade closes when the MeanLine is hit.
Regards,
EZ
I think for the first iteration of this ... the following below should be sufficient. We may have to modify it a bit later (adjust for pip value), but lets keep it simple.
Chart will run on the base pair, Pair 2 is the 2nd pair used for the spread calculation.
User input:
Coefficient CF
Pair2
Positive1Stdev
Negative1Stdev
MeanLine (to close positions)
Spread = Basepair - CF*Pair2
Closing prices will be used for Base pair & Pair 2, and spread will be printed in on the chart just for reference.
Now the EA calculates the spread, and if spread is < Neg1Stdev (user input), then EA buy's BasePair, and shorts CF units of Pair 2.
I would do all of the analysis occasionally (bi-weekly or so) to provide an excel sheet with:
Coefficient CF
Pair2
Positive1Stdev
Negative1Stdev
MeanLine
The user sets the EA on a base pair with the inputs selected from the spreadsheet, and waits for the trade to be opened. The trade closes when the MeanLine is hit.
Regards,
EZ