vitvlkv

Root Mean Square

209 6 8
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)
vitvlkv MOD
6 months ago
Oops, I guess line 9 should be: res = sqrt(sum/(len+1))
+1 Reply
TheYangGuizi
6 months ago
How could this be used for trading? Standard deviations from the mean?
Reply
MarxBabu
6 months ago
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
Ideas Scripts Chart
United States
United Kingdom
India
España
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener 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 Billing Sign Out