PROTECTED SOURCE SCRIPT
Bull/Bear Test v0.1 [Experimental/Conceptual]

For now, I shall assume that the script fulfills the idea that I have in my mind, but since I barely have any programming knowledge, it is likely that it does not.
I am not claiming any originality, it is just that I do not know if there is any indicator that meets this exact purpose. The coding was relatively easy, so here we are.
This is more like an experimental and conceptual study. It needs “cut-off” points to be efficient, like 38.2 and 61.8 Chop values.
So, the reasoning: We know that even during bear market, the number of red candles is larger than the number of green candles, thus any study used to determine whether it is a bull or bear market cannot rely on that. Instead, the “B/B test” focuses on how strong green/bull candles and red/bear candles are.
I think that every market is in any of the following three stages: Bull, Bear, Neutral. A Neutral Stage differs from a consolidation period. Simply looking at the chart does not tell you what stage the market is in. If you have the monthly BTC/USD chart in front of you, it is definitely a bear market. If it is the daily one, then it is controversial.
It sums every percentile change in last n green (red) candles, then divides it to n. This is shown by the Bull (Bear) Test. If the green line (the Bull Test line) is above the red line (the Bear Test line), that means that the Bull movement is stronger than the Bear movement in the last n periods.
Bull Test= Sum (Percentile change of green candles in last n periods) / n
Bear Test= Sum (Percentile change of red candles in last n periods) / n
Percentile change of a candle = (Close – Open) / Open
Relative Strength is obtained by dividing Bull Test to Bear Test, so yields a “clearer” study.
Relative Strength = Bull Test / Bear Test
In the same manner, Relative Strength’s being above 1.0 means that the bull attacks are stronger than the bear attacks in the last n periods.
Currently, there are two ways to use it:
1) Use Bull Test and Bear Test, but not Relative Study
2) Use Relative Study, but not Bull Test and Bear Test
A few things to consider:
1) As the use of Heiken-Ashi candles over ordinary candlesticks changes some of the candles’ colors, they yield relatively different results. I have back-tested some bear markets only with Heiken-Ashi.
2) For charts with ordinary candlesticks, as far as I can tell, a higher n number is better.
3) Due to the way Bull Test, Bear Test, and Relative Strength values are calculated, the same result of n x p (n: the number of candles, p: chart period [like 12h, 1d, 1w, etc.) yields different Bull Test, Bear Test, and Relative Strength values.
For instance: 10 bars on a 12h chart gives slightly different results than 5 bars on a 1d chart.
For the future, I am planning to add a derivative of Relative Study, so we can observe its change rate. Although I am not sure, I think that a crossover of the derivative on Relative Study might be used to determine if the market provably went parabolic.
I am not claiming any originality, it is just that I do not know if there is any indicator that meets this exact purpose. The coding was relatively easy, so here we are.
This is more like an experimental and conceptual study. It needs “cut-off” points to be efficient, like 38.2 and 61.8 Chop values.
So, the reasoning: We know that even during bear market, the number of red candles is larger than the number of green candles, thus any study used to determine whether it is a bull or bear market cannot rely on that. Instead, the “B/B test” focuses on how strong green/bull candles and red/bear candles are.
I think that every market is in any of the following three stages: Bull, Bear, Neutral. A Neutral Stage differs from a consolidation period. Simply looking at the chart does not tell you what stage the market is in. If you have the monthly BTC/USD chart in front of you, it is definitely a bear market. If it is the daily one, then it is controversial.
It sums every percentile change in last n green (red) candles, then divides it to n. This is shown by the Bull (Bear) Test. If the green line (the Bull Test line) is above the red line (the Bear Test line), that means that the Bull movement is stronger than the Bear movement in the last n periods.
Bull Test= Sum (Percentile change of green candles in last n periods) / n
Bear Test= Sum (Percentile change of red candles in last n periods) / n
Percentile change of a candle = (Close – Open) / Open
Relative Strength is obtained by dividing Bull Test to Bear Test, so yields a “clearer” study.
Relative Strength = Bull Test / Bear Test
In the same manner, Relative Strength’s being above 1.0 means that the bull attacks are stronger than the bear attacks in the last n periods.
Currently, there are two ways to use it:
1) Use Bull Test and Bear Test, but not Relative Study
2) Use Relative Study, but not Bull Test and Bear Test
A few things to consider:
1) As the use of Heiken-Ashi candles over ordinary candlesticks changes some of the candles’ colors, they yield relatively different results. I have back-tested some bear markets only with Heiken-Ashi.
2) For charts with ordinary candlesticks, as far as I can tell, a higher n number is better.
3) Due to the way Bull Test, Bear Test, and Relative Strength values are calculated, the same result of n x p (n: the number of candles, p: chart period [like 12h, 1d, 1w, etc.) yields different Bull Test, Bear Test, and Relative Strength values.
For instance: 10 bars on a 12h chart gives slightly different results than 5 bars on a 1d chart.
For the future, I am planning to add a derivative of Relative Study, so we can observe its change rate. Although I am not sure, I think that a crossover of the derivative on Relative Study might be used to determine if the market provably went parabolic.
Script protetto
Questo script è pubblicato come codice protetto. Tuttavia, è possibile utilizzarlo liberamente e senza alcuna limitazione – per saperne di più clicca qui.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script protetto
Questo script è pubblicato come codice protetto. Tuttavia, è possibile utilizzarlo liberamente e senza alcuna limitazione – per saperne di più clicca qui.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.