PineCoders

Averages - PineCoders FAQ

The need to calculate averages (arithmetic mean) comes up here and there in scripts. When you want the average of a value only when a given condition has occurred, you will often not be able to use the standard sma function in Pine because it will average all values in the series. Even if you take care to use your condition to set non-conforming values to zero, this ends up skewing your results with zero values.

This script calculates:
1. The running average of all up volumes,
2. The average of last x occurrences of up volume ,
3. The average up volume occurrences in last y bars.
Catatan Rilis:
  • Made code for cases 2 and 3 into functions.
  • Added examples of multiple-result functions.
Catatan Rilis: Conversion to v4.
Catatan Rilis: Fixes to comments.
Catatan Rilis: Simplified Case 1 code.
Catatan Rilis: Changes to comments.
Hilangkan dari Skrip-Skrip Favorit Tambahkan ke Skrip-Skrip Favorit
http://www.pinecoders.com — Tools and ideas for all Pine coders.
Beranda Penyaring Saham Penyaring Forex Penyaring Crypto Kalender Ekonomi Bagaimana Cara Kerjanya Fitur-Fitur Chart Harga Akun Tata Tertib Moderator Solusi Website & Broker Widget-Widget Solusi Charting Pusat Bantuan Permintaan Fitur Blog & Berita Yang Sering di Tanyakan Wiki Twitter
Profil Pengaturan Profil Akun dan Penagihan Coin TradingView Tiket Dukungan Saya Pusat Bantuan Ide Terpublikasikan Pengikut Telah Mengikuti Pesan Pribadi Obrolan Keluar