How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Feature Request FAQ Help & Wiki Twitter

# Root Mean Square

263 6
Example of loop usage: calculation of Root Mean Square             (https://en.wikipedia.org/wiki/Root_mean_square).
```//@version=2
study("Root Mean Square", shorttitle="RMS")
// https://en.wikipedia.org/wiki/Root_mean_square
src = input(close)
sum = 0
len = input(10)
for i = 0 to len
sum := sum + src[i]*src[i]
res = sqrt(sum/len)
plot(res)
```
Oops, I guess line 9 should be: res = sqrt(sum/(len+1))
How could this be used for trading? Standard deviations from the mean?
How to use this ?
Thanks! Vitvlkv:

In the July issue of Technical Analysis of Stocks and Commodities, John Ehlers published an article titled: "The Super Pass Band Filter." The bands utilized to trigger entry and exits are produced using Root Mean Square of the Pass Band result. Here is a link: http://traders.com/Documentation/FEEDbk_docs/2016/07/TradersTips.html
Thanks for sharing!!!!!
Where is this loop thing documented in the reference manual?
United States
United Kingdom
India
España
France
Italia
Polska
Brasil
Россия
Türkiye
Indonesia

한국
Home Stock Screener Forex Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter