OPEN-SOURCE SCRIPT

Return (Percent Change)

ที่อัปเดต:
This Script displays Regular or Log Returns as either a line or histogram and labels the current bar.
If something other than price is selected as the source, the result is percent change with a positive or negative slope.
If a moving average of price is used as the source, the result is analogous to a strength index
Other options include a look-back period adjustment (the default is 1),
smoothing results by converting to an EMA, and
Bollinger Bands with Length and Standard Deviation inputs.
เอกสารเผยแพร่
Name Shortened to "Return"
เอกสารเผยแพร่
precision increased to two decimal places
เอกสารเผยแพร่
// This Script displays Regular or Log Returns as either a line or histogram and labels the current bar.
// Additionally, an "ArcTan" method is available which allows the slope of a line that crosses zero to be displayed.
// If a moving average of price is used as the source, the result is analogous to a strength index
// Other options include smoothing by converting to an EMA of returns,
// Bollinger Bands with SMA for the Length, and Standard Deviation for the Width.
// When the BB Basis is positive the bands appear green, and when negative they are red.
// if you set the BB basis to one, the color of the BB histogram will indicate the slope only.
เอกสารเผยแพร่
Two Decimal Places for Absolute Change Label
เอกสารเผยแพร่
corrected log input type spelling
เอกสารเผยแพร่
...
เอกสารเผยแพร่
Option to display absolute values was added.

Bollinger Bands can be toggled on/off.
เอกสารเผยแพร่
Script has been updated to allow Return and Basis to be expressed as several different types of moving average. From the Pinescript Reference:

sma: The sma function returns the moving average, that is the sum of last y values of x, divided by y.
ema: The ema function returns the exponentially weighted moving average. In ema weighting factors decrease exponentially. It calculates by using a formula: EMA = alpha * x + (1 - alpha) * EMA[1], where alpha = 2 / (y + 1)
wma: The wma function returns weighted moving average of x for y bars back. In wma weighting factors decrease in arithmetical progression.
rma: Moving average used in RSI. It is the exponentially weighted moving average with alpha = 1 / length.
swma: Symmetrically weighted moving average with fixed length: 4. Weights: [1/6, 2/6, 2/6, 1/6].
vwma: The vwma function returns volume-weighted moving average of x for y bars back. It is the same as: sma(x * volume, y) / sma(volume, y)

Bands may be displayed as:
std dev: Standard Deviation (typical multiple value=2)
atr: Average True Range (typical multiple value = 1) RMA of true range. True range is max(high - low, abs(high - close[1]), abs(low - close[1]))

Here's an example show Bi-Weekly Log Returns of the entire history of bitcoin:
สแนปชอต

Here's an example of Daily Reg Returns in Absolute Price and the indicator being used to show the 30SMA Slope:
สแนปชอต
เอกสารเผยแพร่
Comments and Example updated

Corrected example of Daily Reg Returns in Absolute Price and the indicator being used to show the 30SMA Slope:
สแนปชอต
เอกสารเผยแพร่
Added functionality to magnify basis line (display only)
เอกสารเผยแพร่
corrected idea image
เอกสารเผยแพร่
formatting
เอกสารเผยแพร่
corrected versioning
เอกสารเผยแพร่
formatting
เอกสารเผยแพร่
Script has been updated to include wicks, so you can now see candles normalized to zero.

Two EMA's of the basis also have been added as an option, as well as the ability to magnify the plots (display only).
changeMomentum Indicator (MOM)percentRelative Strength Index (RSI)returnreturnsslopeVolatility

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

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

ต้องการที่จะใช้สคริปต์นี้บนชาร์ตใช่ไหม?

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