PINE LIBRARY
Cập nhật cloudTheory

Library "cloudTheory"
// OBJECTTIVE: A Combination of EMA to Draw Cloud Pattern on Chart
//
// The "2-EMA Line System" is one of the most oldest and durable
// frameworks in technical analysis where we plot one "fast" (short)
// and one "slow" (long) exponential moving average line on the same
// chart and their relationships determine the state of the security.
drawCloud(fastLength, slowLength, src)
Parameters:
fastLength (simple int): - Fast EMA Length, the shorter length which
typically determines the current rhythm of the security.
slowLength (simple int): - Slow EMA Length, the longer length which
determines the underlying drift of the security.
src (float): - Which value of the candle should be used to calculate
the moving average; defaults to candle close value.
Returns: [emaFast, emaSlow, isBullish, isBearish, isNeutral] - EMA
Values and the flags to determine the current sentiment.
// OBJECTTIVE: A Combination of EMA to Draw Cloud Pattern on Chart
//
// The "2-EMA Line System" is one of the most oldest and durable
// frameworks in technical analysis where we plot one "fast" (short)
// and one "slow" (long) exponential moving average line on the same
// chart and their relationships determine the state of the security.
drawCloud(fastLength, slowLength, src)
Parameters:
fastLength (simple int): - Fast EMA Length, the shorter length which
typically determines the current rhythm of the security.
slowLength (simple int): - Slow EMA Length, the longer length which
determines the underlying drift of the security.
src (float): - Which value of the candle should be used to calculate
the moving average; defaults to candle close value.
Returns: [emaFast, emaSlow, isBullish, isBearish, isNeutral] - EMA
Values and the flags to determine the current sentiment.
Phát hành các Ghi chú
Updated:drawCloud(fastLength, slowLength, src)
Parameters:
fastLength (simple int): - Fast EMA Length, the shorter length which
typically determines the current rhythm of the security.
slowLength (simple int): - Slow EMA Length, the longer length which
determines the underlying drift of the security.
src (float): - Which value of the candle should be used to calculate
the moving average; defaults to candle close value.
Returns: [emaFast, emaSlow, mktSentiment] - EMA Values and a flag
to determine the market sentiment. The sentiment flag can be read
as: (I) '1' the security is bullish, (II) '-1' the security is
bearish and (III) '0' denotes the security is neutral.
Phát hành các Ghi chú
v3Added:
priceAction(fastLength, slowLength, src, atrLength)
Parameters:
fastLength (simple int)
slowLength (simple int)
src (float)
atrLength (simple int)
Updated:
drawCloud(fastLength, slowLength, src)
Parameters:
fastLength (simple int): - Fast EMA Length, the shorter length which
typically determines the current rhythm of the security.
slowLength (simple int): - Slow EMA Length, the longer length which
determines the underlying drift of the security.
src (float): - Which value of the candle should be used to calculate
the moving average; defaults to candle close value.
Returns: [emaFast, emaSlow, mktSentiment, *Cross] - EMA Values and
a flag to determine the market sentiment. The sentiment flag can be
read as: (I) '1' the security is bullish, (II) '-1' the security is
bearish and (III) '0' denotes the security is neutral. The last two
values returned are the "EMA Cross" points. These values can be
directly used to determine the trend and set and altert.
------------------------------------------------------------------
Phát hành các Ghi chú
v4Updated calculation of Price Action Values (experimental), now in bounded range of [-1, 1] which denotes the bearish to bullish market sentiment for the clouds. Recommend values are [-1, -0.25) can be considered as bearish, (-0.25, 0.25) as neutral market action while (0.25, 1] can be considered as bullish price action.
Phát hành các Ghi chú
cloudTheory is a visualization extension of "2-EMA Line System", which can be used to provide visual confirmation based on the price action of the underlying. In addition, the library provides methods for calculating momentum using (I) the traditional method, and (II) Baz et al. CTA method.✨ Getting Started
The public (open-source) library is available at TradingView, and a rich documentation and usage guide is available at blog website. Import the library as below:
Then you can directly create editable fields and value control fields to implement the logic. To design the color schemes, it is recommended to use a three-toned system, and cross-over markings can be implemented as follows:
🔮 Drawing EMA Cloud
Use the function drawCloud() that returns the value of slow and fast moving averages along with the market sentiment and up/down crossing points.
📊 Price Action Value
The movement indicator and a tentative indication of the movement and entry point can be calculated using priceAction() function (check the function documentation for details).
Thư viện Pine
Theo đúng tinh thần TradingView, tác giả đã công bố mã Pine này như một thư viện mã nguồn mở để các lập trình viên Pine khác trong cộng đồng có thể tái sử dụng. Chúc mừng tác giả! Bạn có thể sử dụng thư viện này cho mục đích cá nhân hoặc trong các ấn phẩm mã nguồn mở khác, nhưng việc tái sử dụng mã này trong các ấn phẩm phải tuân theo Nội Quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Thư viện Pine
Theo đúng tinh thần TradingView, tác giả đã công bố mã Pine này như một thư viện mã nguồn mở để các lập trình viên Pine khác trong cộng đồng có thể tái sử dụng. Chúc mừng tác giả! Bạn có thể sử dụng thư viện này cho mục đích cá nhân hoặc trong các ấn phẩm mã nguồn mở khác, nhưng việc tái sử dụng mã này trong các ấn phẩm phải tuân theo Nội Quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.