PureBytes Links
Trading Reference Links
|
This will get you the datenum at the 2 points, but you cannot subtract
datenums to get the number of days unless they happen to both be within the
same month, and also depends if you want to include weekends etc, the number
of bars, or the number of traded days between them
datenumathigh = ValueWhen( HHVBars( High,60) == H, DateNum() );
datenumatlow = ValueWhen( LLVBars( Low, 60 ) == L, DateNum() );
Might be best to use the barindex() instead of datenum() and get the number
of bars, but to get actual possible trading days is a different matter
unless you use padded data. You could use DayofYear() and work a little
routine in case they span different years, to get calendar days.
Cheers,
Graham
http://e-wire.net.au/~eb_kavan/
-----Original Message-----
From: mroman59 [mailto:mroman59@xxxxxxxxx]
Sent: Monday, 9 February 2004 11:25 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Help-conversion of price dates to number of days
Ok, I am trying to calculate the number of days that would be
between lets say a stocks most recnent high and its lowest low
within a given time period. So if a stocks hi was on 2/6/04 and the
low was on 1/23/03 then the number of days would be 10 trading days.
Then I want to create a vertical line that projects out a fib
retracement of lets say 100 or 200% which in my mine would be 10
days and 20 days.
To determing the number of days between the high and the low I was
using the following:
datenumathigh = ValueWhen( HHVBars( High,60) == 0, DateNum() ); datenumatlow
= ValueWhen( LLVBars( Low, 60 ) == 0, DateNum() );
to determinne the recent hi and low however this is not working
Any suggestions
Thanks
MR
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at:
http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Links
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|