theDOGEguy1

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.

GH05T 1N TH3 MACH1N3
开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?