HowTo: Get index of the most right visible bar on chart

 
Hi,
Is it possible to get the index of the bar at the right of current chart visible area?
I mean, if I scrolled data back to history, the index of the bar on the right of the visible chart area is not 0, and I don't know how to retrieve it.

I Hope that someone has an idea.
Thanks
ruby
 
Found It:

bar index of first visible bar from left:
int firstVisibleBar = FirstVisibleBar(); (Slawa - this one is not documented!)

bars per window:
int barsPerWindow = BarsPerWindow();
Reason: