PINE LIBRARY
RHR_CANDLE

Library "RHR_CANDLE"
Library for Expansion Contraction Indicator, a zero-lag dual perspective indicator based on Jake Bernstein’s principles of Moving Average Channel system.
calc(shortLookback, longLookback)
Calculates Expansion Contraction values.
Parameters:
shortLookback (int): Integer for the short lookback calculation, defaults to 8
longLookback (int): Integer for the long lookback calculation, defaults to 32
return Returns array of Expansion Contraction values
stdevCalc(positiveShort, negativeShort, positiveLong, negativeLong, stdevLookback)
Calculates standard deviation lines based on Expansion Contraction Long and Short values.
Parameters:
positiveShort (float): Float for the positive short XC value from calculation
negativeShort (float): Float for the negative short XC value from calculation
positiveLong (float): Float for the positive long XC value from calculation
negativeLong (float): Float for the negative long XC value from calculation
stdevLookback (int): Integer for the standard deviation lookback, defaults to 500
return Returns array of standard deviation values
trend(positiveShort, negativeShort, positiveLong, negativeLong)
Determines if trend is strong or weak based on Expansion Contraction values.
Parameters:
positiveShort (float): Float for the positive short XC value from calculation
negativeShort (float): Float for the negative short XC value from calculation
positiveLong (float): Float for the positive long XC value from calculation
negativeLong (float): Float for the negative long XC value from calculation
return Returns array of boolean values indicating strength or weakness of trend
Library for Expansion Contraction Indicator, a zero-lag dual perspective indicator based on Jake Bernstein’s principles of Moving Average Channel system.
calc(shortLookback, longLookback)
Calculates Expansion Contraction values.
Parameters:
shortLookback (int): Integer for the short lookback calculation, defaults to 8
longLookback (int): Integer for the long lookback calculation, defaults to 32
return Returns array of Expansion Contraction values
stdevCalc(positiveShort, negativeShort, positiveLong, negativeLong, stdevLookback)
Calculates standard deviation lines based on Expansion Contraction Long and Short values.
Parameters:
positiveShort (float): Float for the positive short XC value from calculation
negativeShort (float): Float for the negative short XC value from calculation
positiveLong (float): Float for the positive long XC value from calculation
negativeLong (float): Float for the negative long XC value from calculation
stdevLookback (int): Integer for the standard deviation lookback, defaults to 500
return Returns array of standard deviation values
trend(positiveShort, negativeShort, positiveLong, negativeLong)
Determines if trend is strong or weak based on Expansion Contraction values.
Parameters:
positiveShort (float): Float for the positive short XC value from calculation
negativeShort (float): Float for the negative short XC value from calculation
positiveLong (float): Float for the positive long XC value from calculation
negativeLong (float): Float for the negative long XC value from calculation
return Returns array of boolean values indicating strength or weakness of trend
Pine library
In true TradingView spirit, the author has published this Pine code as an open-source library so that other Pine programmers from our community can reuse it. Cheers to the author! You may use this library privately or in other open-source publications, but reuse of this code in publications is governed by House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Pine library
In true TradingView spirit, the author has published this Pine code as an open-source library so that other Pine programmers from our community can reuse it. Cheers to the author! You may use this library privately or in other open-source publications, but reuse of this code in publications is governed by House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.