PINE LIBRARY
MirPapa_Lib_trend

Library: MirPapa_Lib_trend
getMaColor(level)
Parameters:
level (int): 1 = lowest, 2 = low, 3 = mid, 4 = high, 5 = highest, 6 = base
getMA(mode, src, len)
Parameters:
mode (string): MA type
src (float): source
len (simple int): period
Returns: selected MA
getMA(maName, src, intLow, intMid, intHigh)
Parameters:
maName (string): MA type
src (float): source
intLow (simple int): short-term
intMid (simple int): mid-term
intHigh (simple int): long-term
Returns: [Low, Mid, High] array
getMA(maName, src, intLowest, intLow, intMid, intHigh, intHighest, intBase)
Parameters:
maName (string): MA type
src (float): source
intLowest (simple int): ultra-short
intLow (simple int): short
intMid (simple int): mid
intHigh (simple int): long
intHighest (simple int): ultra-long
intBase (simple int): base line
Returns: [Lowest, Low, Mid, High, Highest, Base] array
getStochastic(src, intLen)
Parameters:
src (float): source
intLen (int): period
Returns: selected stochastic
getStochastic(src, intLow, intMid, intHigh)
Parameters:
src (float): source
intLow (int): short-term
intMid (int): mid-term
intHigh (int): long-term
Returns: [stoLow, stoMid, stoHigh]
getStochastic(src, intLowest, intLow, intMid, intHigh, intHighest, intBase)
Parameters:
src (float): source
intLowest (int): ultra-short
intLow (int): short
intMid (int): mid
intHigh (int): long
intHighest (int): ultra-long
intBase (int): base
Returns: [stoLowest, stoLow, stoMid, stoHigh, stoHighest, stoBase]
getRSX(src, intLen)
Parameters:
src (float): source
intLen (int): period
Returns: selected RSX
getRSX(src, intLow, intMid, intHigh)
Parameters:
src (float): source
intLow (int): short-term
intMid (int): mid-term
intHigh (int): long-term
Returns: [Low, Mid, High]
getRSX(src, intLowest, intLow, intMid, intHigh, intHighest, intBase)
Parameters:
src (float): source
intLowest (int): ultra-short
intLow (int): short
intMid (int): mid
intHigh (int): long
intHighest (int): ultra-long
intBase (int): base
Returns: [Lowest, Low, Mid, High, Highest, Base]
getMACD(src, fastLen, slowLen, signalLen)
Parameters:
src (float): source
fastLen (simple int): fast EMA period
slowLen (simple int): slow EMA period
signalLen (simple int): signal line period
Returns: [macdLine, signalLine, histLine]
getBollingerBand(src, len, mult)
Parameters:
src (float): source
len (int): period
mult (float): standard deviation multiplier
Returns: [basis, upper, lower]
getATR(intLen)
Parameters:
intLen (simple int): ATR period
Returns: selected ATR
getATR(intLow, intMid, intHigh)
Parameters:
intLow (simple int): short-term
intMid (simple int): mid-term
intHigh (simple int): long-term
Returns: [ATR Low, Mid, High] array
getATR(intLowest, intLow, intMid, intHigh, intHighest, intBase)
Parameters:
intLowest (simple int): ultra-short
intLow (simple int): short
intMid (simple int): mid
intHigh (simple int): long
intHighest (simple int): ultra-long
intBase (simple int): base
isCross(fastLine, baseLine)
Parameters:
fastLine (float): fast line
baseLine (float): base line
Returns: state (true/false)
isMAtrend(maLow, maMid, maHigh)
Parameters:
maLow (float): fast MA
maMid (float): mid MA
maHigh (float): slow MA
Returns: trend state
isMAline(val, valPrev, intBaseLine)
Parameters:
val (float): current value
valPrev (float): previous value
intBaseLine (int): base value
Returns: state
getStage(v1, v2, v3)
Parameters:
v1 (float): first value
v2 (float): second value
v3 (float): third value
Returns: stage number (1–6)
getBgColor(stage)
Parameters:
stage (int): stage number
Returns: color
getBgColor(stage, transp)
Parameters:
stage (int): stage number
transp (int): transparency
Returns: color
getBGColor(v1, v2, v3)
Parameters:
v1 (float): first value
v2 (float): second value
v3 (float): third value
Returns: color
getBGColor(v1, v2, v3, transp)
Parameters:
v1 (float): first value
v2 (float): second value
v3 (float): third value
transp (int): transparency
Returns: color
createStackedLabel(labelText, isUp, maLowest, maLow, maMid, maHigh, maHighest, maBase)
Parameters:
labelText (string): label text
isUp (bool): true = up, false = down
maLowest (float)
maLow (float)
maMid (float)
maHigh (float)
maHighest (float)
maBase (float)
Returns: created label
isDoubleBottom(src, left, right)
Parameters:
src (float): reference series (e.g., mid MA or low)
left (int): left bar count for pivot search
right (int): right bar count for pivot search
Returns: true if double bottom detected (previous pivot low < current pivot low)
isDoubleTop(src, left, right)
Parameters:
src (float): reference series (e.g., mid MA or high)
left (int): left bar count for pivot search
right (int): right bar count for pivot search
Returns: true if double top detected (previous pivot high > current pivot high)
isFractalHigh(src, left, right)
Parameters:
src (float): high series (e.g., high or mid MA)
left (int): left confirmation bars
right (int): right confirmation bars
Returns: true if fractal high detected
isFractalLow(src, left, right)
Parameters:
src (float): low series (e.g., low or mid MA)
left (int): left confirmation bars
right (int): right confirmation bars
Returns: true if fractal low detected
getMaColor(level)
Parameters:
level (int): 1 = lowest, 2 = low, 3 = mid, 4 = high, 5 = highest, 6 = base
getMA(mode, src, len)
Parameters:
mode (string): MA type
src (float): source
len (simple int): period
Returns: selected MA
getMA(maName, src, intLow, intMid, intHigh)
Parameters:
maName (string): MA type
src (float): source
intLow (simple int): short-term
intMid (simple int): mid-term
intHigh (simple int): long-term
Returns: [Low, Mid, High] array
getMA(maName, src, intLowest, intLow, intMid, intHigh, intHighest, intBase)
Parameters:
maName (string): MA type
src (float): source
intLowest (simple int): ultra-short
intLow (simple int): short
intMid (simple int): mid
intHigh (simple int): long
intHighest (simple int): ultra-long
intBase (simple int): base line
Returns: [Lowest, Low, Mid, High, Highest, Base] array
getStochastic(src, intLen)
Parameters:
src (float): source
intLen (int): period
Returns: selected stochastic
getStochastic(src, intLow, intMid, intHigh)
Parameters:
src (float): source
intLow (int): short-term
intMid (int): mid-term
intHigh (int): long-term
Returns: [stoLow, stoMid, stoHigh]
getStochastic(src, intLowest, intLow, intMid, intHigh, intHighest, intBase)
Parameters:
src (float): source
intLowest (int): ultra-short
intLow (int): short
intMid (int): mid
intHigh (int): long
intHighest (int): ultra-long
intBase (int): base
Returns: [stoLowest, stoLow, stoMid, stoHigh, stoHighest, stoBase]
getRSX(src, intLen)
Parameters:
src (float): source
intLen (int): period
Returns: selected RSX
getRSX(src, intLow, intMid, intHigh)
Parameters:
src (float): source
intLow (int): short-term
intMid (int): mid-term
intHigh (int): long-term
Returns: [Low, Mid, High]
getRSX(src, intLowest, intLow, intMid, intHigh, intHighest, intBase)
Parameters:
src (float): source
intLowest (int): ultra-short
intLow (int): short
intMid (int): mid
intHigh (int): long
intHighest (int): ultra-long
intBase (int): base
Returns: [Lowest, Low, Mid, High, Highest, Base]
getMACD(src, fastLen, slowLen, signalLen)
Parameters:
src (float): source
fastLen (simple int): fast EMA period
slowLen (simple int): slow EMA period
signalLen (simple int): signal line period
Returns: [macdLine, signalLine, histLine]
getBollingerBand(src, len, mult)
Parameters:
src (float): source
len (int): period
mult (float): standard deviation multiplier
Returns: [basis, upper, lower]
getATR(intLen)
Parameters:
intLen (simple int): ATR period
Returns: selected ATR
getATR(intLow, intMid, intHigh)
Parameters:
intLow (simple int): short-term
intMid (simple int): mid-term
intHigh (simple int): long-term
Returns: [ATR Low, Mid, High] array
getATR(intLowest, intLow, intMid, intHigh, intHighest, intBase)
Parameters:
intLowest (simple int): ultra-short
intLow (simple int): short
intMid (simple int): mid
intHigh (simple int): long
intHighest (simple int): ultra-long
intBase (simple int): base
isCross(fastLine, baseLine)
Parameters:
fastLine (float): fast line
baseLine (float): base line
Returns: state (true/false)
isMAtrend(maLow, maMid, maHigh)
Parameters:
maLow (float): fast MA
maMid (float): mid MA
maHigh (float): slow MA
Returns: trend state
isMAline(val, valPrev, intBaseLine)
Parameters:
val (float): current value
valPrev (float): previous value
intBaseLine (int): base value
Returns: state
getStage(v1, v2, v3)
Parameters:
v1 (float): first value
v2 (float): second value
v3 (float): third value
Returns: stage number (1–6)
getBgColor(stage)
Parameters:
stage (int): stage number
Returns: color
getBgColor(stage, transp)
Parameters:
stage (int): stage number
transp (int): transparency
Returns: color
getBGColor(v1, v2, v3)
Parameters:
v1 (float): first value
v2 (float): second value
v3 (float): third value
Returns: color
getBGColor(v1, v2, v3, transp)
Parameters:
v1 (float): first value
v2 (float): second value
v3 (float): third value
transp (int): transparency
Returns: color
createStackedLabel(labelText, isUp, maLowest, maLow, maMid, maHigh, maHighest, maBase)
Parameters:
labelText (string): label text
isUp (bool): true = up, false = down
maLowest (float)
maLow (float)
maMid (float)
maHigh (float)
maHighest (float)
maBase (float)
Returns: created label
isDoubleBottom(src, left, right)
Parameters:
src (float): reference series (e.g., mid MA or low)
left (int): left bar count for pivot search
right (int): right bar count for pivot search
Returns: true if double bottom detected (previous pivot low < current pivot low)
isDoubleTop(src, left, right)
Parameters:
src (float): reference series (e.g., mid MA or high)
left (int): left bar count for pivot search
right (int): right bar count for pivot search
Returns: true if double top detected (previous pivot high > current pivot high)
isFractalHigh(src, left, right)
Parameters:
src (float): high series (e.g., high or mid MA)
left (int): left confirmation bars
right (int): right confirmation bars
Returns: true if fractal high detected
isFractalLow(src, left, right)
Parameters:
src (float): low series (e.g., low or mid MA)
left (int): left confirmation bars
right (int): right confirmation bars
Returns: true if fractal low detected
Thư viện Pine
Theo tinh thần TradingView thực sự, tác giả đã xuất bản mã Pine này dưới dạng thư viện nguồn mở để các lập trình viên Pine khác trong cộng đồng của chúng tôi có thể sử dụng lại. Xin tri ân tác giả! Bạn có thể sử dụng thư viện này riêng tư hoặc trong các bài đăng nguồn mở khác. Tuy nhiên, bạn cần sử dụng lại mã này theo Nội quy chung.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.
Thư viện Pine
Theo tinh thần TradingView thực sự, tác giả đã xuất bản mã Pine này dưới dạng thư viện nguồn mở để các lập trình viên Pine khác trong cộng đồng của chúng tôi có thể sử dụng lại. Xin tri ân tác giả! Bạn có thể sử dụng thư viện này riêng tư hoặc trong các bài đăng nguồn mở khác. Tuy nhiên, bạn cần sử dụng lại mã này theo Nội quy chung.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.