Library "HarmonicPattern"
Functions to detect/check harmonic patterns from provided values.
line_price_rate(point_c, point_b, point_a) Compute the price rate of the line AB divided by the the line BC
Parameters:
Returns: float
line_time_rate(_c, _b, _a) Compute the time rate of the line AB divided by the the line BC
Parameters:
Returns: float
is_inrange(value, min, max) Check if value is within min/max range of tolerance.
Parameters:
Returns: bool
isHarmonicTriangle(rate_cba, margin_of_error) Check if the rate(s) correspond to pattern ("Harmonic Triangle").
Parameters:
Returns: bool
is2Tap(rate_cba, margin_of_error) Check if the rate(s) correspond to pattern ("2Tap", 'Double Top / Bottom').
Parameters:
Returns: bool
is3Tap(rate_edc, rate_cba, margin_of_error) Check if the rate(s) correspond to pattern ("3Tap", "Triple Top / Bottom").
Parameters:
Returns: bool
is4Tap(rate_gfe, rate_edc, rate_cba, margin_of_error) Check if the rate(s) correspond to pattern ("4Tap", "Quadruple Top / Bottom").
Parameters:
Returns: bool
isABCD(rate_cba, rate_dcb, margin_of_error) Check if the rate(s) correspond to pattern ("AB=CD").
Parameters:
Returns: bool
isBat(rate_edc, rate_dcb, rate_cba, rate_eda, margin_of_error) Check if the rate(s) correspond to pattern ("Bat").
Parameters:
Returns: bool
isButterfly(rate_edc, rate_dcb, rate_cba, rate_eda, margin_of_error) Check if the rate(s) correspond to pattern ("Butterfly").
Parameters:
Returns: bool
isGartley(rate_edc, rate_dcb, rate_cba, rate_eda, margin_of_error) Check if the rate(s) correspond to pattern ("Gartley").
Parameters:
Returns: bool
isCrab(rate_edc, rate_dcb, rate_cba, rate_eda, margin_of_error) Check if the rate(s) correspond to pattern ("Crab").
Parameters:
Returns: bool
isShark(rate_edc, rate_dcb, rate_cba, rate_eda, margin_of_error) Check if the rate(s) correspond to pattern ("Shark").
Parameters:
Returns: bool
is5o(rate_edc, rate_dcb, rate_cba, rate_eda, margin_of_error) Check if the rate(s) correspond to pattern ("5o").
Parameters:
Returns: bool
isWolfe(rate_edc, rate_dcb, rate_cba, rate_eda, margin_of_error) Check if the rate(s) correspond to pattern ("Wolfe").
Parameters:
Returns: bool
is3Driver(rate_edc, rate_dcb, rate_cba, rate_eda, margin_of_error) Check if the rate(s) correspond to pattern ("3 Driver").
Parameters:
Returns: bool
isConTria(rate_edc, rate_dcb, rate_cba, rate_eda, margin_of_error) Check if the rate(s) correspond to pattern ("Contracting Triangle").
Parameters:
Returns: bool
isExpTria(rate_edc, rate_dcb, rate_cba, rate_eda, margin_of_error) Check if the rate(s) correspond to pattern ("Expanding Triangle").
Parameters:
Returns: bool
isHnS(rate_fed, rate_feb, rate_edc, rate_dcb, rate_cba, rate_eda, margin_of_error) Check if the rate(s) correspond to pattern ("Head and Shoulders").
Parameters:
Returns: bool
Functions to detect/check harmonic patterns from provided values.
line_price_rate(point_c, point_b, point_a) Compute the price rate of the line AB divided by the the line BC
Parameters:
- point_c: float, the price at point C.
- point_b: float, the price at point B.
- point_a: float, the price at point A.
Returns: float
line_time_rate(_c, _b, _a) Compute the time rate of the line AB divided by the the line BC
Parameters:
- _c: float, the time or bar_index at point C.
- _b: float, the time or bar_index at point B.
- _a: float, the time or bar_index at point A.
Returns: float
is_inrange(value, min, max) Check if value is within min/max range of tolerance.
Parameters:
- value: float, value to check tolerance.
- min: float, minimum value in range of tolerance.
- max: float, maximum value in range of tolerance.
Returns: bool
isHarmonicTriangle(rate_cba, margin_of_error) Check if the rate(s) correspond to pattern ("Harmonic Triangle").
Parameters:
- rate_cba: float, percent rate of the triangle CBA. expects a negative rate.
- margin_of_error: float, percent rate of expected error margin, default 0.05(5%).
Returns: bool
is2Tap(rate_cba, margin_of_error) Check if the rate(s) correspond to pattern ("2Tap", 'Double Top / Bottom').
Parameters:
- rate_cba: float, percent rate of the triangle CBA. expects a negative rate.
- margin_of_error: float, percent rate of expected error margin, default 0.05(5%).
Returns: bool
is3Tap(rate_edc, rate_cba, margin_of_error) Check if the rate(s) correspond to pattern ("3Tap", "Triple Top / Bottom").
Parameters:
- rate_edc: float, percent rate of the triangle EDC. expects a negative rate.
- rate_cba: float, percent rate of the triangle CBA. expects a negative rate.
- margin_of_error: float, percent rate of expected error margin, default 0.05(5%).
Returns: bool
is4Tap(rate_gfe, rate_edc, rate_cba, margin_of_error) Check if the rate(s) correspond to pattern ("4Tap", "Quadruple Top / Bottom").
Parameters:
- rate_gfe: float, percent rate of the triangle GFE. expects a negative rate.
- rate_edc: float, percent rate of the triangle EDC. expects a negative rate.
- rate_cba: float, percent rate of the triangle CBA. expects a negative rate.
- margin_of_error: float, percent rate of expected error margin, default 0.05(5%).
Returns: bool
isABCD(rate_cba, rate_dcb, margin_of_error) Check if the rate(s) correspond to pattern ("AB=CD").
Parameters:
- rate_cba: float, percent rate of the triangle CBA. expects a negative rate.
- rate_dcb: float, percent rate of the triangle DCB. expects a negative rate.
- margin_of_error: float, percent rate of expected error margin, default 0.05(5%).
Returns: bool
isBat(rate_edc, rate_dcb, rate_cba, rate_eda, margin_of_error) Check if the rate(s) correspond to pattern ("Bat").
Parameters:
- rate_edc: float, percent rate of the triangle EDC. expects a negative rate.
- rate_dcb: float, percent rate of the triangle DCB. expects a negative rate.
- rate_cba: float, percent rate of the triangle CBA. expects a negative rate.
- rate_eda: float, percent rate of the triangle EDA. expects a negative rate.
- margin_of_error: float, percent rate of expected error margin, default 0.05(5%).
Returns: bool
isButterfly(rate_edc, rate_dcb, rate_cba, rate_eda, margin_of_error) Check if the rate(s) correspond to pattern ("Butterfly").
Parameters:
- rate_edc: float, percent rate of the triangle EDC. expects a negative rate.
- rate_dcb: float, percent rate of the triangle DCB. expects a negative rate.
- rate_cba: float, percent rate of the triangle CBA. expects a negative rate.
- rate_eda: float, percent rate of the triangle EDA. expects a negative rate.
- margin_of_error: float, percent rate of expected error margin, default 0.05(5%).
Returns: bool
isGartley(rate_edc, rate_dcb, rate_cba, rate_eda, margin_of_error) Check if the rate(s) correspond to pattern ("Gartley").
Parameters:
- rate_edc: float, percent rate of the triangle EDC. expects a negative rate.
- rate_dcb: float, percent rate of the triangle DCB. expects a negative rate.
- rate_cba: float, percent rate of the triangle CBA. expects a negative rate.
- rate_eda: float, percent rate of the triangle EDA. expects a negative rate.
- margin_of_error: float, percent rate of expected error margin, default 0.05(5%).
Returns: bool
isCrab(rate_edc, rate_dcb, rate_cba, rate_eda, margin_of_error) Check if the rate(s) correspond to pattern ("Crab").
Parameters:
- rate_edc: float, percent rate of the triangle EDC. expects a negative rate.
- rate_dcb: float, percent rate of the triangle DCB. expects a negative rate.
- rate_cba: float, percent rate of the triangle CBA. expects a negative rate.
- rate_eda: float, percent rate of the triangle EDA. expects a negative rate.
- margin_of_error: float, percent rate of expected error margin, default 0.05(5%).
Returns: bool
isShark(rate_edc, rate_dcb, rate_cba, rate_eda, margin_of_error) Check if the rate(s) correspond to pattern ("Shark").
Parameters:
- rate_edc: float, percent rate of the triangle EDC. expects a negative rate.
- rate_dcb: float, percent rate of the triangle DCB. expects a negative rate.
- rate_cba: float, percent rate of the triangle CBA. expects a negative rate.
- rate_eda: float, percent rate of the triangle EDA. expects a negative rate.
- margin_of_error: float, percent rate of expected error margin, default 0.05(5%).
Returns: bool
is5o(rate_edc, rate_dcb, rate_cba, rate_eda, margin_of_error) Check if the rate(s) correspond to pattern ("5o").
Parameters:
- rate_edc: float, percent rate of the triangle EDC. expects a negative rate.
- rate_dcb: float, percent rate of the triangle DCB. expects a negative rate.
- rate_cba: float, percent rate of the triangle CBA. expects a negative rate.
- rate_eda: float, percent rate of the triangle EDA. expects a negative rate.
- margin_of_error: float, percent rate of expected error margin, default 0.05(5%).
Returns: bool
isWolfe(rate_edc, rate_dcb, rate_cba, rate_eda, margin_of_error) Check if the rate(s) correspond to pattern ("Wolfe").
Parameters:
- rate_edc: float, percent rate of the triangle EDC. expects a negative rate.
- rate_dcb: float, percent rate of the triangle DCB. expects a negative rate.
- rate_cba: float, percent rate of the triangle CBA. expects a negative rate.
- rate_eda: float, percent rate of the triangle EDA. expects a negative rate.
- margin_of_error: float, percent rate of expected error margin, default 0.05(5%).
Returns: bool
is3Driver(rate_edc, rate_dcb, rate_cba, rate_eda, margin_of_error) Check if the rate(s) correspond to pattern ("3 Driver").
Parameters:
- rate_edc: float, percent rate of the triangle EDC. expects a negative rate.
- rate_dcb: float, percent rate of the triangle DCB. expects a negative rate.
- rate_cba: float, percent rate of the triangle CBA. expects a negative rate.
- rate_eda: float, percent rate of the triangle EDA. expects a negative rate.
- margin_of_error: float, percent rate of expected error margin, default 0.05(5%).
Returns: bool
isConTria(rate_edc, rate_dcb, rate_cba, rate_eda, margin_of_error) Check if the rate(s) correspond to pattern ("Contracting Triangle").
Parameters:
- rate_edc: float, percent rate of the triangle EDC. expects a negative rate.
- rate_dcb: float, percent rate of the triangle DCB. expects a negative rate.
- rate_cba: float, percent rate of the triangle CBA. expects a negative rate.
- rate_eda: float, percent rate of the triangle EDA. expects a negative rate.
- margin_of_error: float, percent rate of expected error margin, default 0.05(5%).
Returns: bool
isExpTria(rate_edc, rate_dcb, rate_cba, rate_eda, margin_of_error) Check if the rate(s) correspond to pattern ("Expanding Triangle").
Parameters:
- rate_edc: float, percent rate of the triangle EDC. expects a negative rate.
- rate_dcb: float, percent rate of the triangle DCB. expects a negative rate.
- rate_cba: float, percent rate of the triangle CBA. expects a negative rate.
- rate_eda: float, percent rate of the triangle EDA. expects a negative rate.
- margin_of_error: float, percent rate of expected error margin, default 0.05(5%).
Returns: bool
isHnS(rate_fed, rate_feb, rate_edc, rate_dcb, rate_cba, rate_eda, margin_of_error) Check if the rate(s) correspond to pattern ("Head and Shoulders").
Parameters:
- rate_fed: float, percent rate of the triangle FED. expects a negative rate.
- rate_feb: float, percent rate of the triangle FEB. expects a negative rate.
- rate_edc: float, percent rate of the triangle EDC. expects a negative rate.
- rate_dcb: float, percent rate of the triangle DCB. expects a negative rate.
- rate_cba: float, percent rate of the triangle CBA. expects a negative rate.
- rate_eda: float, percent rate of the triangle EDA. expects a negative rate.
- margin_of_error: float, percent rate of expected error margin, default 0.05(5%).
Returns: bool
릴리즈 노트
added a extra calculation method for computing the margin of error of the rates, thanks to HeWhoMustNotBeNamed, CryptoArch_ for bringing it up 🙌this adds a extra optional parameter to all the functions, "calculation_type" can be either "additive" or "multiplicative"
릴리즈 노트
v3Added:
extract() Extract the available patterns from zigzag prices.
Returns: string array.
파인 라이브러리
트레이딩뷰의 진정한 정신에 따라, 작성자는 이 파인 코드를 오픈소스 라이브러리로 게시하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 경의를 표합니다! 이 라이브러리는 개인적으로 사용하거나 다른 오픈소스 게시물에서 사용할 수 있지만, 이 코드의 게시물 내 재사용은 하우스 룰에 따라 규제됩니다.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
파인 라이브러리
트레이딩뷰의 진정한 정신에 따라, 작성자는 이 파인 코드를 오픈소스 라이브러리로 게시하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 경의를 표합니다! 이 라이브러리는 개인적으로 사용하거나 다른 오픈소스 게시물에서 사용할 수 있지만, 이 코드의 게시물 내 재사용은 하우스 룰에 따라 규제됩니다.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
