Hello,
There must be a current bar number property somewhere, but I can't find it in the docs. I had thought that the Bars.CurrentBar would be the solution, but it seems that is for something else (not entirely sure what though). When I used CurrentBar output in a simple Output.Writeln() it didn't start outputting anything for several bars.
What is the MC.net way of getting the current bar number?
With thanks,
MK
How to find the current bar number?
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: How to find the current bar number?
Bars.CurrentBar returns the current bar for me. From your description, it seems that the max bars setting (see ExecInfo.MaxBarsBack) prevented the printing of the output for the first few bars.I had thought that the Bars.CurrentBar would be the solution, but it seems that is for something else (not entirely sure what though). When I used CurrentBar output in a simple Output.Writeln() it didn't start outputting anything for several bars.
Also see this wiki article on MaxBarsBack for regular MC (works the same in MC .NET though).