Count Number of Bars Since a start date set from Range menu

Hello guys,

I am using the following code to index the days since a specific date:

indexDate= BarsSince( DateTime() <= _DT("2023-07-01") );

However, I want to use as a start date the range I manually set from the following menu:
image

Alternatively, I can also use preset range (start/end) date as a function from formula editor.

One of the two solution would save me time because otherwise If I use the current solution I would need to change range from the menu and the date from editor.

Thank you :slight_smile:

1 Like

You may use

indexDate = Cum( Status("barinrange" ) );

See the manual
https://www.amibroker.com/f?status

3 Likes