A short question please to the platform experts about initial values of build-in variables:
Wenn coding lines like
condition=close < close[1]
and the code line is evaluated at barindex=0, which value does the variable close[1] ( or say all close[n] for n>0 ) assume?
For example, is this always reliably set equal to close[0], or to undefined, or can it be an arbitrary value depending on platform memory varying conditions?
From the answer, it should become clear which value the variable condition would assume at barindex=0?
Likewise, do other build-in variables have a predefined behaviour when attempting to call previous data at barindex=0?
Thank you.
Probuilder always preloads 500+ bars, so it’s just the prior closing price.
Only post in the language of the forumthat you are posting in. For example English only in the English speaking forums and French only in the French speaking forums.
I moved it from the German forum.
Thanks 🙂
Sorry I do not understand the techncial answer: How many bars are preloaded is defined by the PRELOADBARS statement, which allows varying data. It can be zero or something else. And PRELOADBARS work in trade systems only, not indicators.
So my question is yet open.
And sorry to have picked the wrong language forum, I’m definitely aware about the matter, was just my mistake, so thanks for the correction.
It is my understanding that the default Preloadbars is 2000 (without us needing to specify).
We can code Defparam PreLoadBars = 10000 (10000 is the maximum).
Hope this helps?
No, ProBuilder preloads a fixed number of bars, which can’t be set by the user (differently from strategies, which can set preloaded bars from 0 to 10K).
As you can see from the attached pic, on a 25-unit chart, the first barindex for bar 0 is actually 500.
Simply create this indicator:
RETURN BarIndex AS "BarIndex info"