dime

Moving Median

This simple script was a collaborative effort with 4X4good.

It plots a moving median for the period using the 50th percentile value.

We wanted to know the median value of VIX but surprisingly, a median indicator wasn't yet available in the indicators library.

So we did a little research & put this together.

สคริปต์โอเพนซอร์ซ

ด้วยจิตวิญญาณของ TradingView อย่างแท้จริง ผู้เขียนสคริปต์นี้ได้เผยแพร่เป็นโอเพนซอร์ส เพื่อให้ผู้ค้าสามารถเข้าใจและตรวจสอบได้ ไชโยให้กับผู้เขียน! คุณสามารถใช้ได้ฟรี แต่การใช้รหัสนี้ซ้ำในสิ่งพิมพ์อยู่ภายใต้กฎระเบียบการใช้งาน คุณสามารถตั้งเป็นรายการโปรดเพื่อใช้บนชาร์ตได้

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ เงื่อนไขการใช้บริการ

ต้องการที่จะใช้สคริปต์นี้บนชาร์ตใช่ไหม?
//@version=2
//  Moving Median
//  developed by dime & 4X4good - 09/04/2016
//  Plots a moving median value for the period  
//  by using the 50th percentile value
//  

study(title="median", shorttitle="median", overlay=true, precision=0)
length1 = input(20, minval=1, title="Period")

median = percentile_nearest_rank (close,length1,50)  //this returns the 50th percentile value

//alternative function
//level = percentile_linear_interpolation (close,length1,50)

plot (median,color=lime, transp=0, linewidth=2 )