Well, it's tough to find one. So, I wrote one. Here it is.
Make sure you put your OtherSymbol in " ". ex. "GBPUSD".
LRPeriod is the number of periods you want the correlation calculation to be on.
Formula from the book here:
Amazon on Page 313.
Oops. Forgot to add; the results are in %. Easier to read.
5/25/2010
Put break in switch statements in LR Correlation.
Aded another indicator, LR Least Squares.mq4. This follows the Least Squares method of finding a linear slope for a set of data. Page 319 of the same book.
Note: Least Squares will give you the same numbers as in a text book, but I've also divided the result by Point. Reason is, if you code an EA against it, it's easier to deal w/ numbers to the 'left' of the decimal as opposed to all of them being to the 'right' of the decimal.
Make sure you put your OtherSymbol in " ". ex. "GBPUSD".
LRPeriod is the number of periods you want the correlation calculation to be on.
Formula from the book here:
Amazon on Page 313.
Oops. Forgot to add; the results are in %. Easier to read.
5/25/2010
Put break in switch statements in LR Correlation.
Aded another indicator, LR Least Squares.mq4. This follows the Least Squares method of finding a linear slope for a set of data. Page 319 of the same book.
Note: Least Squares will give you the same numbers as in a text book, but I've also divided the result by Point. Reason is, if you code an EA against it, it's easier to deal w/ numbers to the 'left' of the decimal as opposed to all of them being to the 'right' of the decimal.
Attached File(s)