#IND means that the result is indeterminate. Most likely based on this operation it is due to dividing by 0.
Looking at the formula for correlation, this could be because the standard deviation of asset 1 or asset 2 is 0 or that the series themselves are empty.
I'm going to take a guess. Can you confirm that the length of the two series is the same? Perhaps there is an issue with how correlation calculations are figured when one series is of a different length than an other series?
I read the manual but I can not quite understand the value inserted within the correlation ... should indicate the bars so if barperiod = 1 and set 240 I should get the correlation relative to 4 hour I say well?
I read the manual but I can not quite understand the value inserted within the correlation ... should indicate the bars so if barperiod = 1 and set 240 I should get the correlation relative to 4 hour I say well?
The way you wrote your code, you are checking for the correlation between the two assets, for the one-minute bars, for the past 240 samples, which would be the last four hours. That is, you gain a sample and lose a sample once a minute.