I'm trying to create a simple indicator that would put a simple "*" over the 10:00am bar on a 15min chart. What function would I use to find that bar? I've attempted to use the sample for time but I get error hour not defined. Any help would be appreciated.
Thanks...Dave
Need some direction on time functions
-
- Posts: 8
- Joined: Tue Apr 15, 2008 4:31 pm
- Location: Sacramento CA
- Terranin
- Site Admin
- Posts: 833
- Joined: Sat Oct 21, 2006 4:39 pm
Re: Need some direction on time functions
patronus wrote:I'm trying to create a simple indicator that would put a simple "*" over the 10:00am bar on a 15min chart. What function would I use to find that bar? I've attempted to use the sample for time but I get error hour not defined. Any help would be appreciated.
Thanks...Dave
To use date functions you should include DateTimeUtils unit for Delphi. For C++ I am not very familiar with its libraries.
So for Delphi it will look like:
Code: Select all
if (HourOf(Time(index)) = 10) and (MinuteOf(Time(index)) = 0) then
buff[index] := High(index)
else
buff[index] ;= 0;
Hasta la vista
Mike
Mike
- Tantalus
- Posts: 302
- Joined: Fri Mar 23, 2007 3:51 pm
- Contact:
Re: Need some direction on time functions
Terranin wrote:patronus wrote:I'm trying to create a simple indicator that would put a simple "*" over the 10:00am bar on a 15min chart. What function would I use to find that bar? I've attempted to use the sample for time but I get error hour not defined. Any help would be appreciated.
Thanks...Dave
To use date functions you should include DateTimeUtils unit for Delphi. For C++ I am not very familiar with its libraries.
So for Delphi it will look like:Code: Select all
if (HourOf(Time(index)) = 10) and (MinuteOf(Time(index)) = 0) then
buff[index] := High(index)
else
buff[index] ;= 0;
Mike, wouldn't that be:
Code: Select all
HourOf(Time[index])
where the index of the Time array is contained in square brackets, not parentheses?
Who is online
Users browsing this forum: No registered users and 17 guests