vitvlkv

Root Mean Square

293 6 14
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)
Where is this loop thing documented in the reference manual?
Reply
Thanks for sharing!!!!!
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
How to use this ?
Reply
How could this be used for trading? Standard deviations from the mean?
Reply
Oops, I guess line 9 should be: res = sqrt(sum/(len+1))
+1 Reply
United States
United Kingdom
India
Deutschland
France
España
Italia
Polska
Türkiye
Россия
Brasil
Indonesia
Malaysia
Việt Nam
日本
한국
简体
繁體
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing My Support Tickets Priority Support Contact Support Ideas Published Followers Following Private Messages Chat Sign Out