PINE LIBRARY
MyLibrary

Library "MyLibrary"
This library contains various trading strategies and utility functions for Pine Script.
simple_moving_average(src, length)
simple_moving_average
description Calculates the Simple Moving Average (SMA) of a given series.
Parameters:
src (float): (series float) The input series (e.g., close prices).
length (int): (int) The number of periods to use for the SMA calculation.
Returns: (series float) The calculated SMA series.
exponential_moving_average(src, length)
exponential_moving_average
description Calculates the Exponential Moving Average (EMA) of a given series.
Parameters:
src (float): (series float) The input series (e.g., close prices).
length (simple int): (int) The number of periods to use for the EMA calculation.
Returns: (series float) The calculated EMA series.
safe_division(numerator, denominator)
safe_division
description Performs division with error handling for division by zero.
Parameters:
numerator (float): (float) The numerator for the division.
denominator (float): (float) The denominator for the division.
Returns: (float) The result of the division, or na if the denominator is zero.
strategy_moving_average_crossover(shortLength, longLength)
strategy_moving_average_crossover
description Implements a Moving Average Crossover strategy.
Parameters:
shortLength (int): (int) The length for the short period SMA.
longLength (int): (int) The length for the long period SMA.
Returns: (series float, series float, series bool, series bool) The short SMA, long SMA, crossover signals, and crossunder signals.
strategy_rsi(rsiLength, overbought, oversold)
strategy_rsi
description Implements an RSI-based trading strategy.
Parameters:
rsiLength (simple int): (int) The length for the RSI calculation.
overbought (float): (float) The overbought threshold.
oversold (float): (float) The oversold threshold.
Returns: (series float, series bool, series bool) The RSI values, long signals, and short signals.
ichimoku_cloud(convPeriod, basePeriod, spanBPeriod, laggingSpanPeriod)
ichimoku_cloud
description Computes Ichimoku Cloud components.
Parameters:
convPeriod (int): (int) The conversion line period.
basePeriod (int): (int) The base line period.
spanBPeriod (int)
laggingSpanPeriod (int)
Returns: (series float, series float, series float, series float, series float) The conversion line, base line, leading span A, leading span B, and lagging span.
strategy_ichimoku_conversion_baseline()
strategy_ichimoku_conversion_baseline
description Implements an Ichimoku Conversion Line and Baseline strategy.
Returns: (series float, series float, series bool, series bool) The conversion line, baseline, crossover signals, and crossunder signals.
debug_print(labelText, value, barIndex)
debug_print
description Prints values to the chart for debugging purposes.
Parameters:
labelText (string): (string) The label text.
value (float): (float) The value to display.
barIndex (int): (int) The bar index where the label should be displayed.
This library contains various trading strategies and utility functions for Pine Script.
simple_moving_average(src, length)
simple_moving_average
description Calculates the Simple Moving Average (SMA) of a given series.
Parameters:
src (float): (series float) The input series (e.g., close prices).
length (int): (int) The number of periods to use for the SMA calculation.
Returns: (series float) The calculated SMA series.
exponential_moving_average(src, length)
exponential_moving_average
description Calculates the Exponential Moving Average (EMA) of a given series.
Parameters:
src (float): (series float) The input series (e.g., close prices).
length (simple int): (int) The number of periods to use for the EMA calculation.
Returns: (series float) The calculated EMA series.
safe_division(numerator, denominator)
safe_division
description Performs division with error handling for division by zero.
Parameters:
numerator (float): (float) The numerator for the division.
denominator (float): (float) The denominator for the division.
Returns: (float) The result of the division, or na if the denominator is zero.
strategy_moving_average_crossover(shortLength, longLength)
strategy_moving_average_crossover
description Implements a Moving Average Crossover strategy.
Parameters:
shortLength (int): (int) The length for the short period SMA.
longLength (int): (int) The length for the long period SMA.
Returns: (series float, series float, series bool, series bool) The short SMA, long SMA, crossover signals, and crossunder signals.
strategy_rsi(rsiLength, overbought, oversold)
strategy_rsi
description Implements an RSI-based trading strategy.
Parameters:
rsiLength (simple int): (int) The length for the RSI calculation.
overbought (float): (float) The overbought threshold.
oversold (float): (float) The oversold threshold.
Returns: (series float, series bool, series bool) The RSI values, long signals, and short signals.
ichimoku_cloud(convPeriod, basePeriod, spanBPeriod, laggingSpanPeriod)
ichimoku_cloud
description Computes Ichimoku Cloud components.
Parameters:
convPeriod (int): (int) The conversion line period.
basePeriod (int): (int) The base line period.
spanBPeriod (int)
laggingSpanPeriod (int)
Returns: (series float, series float, series float, series float, series float) The conversion line, base line, leading span A, leading span B, and lagging span.
strategy_ichimoku_conversion_baseline()
strategy_ichimoku_conversion_baseline
description Implements an Ichimoku Conversion Line and Baseline strategy.
Returns: (series float, series float, series bool, series bool) The conversion line, baseline, crossover signals, and crossunder signals.
debug_print(labelText, value, barIndex)
debug_print
description Prints values to the chart for debugging purposes.
Parameters:
labelText (string): (string) The label text.
value (float): (float) The value to display.
barIndex (int): (int) The bar index where the label should be displayed.
파인 라이브러리
트레이딩뷰의 진정한 정신에 따라, 작성자는 이 파인 코드를 오픈소스 라이브러리로 게시하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 경의를 표합니다! 이 라이브러리는 개인적으로 사용하거나 다른 오픈소스 게시물에서 사용할 수 있지만, 이 코드의 게시물 내 재사용은 하우스 룰에 따라 규제됩니다.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
파인 라이브러리
트레이딩뷰의 진정한 정신에 따라, 작성자는 이 파인 코드를 오픈소스 라이브러리로 게시하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 경의를 표합니다! 이 라이브러리는 개인적으로 사용하거나 다른 오픈소스 게시물에서 사용할 수 있지만, 이 코드의 게시물 내 재사용은 하우스 룰에 따라 규제됩니다.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.