Bull/bear days
Bull/bear days is defined by the local calculation documented below.
This entry has an incomplete verified explanation or executable case and is excluded from search indexing. Known definitions and missing inputs are distinguished below.
Purpose and construction
Bull/bear days is defined by the local calculation documented below.
Bull/bear days is applied to the chart series using the local definition below. Each period counts one bar on the active chart. The same period therefore covers a different amount of time on daily and intraday charts.
How to read it
Follow the intermediate calculations and final output definitions. Where external inputs are required, missing data is not a zero reading.
Confirm the inputs and settings before comparing the indicator with price. On an open bar, close, extremes and volume can still change, so the reading can update before the bar closes.
Parameters
| Parameter | Default |
|---|---|
N | 20 |
Parameter names match the variables in the calculation. After changing a lookback or smoothing period, recalculate on the same data to compare response speed. Defaults from another platform may not match this definition.
Actual application chart
This screenshot shows Bull/bear days running on the application's TSLA daily chart. Price and indicator share the same market history, preserving the curves, bars and markers drawn by the application.

Follow the intermediate calculations and final output definitions. Where external inputs are required, missing data is not a zero reading.
- Check the displayed indicator name and parameters against the version currently loaded.
- Align price and indicator by time, then compare direction, turning points and marker locations.
- After changing settings or timeframe, wait for calculation to finish before saving the same interval for comparison.
The screenshot records a historical chart display, not executed orders, returns or a win rate.
Local calculation
The local definition is shown below. Display labels can be translated; the case calculation uses original source identifiers. A shared indicator name does not guarantee identical calculations across platforms.
Z:=ZIG(C,N);
Series1:=Z>REF(Z,1) AND Z>REFX(Z,1);
Series2:=Z<REF(Z,1) AND Z<REFX(Z,1);
NG:=BARSLAST(Series1);
ND:=BARSLAST(Series2);
D0:=DATETODAY(DATE)-DATETODAY(REF(DATE,BARSSINCE(C)));
DG:=DATETODAY(DATE)-DATETODAY(REF(DATE,NG));
DD:=DATETODAY(DATE)-DATETODAY(REF(DATE,ND));
N1:=(NG>ND OR COUNT(Series1,0)=0) AND ND>0 AND (HHV(C,ND)-REF(C,ND))/REF(C,ND)>(N/100);
N2:=NG<ND AND NG>0 AND (LLV(C,NG)-REF(C,NG))/REF(C,NG)>=-(N/100);
N3:=NG<ND AND NG=0;
N4:=COUNT(Series2 OR Series1,0)=0 AND (HHV(C,0)-REF(C,BARSSINCE(C)))/REF(C,BARSSINCE(C))>(N/100);
N5:=COUNT(Series2,0)=0 AND NG>0 AND (LLV(C,NG)-REF(C,NG))/REF(C,NG)>=-(N/100);
N6:=COUNT(Series2,0)=0 AND NG=0;
X1:=(NG<ND OR COUNT(Series2,0)=0) AND NG>0 AND (LLV(C,NG)-REF(C,NG))/REF(C,NG)<-(N/100);
X2:=NG>ND AND ND>0 AND (HHV(C,ND)-REF(C,ND))/REF(C,ND)<=(N/100);
X3:=NG>ND AND ND=0;
X4:=COUNT(Series1 OR Series2,0)=0 AND (LLV(C,0)-REF(C,BARSSINCE(C)))/REF(C,BARSSINCE(C))<-(N/100);
X5:=COUNT(Series1,0)=0 AND ND>0 AND (HHV(C,ND)-REF(C,ND))/REF(C,ND)<=(N/100);
X6:=COUNT(Series1,0)=0 AND ND=0;
Series3:IF(N4 OR N5 OR N6,D0,IF(N1 OR N2 OR N3,DD,0)),COLORRED;
Series4:IF(X4 OR X5 OR X6,D0,IF(X1 OR X2 OR X3,DG,0)),COLORGREEN;Limitations
- Follow the intermediate calculations and final output definitions. Where external inputs are required, missing data is not a zero reading.
- Timeframe, adjustments, warm-up length and data units affect results. Align these before comparing charts.
- This formula uses historical backfilling or future references. Later bars can change earlier markers; a backfilled timestamp must not be treated as a signal available in real time.
Questions
Why can Bull/bear days differ across platforms?
Compare inputs, default periods, smoothing, offsets and data units before comparing the final value. This guide uses the local source definition rather than assuming that an external example has the same settings.
Does the example show a real trade?
No. Figures show the indicator running on historical market data in the application. They contain no executed orders and make no return or win-rate claim.
References
The calculation comes from the project’s indicator registry. Primary references below provide related conceptual reading. Figures are captured from the running application.