Daily Bar Number CFD
- Indicators
- Vincent Jose Proenca
- Version: 1.0
indicator that numbers the bars (candles) in a custom trading session.
The indicator allows:
-
Defining the session start time (StartHour and StartMinute)
-
Displaying numbers only on odd bars (if AfficherUniquementImpairs is true)
-
Displaying numbers on the last N days (NbJours)
-
Customizing the color and font size of the text
The indicator will loop through the bars of the last N days and, for each day, start counting from the session start time.
It will display the bar number (starting at 1) below the bar.
We are going to use the OnCalculate function for MT5.
Steps:
-
Clean up old labels at the beginning.
-
Determine the start time for the analysis (now - NbJours days).
-
For each day in the last NbJours days, set the session start time.
-
Loop through the bars (from the oldest to the newest) and for each bar that is within the session of that day, assign a number.
-
If AfficherUniquementImpairs is true, then only display odd numbers.
