Summary of problems with CurrentBar
- people tends to think it is a Bar object, but in reality it is integer with bar-number
- word "current" does not expresses clearly, that it simply always is the "last" bar in dataseries.
- word "current" is misleading, because is often not very "current" from perspective of current-present-time (as DateTime.Now). The last daily bar can be very old from perspective of current-time - it can be for example 21 hours old. Referencing this
with notion of "current" bar is not the most happy. But referencing it as "last" bar
is very exact and clear in every case.
The ratio behind the idea:
We all see (visually in 1D space )the "bar series on chart" as series of individual bars ordered by time.
The first bar in this series is the left-most bar.
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
The last bar in this series is the right-most bar.
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
The sense of ordinal dimensionality is better expressed in dimensional words "first" bar / "last" bar, compared to the "current" bar, which is used now. The natural intuitiion of these words is better, because we all imagine bars in horizontal 1D space.
I would say it is more logical and easier to tell users - this is the "last" bar - and everybody understands which one it is = the really last one in the series.
Otherwise, I explain to my friends - you know, the "CurrentBar" really means the "last" bar in the dataseries.
And I have to also add - you know, it is called "CurrentBar", but in reality, it is not a "Bar" object. It is just the bar-number of the "last" bar. This is often their best moment, when they get the simple idea.
When we have to explain and "translate" such a basic and fundamental name into something more easily understandable, something is not OK about naming of this property.
To prevent this misunderstandings and explanation what "CurrentBar" really means, I would prefer very clear and exact name.
Lets replace CurrentBar -> for clear LastBarNumber.
Benefits of better name LastBarNumber:
- it is clear, that is is number and not a Bar object
- it is clear, that is is bar-number (as and opposite to bar-index)
- it is clear for everyone, that it is the last one (and logically rightmost) bar they have on chart.
- They don't need to mentally evaluate the word "current". It is really not important
to them, if it is current or not current. They simply want the last bar, that's all.
Generally, it is easier, simpler and more intuitive to think in ordinal dimension - first / last bar,
than to think from time-perspective - current / oldest bar.
Example from C#
The logic is the same as in C# List LINQ extensions - there is a First element and the Last element.
When there would be something like Current element - then API users would have many questions (as they have now with CurrentBar), what does it really mean?
And we would explain: Dear users, it is so easy - think about Current element is the "Last" element. It is completely the same.


Comment