BarsSinceStartSession

From MultiCharts
Revision as of 10:42, 27 January 2012 by JoshM (talk | contribs) (Created page with "With the BarsSinceStartSession function the number of bars since the start of the day will be returned. == Code == <syntaxhighlight> Variables: firstBarOfSession(0); if (...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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

if (LastBarOnChart_s = True) then
	Print(GetSymbolName, "  -  ", BarsSinceStartSession);

returns:

6E  -  23833.00