MCD June 23, 2014 09:37AM |
Registered: 10 years ago Posts: 75 |
Re: MCD June 24, 2014 08:44AM |
Registered: 10 years ago Posts: 75 |
declare lower; input price = hl2; input length = 5; input averageLength = 2; input over_bought = 80; input over_sold = -80; assert(length >= 2, "'length' must be greater than or equal to 2: " + length); def sumSqr = fold i = 0 to length with sum do sum + Sqr((length - i) - fold j = 0 to length with rank do rank + if GetValue(price, i, length - 1) > GetValue(price, length - j - 1) or GetValue(price, i) == GetValue(price, length - j - 1) and i <= length - j - 1 then 1 else 0); plot Spearman = 100 * (1 - 6 * sumSqr / (length * (Sqr(length) - 1))); plot SpearmanAverage = Average(Spearman, averageLength); plot OverBought = over_bought; plot ZeroLine = 0; plot OverSold = over_sold; Spearman.SetDefaultColor(GetColor(9)); SpearmanAverage.SetDefaultColor(GetColor(8)); OverBought.SetDefaultColor(GetColor(5)); ZeroLine.SetDefaultColor(GetColor(5)); OverSold.SetDefaultColor(GetColor(5));
Re: MCD June 30, 2014 09:41AM |
Registered: 10 years ago Posts: 75 |
Re: MCD July 02, 2014 08:37AM |
Registered: 10 years ago Posts: 75 |
Re: MCD July 08, 2014 09:25AM |
Registered: 10 years ago Posts: 75 |
Re: MCD September 16, 2014 02:47PM |
Registered: 9 years ago Posts: 34 |