let's figure this out.
Code: Select all
this part:
//n = cum(1)-1
int n = bars -2;
cum(1) computes the number of bars since bar 1, but as I said in a previous message, this means the period used will be dependent on the number of bars in the chart, which is not quite good. so i'll replace this with a setting parameter. I think you agree ?
this part:
//a = cum(abs(src - nz(b[1],src)))/n*(1+er)
is it ..... / (n*(1+er)) or (.... / n)*(1+er) ? i'm not sure about Pine Script priorities
the rest should be good i think
it looks good
but here, before that screenshot it doesn't
thanks guys