Index of first visible Bar

Post Reply
Oije
Posts: 6
Joined: 18 Feb 2018 11:16

Index of first visible Bar

Post by Oije » 03 Jul 2019 21:32

Is there a way to get the index of the first visible bar of a chart?

WHS Support
Posts: 2252
Joined: 14 Feb 2013 10:27

Re: Index of first visible Bar

Post by WHS Support » 04 Jul 2019 16:18

Hello,

you can query the index of each bar via the Express "index" functions:
"Firstbar()"
"Finalbar()"
"Currentbarindex()"

The first bar on the left has the index=0. The last (current) bar has the index=finalbarindex(). You can find further information in the Express functions manual:
https://de.l1.fipertec.com/NanoTrader/W ... ctions.pdf

Kind regards,
Timo
WH SELFINVEST

Oije
Posts: 6
Joined: 18 Feb 2018 11:16

Re: Index of first visible Bar

Post by Oije » 04 Jul 2019 17:48

Hi Timo,

I am aware of the functions FirstBar(), FinalBar() and CurrentBarIndex() ...

I am asking for the first VISIBLE Bar of a chart, because being able to zoom into a chart, indicates that the first visible bar can be different from the very first bar of chart with the (= barindex 0)

This question could be extended further: What is the last visible bar ??

I studied the manuals and I can't find a proper function.

Maybe function like FristVisibleBar() and LastVisibleBar() or a Series Visible would be a nice improvement for the Express language and I guess it would not be that hard, because somewhere in the code the Programm has to decide which data have to be drawn on the screen or not.


Best regards
Oije

WHS Support
Posts: 2252
Joined: 14 Feb 2013 10:27

Re: Index of first visible Bar

Post by WHS Support » 08 Jul 2019 19:05

Hello,

unfortunately it is not possible to get the chart data based on the "Zoom" factor. So basically the Zoom factor cannot be an anchor point at the moment to get the bar index from there.
Although I am not 100% sure what would be the practical use of such a function I will forward the request to the developers for (potential) future improvements.

Kind regards,
Timo
WH SELFINVEST

Oije
Posts: 6
Joined: 18 Feb 2018 11:16

Re: Index of first visible Bar

Post by Oije » 12 Jul 2019 23:13

Hi Timo,

One practical use of having the index of the first Visible Bar:

I want to identify the actual trend and for that reason, I am looking for important highs and lows.

The youngest extreme high/or low the first anchor point, often this point is not enough far away from the latest bar, so we have to anchor at the next extreme in the past. The calculation shall start from the first or second anchor point, all other data before these points were no longer important.

Actually, I can solve this with a lot of for next loops. Not being able to create functions inside Express produces a very long script.

Being able to make a visual decision could save a lot of calculations because they don't have to start from the very first bar every time, they would start with the very first visible bar.

Anyway, I got an idea for a workaround which is a bit bumpy

Best Regards
Oije

Post Reply

Return to “WHS NANOTRADER - EXPRESS PROGRAMMING”