Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Converting dates to integers Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
Weappa
Posted : Friday, July 29, 2011 8:47:21 AM
Registered User
Joined: 10/12/2007
Posts: 23
I am working on an indicator that requires the difference in the number of market days between a set date (say July 1, 2011) and the current date.  I'm stuck on how to convert the days to integers.  Any help?
Bruce_L
Posted : Friday, July 29, 2011 8:52:05 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
'|******************************************************************
'|*** StockFinder RealCode Indicator - Version 5.1 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Indicator:Offset from Date
'|******************************************************************
'# BasisDate = UserInput.Date = "7/1/2011"
'# Cumulative
Static BasisIndex As Single
If isFirstBar Then
    BasisIndex = Price.IndexForDate(BasisDate)
End If
Plot = CurrentIndex - BasisIndex

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Weappa
Posted : Friday, July 29, 2011 9:18:56 AM
Registered User
Joined: 10/12/2007
Posts: 23
Bruce - thanks for the quick response.  Works like a champ!
Bruce_L
Posted : Friday, July 29, 2011 9:28:00 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
You're welcome.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.