SimpleCryptoLife

CandleEvaluation

SimpleCryptoLife 업데이트됨   
Library "CandleEvaluation"
Contains functions to evaluate bullish and bearish, engulfing, and outsized candles. They are different from the built-in indicators from TradingView in that these functions don't evaluate classical patterns composed of multiple candles, and they reflect my own understanding of what is "bullish" and bearish", "engulfing", and "outsized".

isBullishBearishCandle()
Determines if the current candle is bullish or bearish according to the length of the wicks and the open and close.
int _barsBack How many bars back is the candle you want to evaluate. By default this is 0, i.e., the current bar.
returns Two values, true or false, for whether it's a bullish or bearish candle respectively.

isTripleBull()
Tells you whether a candle is a "Triple Bull" - that is, one which is bullish in three ways:
  • It closes higher than it opens
  • It closes higher than the body of the previous candle
  • The High is above the High of the previous candle.
int _barsBack How many bars back is the candle you want to evaluate. By default this is 0, i.e., the current bar.
returns True or false.

isTripleBear()
Tells you whether a candle is a "Triple Bear" - that is, one which is bearish in three ways:
  • It closes lower than it opens
  • It closes lower than the body of the previous candle
  • The Low is below the Low of the previous candle.
int _barsBack How many bars back is the candle you want to evaluate. By default this is 0, i.e., the current bar.
returns True or false.

isBigBody()
Tells you if the current candle has a larger than average body size.
int _length - The length of the sma to calculate the average
float _percent - The percentage of the average that the candle body has to be to count as "big". E.g. 100 means it has to be just larger than the average, 200 means it has to be twice as large.
returns True or false

isBullishEngulfing()
Tells you if the current candle is a bullish engulfing candle.
int _barsBack How many bars back is the candle you want to evaluate. By default this is 0, i.e., the current bar.
int _atrFraction The denominator for the ATR fraction, which is the small amount by which the open can be different from the previous close.
returns True or false

isBearishEngulfing()
Tells you if the current candle is a bearish engulfing candle.
int _barsBack How many bars back is the candle you want to evaluate. By default this is 0, i.e., the current bar.
int _atrFraction The denominator for the ATR fraction, which is the small amount by which the open can be different from the previous close.
returns True or false
릴리즈 노트:
v2
Added alert conditions. Note that these are demo only, to show how such alerts would be implemented in your own script. As far as I know, you can't set alerts from libraries.
릴리즈 노트:
v3

Added:
New function: f_wickSize() - A function to get the average size of upper and lower wicks over time. This can be more useful than the standard ATR in evaluating the spikiness of an asset or in calculating stops.
f_wickSize(_open, _high, _low, _close, _ohlc4, _length, _length2)
  Parameters:
    _open - The Open of the candle. Defaults to the Open on the chart timeframe. Included for HTF compatibility.
    _high - The High of the candle. Defaults to the High on the chart timeframe. Included for HTF compatibility.
    _low - The Low of the candle. Defaults to the Low on the chart timeframe. Included for HTF compatibility.
    _close - The Close of the candle. Defaults to the Close on the chart timeframe. Included for HTF compatibility.
    _ohlc4 - The OHLC4 of the candle. Defaults to the OHLC4 on the chart timeframe. Included for HTF compatibility.
    _length - The length for the RMA of wicks.
    _length2 - The length for the EMA of OHLC4.
Returns - Two floats for the absolute values of the average upper and lower candle wicks.
릴리즈 노트:
v4
Fixed bug with history operator

파인 라이브러리

트레이딩뷰 정신에 따라 오써는 이 파인 코드를 오픈 소스 라이브러리로 퍼블리쉬하여 당사 커뮤니티의 다른 파인 프로그래머들이 쓸 수 있도록 하였습니다. 오써에게 찬사를! 여러분은 이 라이브러리를 프라이빗 또는 오픈 소스 퍼블리케이션에 쓸 수 있지만 퍼블리케이션에 재사용은 하우스룰을 따릅니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

이 라이브러리를 쓰시겠습니까?

텍스트를 클립보드에 카피한 뒤 님의 스크립트에 붙여 넣기.