Root Mean Square

374 6 23
Example of loop usage: calculation of Root Mean Square (
Remove from Favorite Scripts Add to Favorite Scripts
study("Root Mean Square", shorttitle="RMS")
src = input(close)
sum = 0
len = input(10)
for i = 0 to len
    sum := sum + src[i]*src[i]
res = sqrt(sum/len)
Where is this loop thing documented in the reference manual?
Thanks for sharing!!!!!
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:
+2 Reply
How to use this ?
How could this be used for trading? Standard deviations from the mean?
Oops, I guess line 9 should be: res = sqrt(sum/(len+1))
+1 Reply
EN English
EN English (UK)
EN English (IN)
DE Deutsch
FR Français
ES Español
IT Italiano
PL Polski
SV Svenska
TR Türkçe
RU Русский
PT Português
ID Bahasa Indonesia
MS Bahasa Melayu
TH ภาษาไทย
VI Tiếng Việt
JA 日本語
KO 한국어
ZH 简体中文
ZH 繁體中文
AR العربية
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 Contact Support Ideas Published Followers Following Private Messages Chat Sign Out