Coding a new hour ?  [SOLVED]

Questions about MultiCharts and user contributed studies.
Automeq
Posts: 108
Joined: 16 Apr 2014
Has thanked: 15 times
Been thanked: 1 time

Coding a new hour ?

Postby Automeq » 23 May 2017

I'm stuck in a simple thing but I can't find what is it.

I have an indicator which detects a new day with:

Code: Select all

if date<>date[1] then begin
Now I would like something similar but for the hourly time frame.

I've tried

Code: Select all

if HoursFromDateTime(Time)<>HoursFromDateTime(Time)[1] then begin
But this is not working (in a 1 minute chart).

What's wrong here ?

Thanks

User avatar
rrams
Posts: 128
Joined: 10 Feb 2011
Location: USA
Has thanked: 7 times
Been thanked: 70 times
Contact:

Re: Coding a new hour ?  [SOLVED]

Postby rrams » 23 May 2017

It's probably a late hour which is causing you not to realize that HoursFromDateTime requires a DateTime not a Time.

Automeq
Posts: 108
Joined: 16 Apr 2014
Has thanked: 15 times
Been thanked: 1 time

Re: Coding a new hour ?

Postby Automeq » 23 May 2017

I hate it when a mistake is something is so obvious. Thanks a lot rrams.


Return to “MultiCharts”