vitvlkv

Root Mean Square

263 6 12
Example of loop usage: calculation of Root Mean Square             (https://en.wikipedia.org/wiki/Root_mean_square).
Remove from Favorite Scripts Add to Favorite Scripts
//@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))
+1 Reply
How could this be used for trading? Standard deviations from the mean?
Reply
How to use this ?
Reply
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
+2 Reply
Thanks for sharing!!!!!
Reply
Where is this loop thing documented in the reference manual?
Reply
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
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Account and Billing Sign Out