Manual System - need input and suggestions

So a mathematical law was recently brought to my attention called “Bayes Law”.

Bayes Law:
Basically a statistical probability calculation based on a set of predefined variables (or historical data) which calculates the statistical probability of event A when event B is true.

The reason I’m interested in this calculation:

I want to study when a candle is X pips in size, what is the probability that it will make it to Y pips in size.

For instance, When I look at the 1hr time frame, I want to know what the probability of a candle that is 25 pips in size will make it to 30 pips in size. I would like someone with indicator coding expertise to create an indicator that can do these calculations for me. I believe I have figured out how to do the math (see below), I just need it to be incorporated in an indicator format. What this will allow any user to do is determine when to enter the market and how may pips to take with high probability. I feel this tool could be useful for both scalping and longer term trades. Could someone please review the information below and let me know how possible this idea is. I think there is some huge potential but I lack the coding knowledge to test it.

My concept that needs to be applied to MT4 coding:

Bayes Law Equation:
P(A|B) = P(B|A)*P(A) / P(B)

Definitions:
P(A|B) = the probability of A, if B is true
P(B|A) = the probability of B, given A is true
P(A) = the probability of A, or how often does A occur?
P(B) = the probability of B, or how often does B occur?

User input Parameters:
Number of candles
Study candle range
Target pip profit

Formula:

Count number of candles within “number of candles” whos range is equal to or greater than “study candle range” parameter. Return a number that defines A. Then compute A/“number of candles”. This solution defines P(A).

Count number of candles within “number of candles” whos range is equal to or greater than “study candle range” + “target pip profit”. Return a number that defines B. Then compute B/“number of candles”. This solution defines P(B).

Then compute P(B)/P(A). This solution defines P(B|A).

Then compute P(B|A)*P(A)/P(B). This solution defines P(A|B).

Then display results on the chart.

Items to display on the chart:
“Number of Candles”
“Study Candle Range”
“Target Pip Profit”
“P(A|B)”

Thanks in advance for everyone’s input.

sounds interesting, can you do any manual backtest and see if this would actually work though? I have SOME programming experience and might be able to do this but would rather not waste time if we can figure out its not useful before i try to code it :stuck_out_tongue:

I’m not that all experience with backtesting. Maybe someone else could find a way to backtest this system but there are still more aspects of the system I would like to incorporate before I say that it is a full system.

On top of having that indicator coded, I would like an additiontional information to display what the average upper and lower wicks of candles are. This would make us use a number that was greater than both wick averages to prevent reversals from causing issues. While the system basically takes this into account as is, I think it is better to have too much information than too little.

On top of that we could even take the above formula and use it to determine probabilites of certain wick sizes.

I look forward to everyone’s continued efforts in making my vision a reality.

Best regards