×

Sign up and get MultiCharts free

Use its powerful simulation mode with data included out of the box. Just fill out the form and start honing your trading skills with a few clicks.

BarsSinceStartSession - MultiCharts
Open main menu

BarsSinceStartSession

Revision as of 10:50, 27 January 2012 by JoshM (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

With the BarsSinceStartSession function the number of bars since the start of the day will be returned.

Code

Variables:
	firstBarOfSession(0);
	
if (Date <> Date[1]) then begin

	firstBarOfSession = CurrentBar;

end;

BarsSinceStartSession = (CurrentBar - firstBarOfSession + 1);

Usage

Print(GetSymbolName, "  -  ", BarsSinceStartSession);

returns:

6E  -  238.00