I want to create a varible that would be used as length of average window
1
2
3
LengthWindow=round(average[20](close))
RetIndicator=average[LengthWindow](close)
returnRetIndicator
Such solution wouldnt work because LengthWindow is not defined for the first 20 numbers. The program will yield an error: A positive integer filed is expected with average
A first solution would be to fill the LengthWindow with any nunber for the first 20 elements and things will work
Anouar – Welcome to the forums. I moved your topic to the ProBuilder forum as the ‘Welcome New Members’ forum is not the place for it. Please try to post any future topics in the correct place.
Post your topic in the correct forum:
_ ProRealTime Platform Support: only platform related issues.
_ ProOrder: only strategy topics.
_ ProBuilder: only indicator topics.
_ ProScreener: only screener topics
_ General Discussion: any other topics.
_ Welcome New Members: for new forum members to introduce themselves.
Because the Historic Volatility indicator can return values below 0.5 and when any value below 0.5 is rounded this equals zero and zero is not a positive integer.
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue