How to calculate the bars numbers since specific date?
Author: lookingbackon
Creation Date: 12/16/2015 5:12 AM
profile picture

lookingbackon

#1
Hello,
I tried to get the bars number since a specific date with the below code. But the problem is that the outcome of the bars number keeps same if I input e.g.:20150101or 20150510. It seems the calculation only start from the first bar of a certain year no matter what any other date is specified. Coule you help to check what's the matter with it?
Thanks

CODE:
Please log in to see this code.
profile picture

Cone

#2
Sorry, that's a mistake in the QuickRef

Use String format = "yyyyMMdd";
Not String format = "yyyymmdd";

Also available: WealthScript function DateTimeToBar (see QuickRef)
profile picture

Eugene

#3
We'll fix this QuickRef error in a future version.
profile picture

lookingbackon

#4
Thanks, it works now.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).