How can I use bar start time?

Questions about MultiCharts and user contributed studies.
2haerim
Posts: 502
Joined: 01 Sep 2006
Been thanked: 2 times

How can I use bar start time?

Postby 2haerim » 09 Dec 2008

We know that time and time_s give the bar end time.

However is there a way or keyword to know the bar start time?

For example, in 5 min chart's, time would give 0905, 0910, ...

I want to use bar start time somehow.

Is this possible?

If so, I would do things like:

if barstarttime >=0930 then ....

HR

SUPER
Posts: 646
Joined: 03 Mar 2007
Has thanked: 106 times
Been thanked: 84 times

Postby SUPER » 09 Dec 2008

"SessionFirstBarTime" function will it help?

User avatar
Januson
Posts: 119
Joined: 18 Apr 2007
Location: Denmark

Postby Januson » 09 Dec 2008

You could use an approximation with time_s[1]

2haerim
Posts: 502
Joined: 01 Sep 2006
Been thanked: 2 times

Postby 2haerim » 09 Dec 2008

SessionBarFirstTime is only for the first bar of the day, isnt' it?

brodnicki steven
Posts: 407
Joined: 01 Jan 2008
Been thanked: 3 times

Postby brodnicki steven » 09 Dec 2008

"We know that time and time_s give the bar end time. "

* Couldn't you just subtract the bar interval time from the time or time_s ? (for minute bars)

rsi77
Posts: 11
Joined: 03 Dec 2008
Location: Chicago

Postby rsi77 » 09 Dec 2008

You could also try

IF BarStatus(1)=0 AND Time>=930 THEN...

BarStatus = 0 means that you are processing the very first tick of a new bar, so if you then check the time you will know the time at the start of the bar.

2haerim
Posts: 502
Joined: 01 Sep 2006
Been thanked: 2 times

Postby 2haerim » 09 Dec 2008

Thanks for all the kind replies.

BTW, I wonder if the answers all work within a signal with or without IOG enabled?


Return to “MultiCharts”