OPEN-SOURCE SCRIPT

Probability of Candle Close Higher Than Open

The "Probability of Candle Close Higher Than Open" indicator is designed to help traders assess the likelihood of a given candle closing higher than its open based on the previous candle's price action. It does this by calculating a probability score between 0 and 1 and displaying it on the chart, along with a horizontal line representing a user-defined probability threshold.

The indicator uses three input variables to determine the probability score:

lookback_period: This input defines the number of previous candles to consider when calculating the probability. By default, it is set to 2, meaning the indicator considers the previous two candles.

prev_high and prev_low: These variables are calculated using the highest() and lowest() functions, respectively, and represent the highest high and lowest low of the previous lookback_period candles.

prev_body: This variable calculates the absolute value of the difference between the open and close prices of the previous candle.

The probability score is then calculated based on the following conditions:

If the current candle's open price is higher than the previous lookback_period candles' highest high, the probability score is set to 0.1 (indicating a low probability of the candle closing higher than its open).

If the current candle's open price is lower than the previous lookback_period candles' lowest low, the probability score is set to 0.9 (indicating a high probability of the candle closing higher than its open).

If neither of the above conditions apply, the probability score is calculated using the following formula:

If the previous candle closed higher than its open, the probability score is set to 0.5 plus half of the previous candle's body (i.e., the absolute difference between its open and close prices).

If the previous candle closed lower than its open, the probability score is set to 0.1 plus half of the previous candle's body.

If the previous candle closed at the same price as its open, the probability score is set to 0.1.

Finally, the indicator plots the probability score as a label on the chart and a horizontal line representing the probability threshold.

Disclaimer:
Trading involves significant risk and is not suitable for all investors. The "Probability of Candle Close Higher Than Open" indicator is for informational purposes only and should not be used as the sole basis for making trading decisions. Always conduct your own research and due diligence before entering any trades. No guarantee or warranty is given as to the accuracy or completeness of the information provided by this indicator, and any reliance on this information is at your own risk. Past performance is not necessarily indicative of future results. Trading with margin carries the risk of losing more than your initial investment. Only trade with risk capital that you can afford to lose.
candleformationCandlestick analysisict

오픈 소스 스크립트

진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

차트에 이 스크립트를 사용하시겠습니까?


GH05T 1N TH3 MACH1N3
또한 다음에서도:

면책사항