PINE LIBRARY
Utility

Library "Utility"
A utility library for various trading tools such as signal generation, custom indicators, and multi-condition crossovers.
multiCrossover(source1, source2, threshold1, threshold2)
multiCrossover
description Detects multi-condition crossovers between two sources with threshold filters.
Parameters:
source1 (float): The first data series to compare.
source2 (float): The second data series to compare.
threshold1 (float): A value that source1 must exceed to trigger the crossover.
threshold2 (float): A value that source2 must exceed to trigger the crossunder.
Returns: A tuple: (crossUp, crossDown) where crossUp is a boolean for upward crossover, and crossDown is for downward crossover.
macdCustom(source, fastLength, slowLength, signalLength, macdThresh)
macdCustom
description Calculates custom MACD signals based on thresholds.
Parameters:
source (float): The price data or input series.
fastLength (simple int): The length of the fast EMA.
slowLength (simple int): The length of the slow EMA.
signalLength (simple int): The signal line length.
macdThresh (float): A threshold for the MACD line to confirm buy/sell signals.
Returns: A tuple: (macdBuySignal, macdSellSignal) where macdBuySignal is true when MACD crosses above, and macdSellSignal is true when MACD crosses below the signal line.
combinedMacdRsi(source, fastLength, slowLength, signalLength, rsiLength, macdThresh, rsiThresh)
combinedMacdRsi
description Generates combined signals from MACD and RSI indicators.
Parameters:
source (float): The price data or input series.
fastLength (simple int): The length of the fast EMA for MACD.
slowLength (simple int): The length of the slow EMA for MACD.
signalLength (simple int): The signal line length for MACD.
rsiLength (simple int): The length of the RSI calculation.
macdThresh (float): The threshold for MACD signals.
rsiThresh (float): The threshold for RSI signals.
Returns: A tuple: (buySignal, sellSignal) where buySignal is generated when MACD is positive and RSI is below the threshold, and sellSignal when MACD is negative and RSI is above the threshold.
movingAverageCrossover(source, shortLength, longLength)
movingAverageCrossover
description Detects crossovers between short-term and long-term moving averages.
Parameters:
source (float): The price data or input series.
shortLength (int): The length of the short-term moving average.
longLength (int): The length of the long-term moving average.
Returns: A tuple: (crossUp, crossDown) where crossUp is true when the short-term MA crosses above the long-term MA, and crossDown when the reverse occurs.
A utility library for various trading tools such as signal generation, custom indicators, and multi-condition crossovers.
multiCrossover(source1, source2, threshold1, threshold2)
multiCrossover
description Detects multi-condition crossovers between two sources with threshold filters.
Parameters:
source1 (float): The first data series to compare.
source2 (float): The second data series to compare.
threshold1 (float): A value that source1 must exceed to trigger the crossover.
threshold2 (float): A value that source2 must exceed to trigger the crossunder.
Returns: A tuple: (crossUp, crossDown) where crossUp is a boolean for upward crossover, and crossDown is for downward crossover.
macdCustom(source, fastLength, slowLength, signalLength, macdThresh)
macdCustom
description Calculates custom MACD signals based on thresholds.
Parameters:
source (float): The price data or input series.
fastLength (simple int): The length of the fast EMA.
slowLength (simple int): The length of the slow EMA.
signalLength (simple int): The signal line length.
macdThresh (float): A threshold for the MACD line to confirm buy/sell signals.
Returns: A tuple: (macdBuySignal, macdSellSignal) where macdBuySignal is true when MACD crosses above, and macdSellSignal is true when MACD crosses below the signal line.
combinedMacdRsi(source, fastLength, slowLength, signalLength, rsiLength, macdThresh, rsiThresh)
combinedMacdRsi
description Generates combined signals from MACD and RSI indicators.
Parameters:
source (float): The price data or input series.
fastLength (simple int): The length of the fast EMA for MACD.
slowLength (simple int): The length of the slow EMA for MACD.
signalLength (simple int): The signal line length for MACD.
rsiLength (simple int): The length of the RSI calculation.
macdThresh (float): The threshold for MACD signals.
rsiThresh (float): The threshold for RSI signals.
Returns: A tuple: (buySignal, sellSignal) where buySignal is generated when MACD is positive and RSI is below the threshold, and sellSignal when MACD is negative and RSI is above the threshold.
movingAverageCrossover(source, shortLength, longLength)
movingAverageCrossover
description Detects crossovers between short-term and long-term moving averages.
Parameters:
source (float): The price data or input series.
shortLength (int): The length of the short-term moving average.
longLength (int): The length of the long-term moving average.
Returns: A tuple: (crossUp, crossDown) where crossUp is true when the short-term MA crosses above the long-term MA, and crossDown when the reverse occurs.
파인 라이브러리
트레이딩뷰의 진정한 정신에 따라, 작성자는 이 파인 코드를 오픈소스 라이브러리로 게시하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 경의를 표합니다! 이 라이브러리는 개인적으로 사용하거나 다른 오픈소스 게시물에서 사용할 수 있지만, 이 코드의 게시물 내 재사용은 하우스 룰에 따라 규제됩니다.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
파인 라이브러리
트레이딩뷰의 진정한 정신에 따라, 작성자는 이 파인 코드를 오픈소스 라이브러리로 게시하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 경의를 표합니다! 이 라이브러리는 개인적으로 사용하거나 다른 오픈소스 게시물에서 사용할 수 있지만, 이 코드의 게시물 내 재사용은 하우스 룰에 따라 규제됩니다.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.