Spread by

//Every spread & central tendency measure in 1 script with comfortable visualization, including scrips's status line.

Spread measures:
- Standard deviation (for most cases);
- Average deviation (if there are extreme values);
- GstDev - Geometric Standard Deviation (exclusively for Geometric Mean);
- HstDev - Harmonic Deviation (exclusively for Harmonic Mean).

These modified functions will calculate everything right, they will take source, length, AND basis of your choice, unlike the ones from TW.

Central tendency measures:
- Mean (if everything's cool & equal);
- Median (values clustering towards low/high part of the rolling window);
- Trimean (3/more distinguishable clusters of data);
- Midhinhe (2 distinguishable clusters of data);
- Geometric Mean ( |low.. ... ... .. .... ... . . . . . . . . . . . .high| this kinda data); <- Exp law
- Harmonic Mean { |low. . . . . . . . . . . . . . .. . . .high| kinda data). <- Reciprocal law

1) Don't hesitate using Standard Deviation with non-mean, like "Midhinge Standard Devition", despite what ol' stats gurus gonna say, it works when it's appropriate;
2) Don't check log space while using Geometric Mean & Geometric Standard Deviation, these 2 implement log stuff by design, I mean unless u wanna make it double xd
3) You can use this script, modify it how you want, ask me questions whatever, just make money using it;
4) Use Midrange & Midpoints in tandem when data follows ~addition law (like this . . . . . . . . . . . . . . . . . . . . .). <- just addition law

Look at the data, choose spread measure first, then choose central tendency measure, not vice versa.

Ain't gonna place ® sign on standard deviations like one B guy did in 1980s lmao, but if your wanna use Harmonic Deviations in science/write about/cite it/whatever, pls give me a lil credit at least, I've never seen it anywhere and unfortunately had to develop it by myself. it's useful when your data develops by reciprocals law (opposite to exponential).

Peace TW
Phát hành các Ghi chú: Thanks to midtownsk8rguy now the code has a switch to turn on/off Variance descriptor & Range/Deviation ratio. For some users who don't check "Scale price chart only" for some reason, the old version was distorting the overlay. The old version will be available here
Phát hành các Ghi chú: Now variance is calculated based on quadratic (Stdev) function only, no matter which Spread measure is chosen.
Phát hành các Ghi chú: Relative Standard Deviation (RSD) was added, along with Variance and Range/Spread ratio it might be used in order to decide whether 1sr or 2nd deviations should utilized as limits.
Phát hành các Ghi chú: Overlay issue was finally defeated by using "plotchar" for the last 3 descriptors, instead of just "plot"
Pine Script manual is the king
Gỡ bỏ khỏi Script Ưa thích Thêm vào Script Ưa thích

Bình luận

Sorry for the comments i don't know why you divide Range/4 instead range/2 in order to find the midpoint...maybe i missing something...anyway thanks
+1 Phản hồi
gorx1 pluckyFinance43034
@pluckyFinance43034, It's just a lil misunderstanding of terminology, range/2 is "mid-range", line 71, it's a central tendency measure, while range/4 is "mid-point", line 75, is a spread measure I introduced to accompany mid-range. Take a dataset 1,2,3,4,5,6,...99. Mid-range will be 50 (1+99/2), that will be center of the data. Mid-point will be 25 (1+99/4). now we add this to midrange and get 75, subtract it from midrange and get 25. So we got lower bound of 25 and upper bound of 75, which are used as a spread measure.
Phản hồi
Just wow. Excellent work, thank you!
+1 Phản hồi
I'm a fan of mean and stdv and It's rare to see out of the box tradable script, thank you ^^
+1 Phản hồi
@Owl, This is the Way
+2 Phản hồi
Very nicely done and particularly enjoyed your description. Keep up the great work!
+1 Phản hồi
gorx1 allanster
@allanster, Thanks so much, ofc, I got some ideas, and I think it'll gon be 2-dimensional stats descriptors
+1 Phản hồi
This publication will be featured in our "Best Scripts of The Month" selection. Thank you for your valuable contribution to the TradingView community, and congrats!
+1 Phản hồi
gorx1 PineCoders
@PineCoders, omg I've just seen it, that's so cool, thanks a lot \(^Y^)/
+1 Phản hồi
been waiting for this my whole life. Thank you.

fyi. can't tell the last time I saw a straight guy in midtown. who knew.
Phản hồi
Trang chủ Bộ lọc cổ phiếu Bộ lọc Forex Bộ lọc Tiền điện tử Lịch kinh tế Cách thức hoạt động Tính năng Biểu đồ Trả phí Giới thiệu bạn Quy tắc Áp dụng Trung tâm Trợ giúp Giải pháp cho Website & Nhà môi giới Widget Giải pháp biểu đồ Thư viện Biểu đồ Lightweight Blog & Tin tức Twitter
Hồ sơ Tùy chỉnh Hồ sơ Tài khoản và Thanh toán Giới thiệu bạn Xu Ticket Hỗ trợ của tôi Trung tâm Trợ giúp Các ý tưởng đã đăng Người theo dõi Đang theo dõi Tin nhắn riêng Trò chuyện Đăng xuất