NexusFi: Find Your Edge


Home Menu

 





Session begins / ends in X minutes indicator


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Fat Tails with 5 posts (2 thanks)
    2. looks_two redratsal with 4 posts (2 thanks)
    3. looks_3 trendisyourfriend with 3 posts (0 thanks)
    4. looks_4 josh with 2 posts (0 thanks)
    1. trending_up 7,984 views
    2. thumb_up 4 thanks given
    3. group 6 followers
    1. forum 15 posts
    2. attach_file 2 attachments




 
Search this Thread

Session begins / ends in X minutes indicator

  #11 (permalink)
 
redratsal's Avatar
 redratsal 
Milan (I)
 
Experience: Advanced
Platform: Ninjatrader
Broker: Kinetick
Trading: FDAX,6E,CL,YM,NQ,ES
Posts: 1,648 since Oct 2010
Thanks Given: 1,215
Thanks Received: 2,090


Fat Tails View Post
LOL. It automatically adjusts to the session templates, also to multiple sessions. If you use a bar timer, I could change the position on the chart, for example allow for 4 different positions to choose from.

Thanks I am fine you did more than needed

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
Cheap historycal L1 data for stocks
Stocks and ETFs
Trade idea based off three indicators.
Traders Hideout
Better Renko Gaps
The Elite Circle
ZombieSqueeze
Platforms and Indicators
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
  #12 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,103


trendisyourfriend View Post
I was wondering how Ninja knows when a session begins or ends. I know it parses the Session template record for a given symbol but how does it address a particular session if for example there are three sessions defined in the template ?

Do you have commands like ...

if application.session.id = 3 then
or
debug.print application.session.count

Is it that simple, or do you need to define your own function to get this information ?

Thanks

@ 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.

Reply With Quote
Thanked by:
  #13 (permalink)
 
trendisyourfriend's Avatar
 trendisyourfriend 
Quebec Canada
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AMP/CQG
Trading: ES, NQ, YM
Frequency: Daily
Duration: Minutes
Posts: 4,527 since Oct 2009
Thanks Given: 4,176
Thanks Received: 6,020



Fat Tails View Post
...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.

Ex.:

---
Ninja.Charts.Count
Ninja.Sessions.Count
Ninja.Bars.Count

Ninja.Charts[2].indicator[3]
Ninja.Sessions[2].item[3]
Ninja.Bars[101].High

Etc.


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.

Reply With Quote
  #14 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,103


trendisyourfriend View Post
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.

Ex.:

---
Ninja.Charts.Count
Ninja.Sessions.Count
Ninja.Bars.Count

Ninja.Charts[2].indicator[3]
Ninja.Sessions[2].item[3]
Ninja.Bars[101].High

Etc.


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.


You should better stick to NinjaScript and not try something else, otherwise your charts may slowly dissipate.

Reply With Quote
  #15 (permalink)
 
josh's Avatar
 josh 
Georgia, US
Legendary Market Wizard
 
Experience: None
Platform: SC
Broker: Denali+Rithmic
Trading: ES, NQ, YM
Posts: 6,246 since Jan 2011
Thanks Given: 6,784
Thanks Received: 18,257

Thanks for the good suggestions guys.

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 ...

and so on...

Started this thread Reply With Quote
  #16 (permalink)
 marker 
Las Vegas, NV
 
Experience: None
Platform: NinjaTrader
Broker: NinjaTrader Brokerage
Trading: CL
Posts: 102 since Jun 2010
Thanks Given: 115
Thanks Received: 105

Josh, I was looking around for the same countdown that you wanted, and came across this:
View Download Details - Big Mike's Trading Forum

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?

Thanks in advance!
-M

Reply With Quote




Last Updated on January 20, 2012


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts