Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
@ redratsal is correct, you can access the session end that belongs to the current bar via the NinjaScript method GetNextBeginEnd(). This methods basically uses the time stamp of the current bar and then selects the approriate session from the selected session template and returns begin and end time of that session.
There is nothing like a Session ID. The whole concept of sessions can still be improved by specifying which is the first session of the trading day. There is no such field that can be entered into the master data of NinjaTrader, I have seen that for other software packages though.
When i was programming i was used to the concept of collection or list that Microsoft uses extensively in all his software. I always thought it was a good idea as it facilitates the coding of an application.
For example, you can think about indicators on a chart as a collection, Bars on a chart as another collection, Session might be another collection which might contain x item(s) etc. When you think in terms of list or collection then you can think about a common way to access any particular item.
To achieve this level of sophistication, you need to define an object model which makes sense. I have not been able to find one public object model for Ninja that is available for viewing anywhere.
I suppose I could define sessions and go this route, but it could be simpler (possibly). For ES for example, I'd like to know what the countdown timer is for--I'd like to be able maybe put in a text file the strings for each instrument like:
5:30 | Maintenance period begins in ...
6:00 | Market reopens from maintenance period in ...
I think this is what you want, but it would be nice to have these times user defined so that each user can choose the times for a particular instrument, such as grains etc.....
Could someone tweak the code to allow user defined sessions?