assiParticipant
Senior
Hi,
I have easy question, I think…
I’m use to work with this function with two parameters: period, price.
I came across with few indicators that use “BarIndex”: STD[period](barindex)
What can I learn from that? for example, if the period is 12 and the barindex is 234.
thanks, assi
It will return the STD[12] of the 234th bar (233rd previous bar, being 0 the current one).
assiParticipant
Senior
thank you for the explanation, I still don’t underspend what I learn from that.
Do you mean that it’s return the STD for close at the first bar?
Yes, because BARINDEX is the number of bars elapsed, thus as an index it will bring you back to the first bar.
Your syntax is incorrect, if you want to get the 12 periods Standard Deviation, 234 bars ago, the syntax must be:
STD[period][offset]
The offset period is always in brackets:
STD[12][234]
And since BARINDEX is the bars quantity loaded since the start of the history, the offset is a difference between the current barindex and the candle you want to get the value from, not the real barindex number.
assiParticipant
Senior
OK.
I don’t know what the coder means in this syntax, I read the documentation and it’s only mention the period and price.
So now i’m confuse because the code for the offset was written was not in [] but in (): STD[period](barindex).
In this case, STD[12](barindex), what I will get and learn from that?
Sorry, but the coder means nothing with that line, he is wrong. What is the purpose of getting the standard deviation of the bars numbers?!
The order is: STD[period](applied price)[offset]
If you don’t specify the applied price, it is considered as Close by default (like it is for almost indicators instructions).
assiParticipant
Senior
Thank you for clarify that for me!!