PINE LIBRARY
BarCore

Library "BarCore"
BarCore is a foundational library for technical analysis, providing essential functions for evaluating the structural properties of candlesticks and inter-bar relationships.
It prioritizes ratio-based metrics (0.0 to 1.0) over absolute prices, making it asset-agnostic and ideal for robust pattern recognition, momentum analysis, and volume-weighted pressure evaluation.
Key modules:
- Structure & Range: High-precision bar and body metrics with relative positioning.
- Wick Dynamics: Absolute and relative wick analysis for identifying price rejection.
- Inter-bar Logic: Containment, coverage, and quantitative price overlap (Ratio-based).
- Gap Intelligence: Real body and price gaps with customizable significance thresholds.
- Flow & Pressure: Volume-weighted buying/selling pressure and Money Flow metrics.
isBuyingBar()
Checks if the bar is a bullish (up) bar, where close is greater than open.
Returns: bool True if the bar closed higher than it opened.
isSellingBar()
Checks if the bar is a bearish (down) bar, where close is less than open.
Returns: bool True if the bar closed lower than it opened.
barMidpoint()
Calculates the absolute midpoint of the bar's total range (High + Low) / 2.
Returns: float The midpoint price of the bar.
barRange()
Calculates the absolute size of the bar's total range (High to Low).
Returns: float The absolute difference between high and low.
barRangeMidpoint()
Calculates half of the bar's total range size.
Returns: float Half the bar's range size.
realBodyHigh()
Returns the higher price between the open and close.
Returns: float The top of the real body.
realBodyLow()
Returns the lower price between the open and close.
Returns: float The bottom of the real body.
realBodyMidpoint()
Calculates the absolute midpoint of the bar's real body.
Returns: float The midpoint price of the real body.
realBodyRange()
Calculates the absolute size of the bar's real body.
Returns: float The absolute difference between open and close.
realBodyRangeMidpoint()
Calculates half of the bar's real body size.
Returns: float Half the real body size.
upperWickRange()
Calculates the absolute size of the upper wick.
Returns: float The range from high to the real body high.
lowerWickRange()
Calculates the absolute size of the lower wick.
Returns: float The range from the real body low to low.
openRatio()
Returns the location of the open price relative to the bar's total range (0.0 at low to 1.0 at high).
Returns: float The ratio of the distance from low to open, divided by the total range.
closeRatio()
Returns the location of the close price relative to the bar's total range (0.0 at low to 1.0 at high).
Returns: float The ratio of the distance from low to close, divided by the total range.
realBodyRatio()
Calculates the ratio of the real body size to the total bar range.
Returns: float The real body size divided by the bar range. Returns 0 if barRange is 0.
upperWickRatio()
Calculates the ratio of the upper wick size to the total bar range.
Returns: float The upper wick size divided by the bar range. Returns 0 if barRange is 0.
lowerWickRatio()
Calculates the ratio of the lower wick size to the total bar range.
Returns: float The lower wick size divided by the bar range. Returns 0 if barRange is 0.
upperWickToBodyRatio()
Calculates the ratio of the upper wick size to the real body size.
Returns: float The upper wick size divided by the real body size. Returns 0 if realBodyRange is 0.
lowerWickToBodyRatio()
Calculates the ratio of the lower wick size to the real body size.
Returns: float The lower wick size divided by the real body size. Returns 0 if realBodyRange is 0.
totalWickRatio()
Calculates the ratio of the total wick range (Upper Wick + Lower Wick) to the total bar range.
Returns: float The total wick range expressed as a ratio of the bar's total range. Returns 0 if barRange is 0.
isBodyExpansion()
Checks if the current bar's real body range is larger than the previous bar's real body range (body expansion).
Returns: bool True if realBodyRange() > realBodyRange()[1].
isBodyContraction()
Checks if the current bar's real body range is smaller than the previous bar's real body range (body contraction).
Returns: bool True if realBodyRange() < realBodyRange()[1].
isWithinPrevBar(inclusive)
Checks if the current bar's range is entirely within the previous bar's range.
Parameters:
inclusive (bool): If true, allows equality (<=, >=). Default is false.
Returns: bool True if High < High[1] AND Low > Low[1].
isCoveringPrevBar(inclusive)
Checks if the current bar's range fully covers the entire previous bar's range.
Parameters:
inclusive (bool): If true, allows equality (<=, >=). Default is false.
Returns: bool True if High > High[1] AND Low < Low[1].
isWithinPrevBody(inclusive)
Checks if the current bar's real body is entirely inside the previous bar's real body.
Parameters:
inclusive (bool): If true, allows equality (<=, >=). Default is false.
Returns: bool True if the current body is contained inside the previous body.
isCoveringPrevBody(inclusive)
Checks if the current bar's real body fully covers the previous bar's real body.
Parameters:
inclusive (bool): If true, allows equality (<=, >=). Default is false.
Returns: bool True if the current body fully covers the previous body.
isOpenWithinPrevBody(inclusive)
Checks if the current bar's open price falls within the real body range of the previous bar.
Parameters:
inclusive (bool): If true, includes the boundary prices. Default is false.
Returns: bool True if the open price is between the previous bar's real body high and real body low.
isCloseWithinPrevBody(inclusive)
Checks if the current bar's close price falls within the real body range of the previous bar.
Parameters:
inclusive (bool): If true, includes the boundary prices. Default is false.
Returns: bool True if the close price is between the previous bar's real body high and real body low.
isPrevOpenWithinBody(inclusive)
Checks if the previous bar's open price falls within the current bar's real body range.
Parameters:
inclusive (bool): If true, includes the boundary prices. Default is false.
Returns: bool True if open[1] is between the current bar's real body high and real body low.
isPrevCloseWithinBody(inclusive)
Checks if the previous bar's closing price falls within the current bar's real body range.
Parameters:
inclusive (bool): If true, includes the boundary prices. Default is false.
Returns: bool True if close[1] is between the current bar's real body high and real body low.
isOverlappingPrevBar()
Checks if there is any price overlap between the current bar's range and the previous bar's range.
Returns: bool True if the current bar's range has any intersection with the previous bar's range.
bodyOverlapRatio()
Calculates the percentage of the current real body that overlaps with the previous real body.
Returns: float The overlap ratio (0.0 to 1.0). 1.0 means the current body is entirely within the previous body's price range.
isCompletePriceGapUp()
Checks for a complete price gap up where the current bar's low is strictly above the previous bar's high, meaning there is zero price overlap between the two bars.
Returns: bool True if the current low is greater than the previous high.
isCompletePriceGapDown()
Checks for a complete price gap down where the current bar's high is strictly below the previous bar's low, meaning there is zero price overlap between the two bars.
Returns: bool True if the current high is less than the previous low.
isRealBodyGapUp()
Checks for a gap between the current and previous real bodies.
Returns: bool True if the current body is completely above the previous body.
isRealBodyGapDown()
Checks for a gap between the current and previous real bodies.
Returns: bool True if the current body is completely below the previous body.
gapRatio()
Calculates the percentage difference between the current open and the previous close, expressed as a decimal ratio.
Returns: float The gap ratio (positive for gap up, negative for gap down). Returns 0 if the previous close is 0.
gapPercentage()
Calculates the percentage difference between the current open and the previous close.
Returns: float The gap percentage (positive for gap up, negative for gap down). Returns 0 if previous close is 0.
isGapUp()
Checks for a basic gap up, where the current bar's open is strictly higher than the previous bar's close. This is the minimum condition for a gap up.
Returns: bool True if the current open is greater than the previous close (i.e., gapRatio is positive).
isGapDown()
Checks for a basic gap down, where the current bar's open is strictly lower than the previous bar's close. This is the minimum condition for a gap down.
Returns: bool True if the current open is less than the previous close (i.e., gapRatio is negative).
isSignificantGapUp(minRatio)
Checks if the current bar opened significantly higher than the previous close, as defined by a minimum percentage ratio.
Parameters:
minRatio (float): The minimum required gap percentage ratio. Default is 0.03 (3%).
Returns: bool True if the gap ratio (open vs. previous close) is greater than or equal to the minimum ratio.
isSignificantGapDown(minRatio)
Checks if the current bar opened significantly lower than the previous close, as defined by a minimum percentage ratio.
Parameters:
minRatio (float): The minimum required gap percentage ratio. Default is 0.03 (3%).
Returns: bool True if the absolute value of the gap ratio (open vs. previous close) is greater than or equal to the minimum ratio.
trueRangeComponentHigh()
Calculates the absolute distance from the current bar's High to the previous bar's Close, representing one of the components of the True Range.
Returns: float The absolute difference: |High - Close[1]|.
trueRangeComponentLow()
Calculates the absolute distance from the current bar's Low to the previous bar's Close, representing one of the components of the True Range.
Returns: float The absolute difference: |Low - Close[1]|.
isUpperWickDominant(minRatio)
Checks if the upper wick is significantly long relative to the total range.
Parameters:
minRatio (float): Minimum ratio of the wick to the total bar range. Default is 0.7 (70%).
Returns: bool True if the upper wick dominates the bar's range.
isUpperWickNegligible(maxRatio)
Checks if the upper wick is very small relative to the total range.
Parameters:
maxRatio (float): Maximum ratio of the wick to the total bar range. Default is 0.05 (5%).
Returns: bool True if the upper wick is negligible.
isLowerWickDominant(minRatio)
Checks if the lower wick is significantly long relative to the total range.
Parameters:
minRatio (float): Minimum ratio of the wick to the total bar range. Default is 0.7 (70%).
Returns: bool True if the lower wick dominates the bar's range.
isLowerWickNegligible(maxRatio)
Checks if the lower wick is very small relative to the total range.
Parameters:
maxRatio (float): Maximum ratio of the wick to the total bar range. Default is 0.05 (5%).
Returns: bool True if the lower wick is negligible.
isSymmetric(maxTolerance)
Checks if the upper and lower wicks are roughly equal in length.
Parameters:
maxTolerance (float): Maximum allowable percentage difference between the two wicks. Default is 0.15 (15%).
Returns: bool True if wicks are symmetric within the tolerance level.
isMarubozuBody(minRatio)
Candle with a very large body relative to the total range (minimal wicks).
Parameters:
minRatio (float): Minimum body size ratio. Default is 0.9 (90%).
Returns: bool True if the bar has minimal wicks (Marubozu body).
isLargeBody(minRatio)
Candle with a large body relative to the total range.
Parameters:
minRatio (float): Minimum body size ratio. Default is 0.6 (60%).
Returns: bool True if the bar has a large body.
isSmallBody(maxRatio)
Candle with a small body relative to the total range.
Parameters:
maxRatio (float): Maximum body size ratio. Default is 0.4 (40%).
Returns: bool True if the bar has small body.
isDojiBody(maxRatio)
Candle with a very small body relative to the total range (indecision).
Parameters:
maxRatio (float): Maximum body size ratio. Default is 0.1 (10%).
Returns: bool True if the bar has a very small body.
isLowerWickExtended(minRatio)
Checks if the lower wick is significantly extended relative to the real body size.
Parameters:
minRatio (float): Minimum required ratio of the lower wick length to the real body size. Default is 2.0 (Lower wick must be at least twice the body's size).
Returns: bool True if the lower wick's length is at least `minRatio` times the size of the real body.
isUpperWickExtended(minRatio)
Checks if the upper wick is significantly extended relative to the real body size.
Parameters:
minRatio (float): Minimum required ratio of the upper wick length to the real body size. Default is 2.0 (Upper wick must be at least twice the body's size).
Returns: bool True if the upper wick's length is at least `minRatio` times the size of the real body.
isStrongBuyingBar(minCloseRatio, maxOpenRatio)
Checks for a bar with strong bullish momentum (open near low, close near high), indicating high conviction.
Parameters:
minCloseRatio (float): Minimum required ratio for the close location (relative to range, e.g., 0.7 means close must be in the top 30%). Default is 0.7 (70%).
maxOpenRatio (float): Maximum allowed ratio for the open location (relative to range, e.g., 0.3 means open must be in the bottom 30%). Default is 0.3 (30%).
Returns: bool True if the bar is bullish, opened in the low extreme, and closed in the high extreme.
isStrongSellingBar(maxCloseRatio, minOpenRatio)
Checks for a bar with strong bearish momentum (open near high, close near low), indicating high conviction.
Parameters:
maxCloseRatio (float): Maximum allowed ratio for the close location (relative to range, e.g., 0.3 means close must be in the bottom 30%). Default is 0.3 (30%).
minOpenRatio (float): Minimum required ratio for the open location (relative to range, e.g., 0.7 means open must be in the top 30%). Default is 0.7 (70%).
Returns: bool True if the bar is bearish, opened in the high extreme, and closed in the low extreme.
isWeakBuyingBar(maxCloseRatio, maxBodyRatio)
Identifies a bar that is technically bullish but shows significant weakness, characterized by a failure to close near the high and a small body size.
Parameters:
maxCloseRatio (float): Maximum allowed ratio for the close location relative to the range (e.g., 0.6 means the close must be in the bottom 60% of the bar's range). Default is 0.6 (60%).
maxBodyRatio (float): Maximum allowed ratio for the real body size relative to the bar's range (e.g., 0.4 means the body is small). Default is 0.4 (40%).
Returns: bool True if the bar is bullish, but its close is weak and its body is small.
isWeakSellingBar(minCloseRatio, maxBodyRatio)
Identifies a bar that is technically bearish but shows significant weakness, characterized by a failure to close near the low and a small body size.
Parameters:
minCloseRatio (float): Minimum required ratio for the close location relative to the range (e.g., 0.4 means the close must be in the top 60% of the bar's range). Default is 0.4 (40%).
maxBodyRatio (float): Maximum allowed ratio for the real body size relative to the bar's range (e.g., 0.4 means the body is small). Default is 0.4 (40%).
Returns: bool True if the bar is bearish, but its close is weak and its body is small.
balanceOfPower()
Measures the net pressure of buyers vs. sellers within the bar, normalized to the bar's range.
Returns: float A value between -1.0 (strong selling) and +1.0 (strong buying), representing the strength and direction of the close relative to the open.
buyingPressure()
Measures the net buying volume pressure based on the close location and volume.
Returns: float A numerical value representing the volume weighted buying pressure.
sellingPressure()
Measures the net selling volume pressure based on the close location and volume.
Returns: float A numerical value representing the volume weighted selling pressure.
moneyFlowMultiplier()
Calculates the Money Flow Multiplier (MFM), which is the price component of Money Flow and CMF.
Returns: float A normalized value from -1.0 (strong selling) to +1.0 (strong buying), representing the net directional pressure.
moneyFlowVolume()
Calculates the Money Flow Volume (MFV), which is the Money Flow Multiplier weighted by the bar's volume.
Returns: float A numerical value representing the volume-weighted money flow. Positive = buying dominance; negative = selling dominance.
isAccumulationBar()
Checks for basic accumulation on the current bar, requiring both positive Money Flow Volume and a buying bar (closing higher than opening).
Returns: bool True if the bar exhibits buying dominance through its internal range location and is a buying bar.
isDistributionBar()
Checks for basic distribution on the current bar, requiring both negative Money Flow Volume and a selling bar (closing lower than opening).
Returns: bool True if the bar exhibits selling dominance through its internal range location and is a selling bar.
BarCore is a foundational library for technical analysis, providing essential functions for evaluating the structural properties of candlesticks and inter-bar relationships.
It prioritizes ratio-based metrics (0.0 to 1.0) over absolute prices, making it asset-agnostic and ideal for robust pattern recognition, momentum analysis, and volume-weighted pressure evaluation.
Key modules:
- Structure & Range: High-precision bar and body metrics with relative positioning.
- Wick Dynamics: Absolute and relative wick analysis for identifying price rejection.
- Inter-bar Logic: Containment, coverage, and quantitative price overlap (Ratio-based).
- Gap Intelligence: Real body and price gaps with customizable significance thresholds.
- Flow & Pressure: Volume-weighted buying/selling pressure and Money Flow metrics.
isBuyingBar()
Checks if the bar is a bullish (up) bar, where close is greater than open.
Returns: bool True if the bar closed higher than it opened.
isSellingBar()
Checks if the bar is a bearish (down) bar, where close is less than open.
Returns: bool True if the bar closed lower than it opened.
barMidpoint()
Calculates the absolute midpoint of the bar's total range (High + Low) / 2.
Returns: float The midpoint price of the bar.
barRange()
Calculates the absolute size of the bar's total range (High to Low).
Returns: float The absolute difference between high and low.
barRangeMidpoint()
Calculates half of the bar's total range size.
Returns: float Half the bar's range size.
realBodyHigh()
Returns the higher price between the open and close.
Returns: float The top of the real body.
realBodyLow()
Returns the lower price between the open and close.
Returns: float The bottom of the real body.
realBodyMidpoint()
Calculates the absolute midpoint of the bar's real body.
Returns: float The midpoint price of the real body.
realBodyRange()
Calculates the absolute size of the bar's real body.
Returns: float The absolute difference between open and close.
realBodyRangeMidpoint()
Calculates half of the bar's real body size.
Returns: float Half the real body size.
upperWickRange()
Calculates the absolute size of the upper wick.
Returns: float The range from high to the real body high.
lowerWickRange()
Calculates the absolute size of the lower wick.
Returns: float The range from the real body low to low.
openRatio()
Returns the location of the open price relative to the bar's total range (0.0 at low to 1.0 at high).
Returns: float The ratio of the distance from low to open, divided by the total range.
closeRatio()
Returns the location of the close price relative to the bar's total range (0.0 at low to 1.0 at high).
Returns: float The ratio of the distance from low to close, divided by the total range.
realBodyRatio()
Calculates the ratio of the real body size to the total bar range.
Returns: float The real body size divided by the bar range. Returns 0 if barRange is 0.
upperWickRatio()
Calculates the ratio of the upper wick size to the total bar range.
Returns: float The upper wick size divided by the bar range. Returns 0 if barRange is 0.
lowerWickRatio()
Calculates the ratio of the lower wick size to the total bar range.
Returns: float The lower wick size divided by the bar range. Returns 0 if barRange is 0.
upperWickToBodyRatio()
Calculates the ratio of the upper wick size to the real body size.
Returns: float The upper wick size divided by the real body size. Returns 0 if realBodyRange is 0.
lowerWickToBodyRatio()
Calculates the ratio of the lower wick size to the real body size.
Returns: float The lower wick size divided by the real body size. Returns 0 if realBodyRange is 0.
totalWickRatio()
Calculates the ratio of the total wick range (Upper Wick + Lower Wick) to the total bar range.
Returns: float The total wick range expressed as a ratio of the bar's total range. Returns 0 if barRange is 0.
isBodyExpansion()
Checks if the current bar's real body range is larger than the previous bar's real body range (body expansion).
Returns: bool True if realBodyRange() > realBodyRange()[1].
isBodyContraction()
Checks if the current bar's real body range is smaller than the previous bar's real body range (body contraction).
Returns: bool True if realBodyRange() < realBodyRange()[1].
isWithinPrevBar(inclusive)
Checks if the current bar's range is entirely within the previous bar's range.
Parameters:
inclusive (bool): If true, allows equality (<=, >=). Default is false.
Returns: bool True if High < High[1] AND Low > Low[1].
isCoveringPrevBar(inclusive)
Checks if the current bar's range fully covers the entire previous bar's range.
Parameters:
inclusive (bool): If true, allows equality (<=, >=). Default is false.
Returns: bool True if High > High[1] AND Low < Low[1].
isWithinPrevBody(inclusive)
Checks if the current bar's real body is entirely inside the previous bar's real body.
Parameters:
inclusive (bool): If true, allows equality (<=, >=). Default is false.
Returns: bool True if the current body is contained inside the previous body.
isCoveringPrevBody(inclusive)
Checks if the current bar's real body fully covers the previous bar's real body.
Parameters:
inclusive (bool): If true, allows equality (<=, >=). Default is false.
Returns: bool True if the current body fully covers the previous body.
isOpenWithinPrevBody(inclusive)
Checks if the current bar's open price falls within the real body range of the previous bar.
Parameters:
inclusive (bool): If true, includes the boundary prices. Default is false.
Returns: bool True if the open price is between the previous bar's real body high and real body low.
isCloseWithinPrevBody(inclusive)
Checks if the current bar's close price falls within the real body range of the previous bar.
Parameters:
inclusive (bool): If true, includes the boundary prices. Default is false.
Returns: bool True if the close price is between the previous bar's real body high and real body low.
isPrevOpenWithinBody(inclusive)
Checks if the previous bar's open price falls within the current bar's real body range.
Parameters:
inclusive (bool): If true, includes the boundary prices. Default is false.
Returns: bool True if open[1] is between the current bar's real body high and real body low.
isPrevCloseWithinBody(inclusive)
Checks if the previous bar's closing price falls within the current bar's real body range.
Parameters:
inclusive (bool): If true, includes the boundary prices. Default is false.
Returns: bool True if close[1] is between the current bar's real body high and real body low.
isOverlappingPrevBar()
Checks if there is any price overlap between the current bar's range and the previous bar's range.
Returns: bool True if the current bar's range has any intersection with the previous bar's range.
bodyOverlapRatio()
Calculates the percentage of the current real body that overlaps with the previous real body.
Returns: float The overlap ratio (0.0 to 1.0). 1.0 means the current body is entirely within the previous body's price range.
isCompletePriceGapUp()
Checks for a complete price gap up where the current bar's low is strictly above the previous bar's high, meaning there is zero price overlap between the two bars.
Returns: bool True if the current low is greater than the previous high.
isCompletePriceGapDown()
Checks for a complete price gap down where the current bar's high is strictly below the previous bar's low, meaning there is zero price overlap between the two bars.
Returns: bool True if the current high is less than the previous low.
isRealBodyGapUp()
Checks for a gap between the current and previous real bodies.
Returns: bool True if the current body is completely above the previous body.
isRealBodyGapDown()
Checks for a gap between the current and previous real bodies.
Returns: bool True if the current body is completely below the previous body.
gapRatio()
Calculates the percentage difference between the current open and the previous close, expressed as a decimal ratio.
Returns: float The gap ratio (positive for gap up, negative for gap down). Returns 0 if the previous close is 0.
gapPercentage()
Calculates the percentage difference between the current open and the previous close.
Returns: float The gap percentage (positive for gap up, negative for gap down). Returns 0 if previous close is 0.
isGapUp()
Checks for a basic gap up, where the current bar's open is strictly higher than the previous bar's close. This is the minimum condition for a gap up.
Returns: bool True if the current open is greater than the previous close (i.e., gapRatio is positive).
isGapDown()
Checks for a basic gap down, where the current bar's open is strictly lower than the previous bar's close. This is the minimum condition for a gap down.
Returns: bool True if the current open is less than the previous close (i.e., gapRatio is negative).
isSignificantGapUp(minRatio)
Checks if the current bar opened significantly higher than the previous close, as defined by a minimum percentage ratio.
Parameters:
minRatio (float): The minimum required gap percentage ratio. Default is 0.03 (3%).
Returns: bool True if the gap ratio (open vs. previous close) is greater than or equal to the minimum ratio.
isSignificantGapDown(minRatio)
Checks if the current bar opened significantly lower than the previous close, as defined by a minimum percentage ratio.
Parameters:
minRatio (float): The minimum required gap percentage ratio. Default is 0.03 (3%).
Returns: bool True if the absolute value of the gap ratio (open vs. previous close) is greater than or equal to the minimum ratio.
trueRangeComponentHigh()
Calculates the absolute distance from the current bar's High to the previous bar's Close, representing one of the components of the True Range.
Returns: float The absolute difference: |High - Close[1]|.
trueRangeComponentLow()
Calculates the absolute distance from the current bar's Low to the previous bar's Close, representing one of the components of the True Range.
Returns: float The absolute difference: |Low - Close[1]|.
isUpperWickDominant(minRatio)
Checks if the upper wick is significantly long relative to the total range.
Parameters:
minRatio (float): Minimum ratio of the wick to the total bar range. Default is 0.7 (70%).
Returns: bool True if the upper wick dominates the bar's range.
isUpperWickNegligible(maxRatio)
Checks if the upper wick is very small relative to the total range.
Parameters:
maxRatio (float): Maximum ratio of the wick to the total bar range. Default is 0.05 (5%).
Returns: bool True if the upper wick is negligible.
isLowerWickDominant(minRatio)
Checks if the lower wick is significantly long relative to the total range.
Parameters:
minRatio (float): Minimum ratio of the wick to the total bar range. Default is 0.7 (70%).
Returns: bool True if the lower wick dominates the bar's range.
isLowerWickNegligible(maxRatio)
Checks if the lower wick is very small relative to the total range.
Parameters:
maxRatio (float): Maximum ratio of the wick to the total bar range. Default is 0.05 (5%).
Returns: bool True if the lower wick is negligible.
isSymmetric(maxTolerance)
Checks if the upper and lower wicks are roughly equal in length.
Parameters:
maxTolerance (float): Maximum allowable percentage difference between the two wicks. Default is 0.15 (15%).
Returns: bool True if wicks are symmetric within the tolerance level.
isMarubozuBody(minRatio)
Candle with a very large body relative to the total range (minimal wicks).
Parameters:
minRatio (float): Minimum body size ratio. Default is 0.9 (90%).
Returns: bool True if the bar has minimal wicks (Marubozu body).
isLargeBody(minRatio)
Candle with a large body relative to the total range.
Parameters:
minRatio (float): Minimum body size ratio. Default is 0.6 (60%).
Returns: bool True if the bar has a large body.
isSmallBody(maxRatio)
Candle with a small body relative to the total range.
Parameters:
maxRatio (float): Maximum body size ratio. Default is 0.4 (40%).
Returns: bool True if the bar has small body.
isDojiBody(maxRatio)
Candle with a very small body relative to the total range (indecision).
Parameters:
maxRatio (float): Maximum body size ratio. Default is 0.1 (10%).
Returns: bool True if the bar has a very small body.
isLowerWickExtended(minRatio)
Checks if the lower wick is significantly extended relative to the real body size.
Parameters:
minRatio (float): Minimum required ratio of the lower wick length to the real body size. Default is 2.0 (Lower wick must be at least twice the body's size).
Returns: bool True if the lower wick's length is at least `minRatio` times the size of the real body.
isUpperWickExtended(minRatio)
Checks if the upper wick is significantly extended relative to the real body size.
Parameters:
minRatio (float): Minimum required ratio of the upper wick length to the real body size. Default is 2.0 (Upper wick must be at least twice the body's size).
Returns: bool True if the upper wick's length is at least `minRatio` times the size of the real body.
isStrongBuyingBar(minCloseRatio, maxOpenRatio)
Checks for a bar with strong bullish momentum (open near low, close near high), indicating high conviction.
Parameters:
minCloseRatio (float): Minimum required ratio for the close location (relative to range, e.g., 0.7 means close must be in the top 30%). Default is 0.7 (70%).
maxOpenRatio (float): Maximum allowed ratio for the open location (relative to range, e.g., 0.3 means open must be in the bottom 30%). Default is 0.3 (30%).
Returns: bool True if the bar is bullish, opened in the low extreme, and closed in the high extreme.
isStrongSellingBar(maxCloseRatio, minOpenRatio)
Checks for a bar with strong bearish momentum (open near high, close near low), indicating high conviction.
Parameters:
maxCloseRatio (float): Maximum allowed ratio for the close location (relative to range, e.g., 0.3 means close must be in the bottom 30%). Default is 0.3 (30%).
minOpenRatio (float): Minimum required ratio for the open location (relative to range, e.g., 0.7 means open must be in the top 30%). Default is 0.7 (70%).
Returns: bool True if the bar is bearish, opened in the high extreme, and closed in the low extreme.
isWeakBuyingBar(maxCloseRatio, maxBodyRatio)
Identifies a bar that is technically bullish but shows significant weakness, characterized by a failure to close near the high and a small body size.
Parameters:
maxCloseRatio (float): Maximum allowed ratio for the close location relative to the range (e.g., 0.6 means the close must be in the bottom 60% of the bar's range). Default is 0.6 (60%).
maxBodyRatio (float): Maximum allowed ratio for the real body size relative to the bar's range (e.g., 0.4 means the body is small). Default is 0.4 (40%).
Returns: bool True if the bar is bullish, but its close is weak and its body is small.
isWeakSellingBar(minCloseRatio, maxBodyRatio)
Identifies a bar that is technically bearish but shows significant weakness, characterized by a failure to close near the low and a small body size.
Parameters:
minCloseRatio (float): Minimum required ratio for the close location relative to the range (e.g., 0.4 means the close must be in the top 60% of the bar's range). Default is 0.4 (40%).
maxBodyRatio (float): Maximum allowed ratio for the real body size relative to the bar's range (e.g., 0.4 means the body is small). Default is 0.4 (40%).
Returns: bool True if the bar is bearish, but its close is weak and its body is small.
balanceOfPower()
Measures the net pressure of buyers vs. sellers within the bar, normalized to the bar's range.
Returns: float A value between -1.0 (strong selling) and +1.0 (strong buying), representing the strength and direction of the close relative to the open.
buyingPressure()
Measures the net buying volume pressure based on the close location and volume.
Returns: float A numerical value representing the volume weighted buying pressure.
sellingPressure()
Measures the net selling volume pressure based on the close location and volume.
Returns: float A numerical value representing the volume weighted selling pressure.
moneyFlowMultiplier()
Calculates the Money Flow Multiplier (MFM), which is the price component of Money Flow and CMF.
Returns: float A normalized value from -1.0 (strong selling) to +1.0 (strong buying), representing the net directional pressure.
moneyFlowVolume()
Calculates the Money Flow Volume (MFV), which is the Money Flow Multiplier weighted by the bar's volume.
Returns: float A numerical value representing the volume-weighted money flow. Positive = buying dominance; negative = selling dominance.
isAccumulationBar()
Checks for basic accumulation on the current bar, requiring both positive Money Flow Volume and a buying bar (closing higher than opening).
Returns: bool True if the bar exhibits buying dominance through its internal range location and is a buying bar.
isDistributionBar()
Checks for basic distribution on the current bar, requiring both negative Money Flow Volume and a selling bar (closing lower than opening).
Returns: bool True if the bar exhibits selling dominance through its internal range location and is a selling bar.
Bibliothèque Pine
Dans l'esprit TradingView, l'auteur a publié ce code Pine sous forme de bibliothèque open source afin que d'autres programmeurs Pine de notre communauté puissent le réutiliser. Bravo à l'auteur! Vous pouvez utiliser cette bibliothèque à titre privé ou dans d'autres publications open source, mais la réutilisation de ce code dans des publications est régie par nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Bibliothèque Pine
Dans l'esprit TradingView, l'auteur a publié ce code Pine sous forme de bibliothèque open source afin que d'autres programmeurs Pine de notre communauté puissent le réutiliser. Bravo à l'auteur! Vous pouvez utiliser cette bibliothèque à titre privé ou dans d'autres publications open source, mais la réutilisation de ce code dans des publications est régie par nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.