Issue with "Once Per Bar" alert

Alerts on indicators with a frequency different from Once Per Bar Close (which are Once, Once Per Minute, and Once Per Bar) can trigger during the bar building. Since HLC (High, Low, Close) changes during the bar building, the values of indicators that depend on HLC can also change. This leads to the fact that the time of execution of the triggering condition on the chart does not always coincide with the time of the actual alert triggering.

For example, let's consider 2 common cases:

  • the alert triggered, but the condition is not met on the chart
  • the alert triggered later than the condition was met on the chart
1) The alert triggered, but the condition is not met on the chart

The screenshots below show the change in HLC and RSI during the bar construction from 10:00 in replay mode. The first screenshot shows that at a certain point, the RSI value was below 30 (i.e. there was an intersection of level 30).

The second screenshot shows that at the moment of closing of this bar, the RSI value rose above 30 (i.e. there is no longer a crossing of level 30).

Thus, the alert with the condition RSI Crossing 30 would have been triggered during the process of constructing the bar from 10:00, although at the moment of the bar's closing, it may seem that it should not have been triggered.

2) The alert triggered later than the condition on the chart was met

The screenshots below show the change in HLC and BB Lower Band during the process of building the bar from 02:00 in the bar replay mode, as well as the level at which the Lower Band value and the bar wick intersect (68840, black dotted line).

The first screenshot shows that while building the bar, the Close value was below level 68840, and the indicator value was below the Close value, while the bar and indicator did not intersect at level 68840.

The second screenshot shows that at the moment of the bar closing, the Close rose above the level of 68840. The indicator value also increased, but since the Low value remained unchanged (it can only decrease during the bar building), the indicator and wick crossed at the level of 68840.

It is important to note that the crossing did not occur at the moment when the price dropped to the level of 68840 but at the moment when the indicator value rose to this level.

Thus, the alert with the condition BTCUSD Crossing BB LowerBand would have triggered during the building process precisely at the moment when both the price and the indicator value began to rise. However, after the bar closed, it may seem that the triggering should have occurred earlier (namely, at the moment when the price dropped to the level of 68840).