Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

End of day - intraday indicators

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    End of day - intraday indicators

    Hi
    I am a new ADD-ON partner (www.elitetrader.com.br).
    I am developing a series of new indicators all based on range and are initialized every beginning of a new trading day.
    I would like to know when the trading day ends ???? (eg ES) because sometimes the day ends at 20:15, 19:15 and 18:15.
    Thank you for your attention

    #2
    Hello,

    Thank you for the inquiry.

    You can find the Session Template for each instrument using the Instrument manager, and then reference that in the Session manager to see the trading hours. Here are the steps for the ES:

    Click Tools -> Instrument Manager
    In the text box Name type ES and click Search
    double click the ES future
    look for Session Template, the default for ES is listed as "CME US Index Futures ETH"
    Click Cancel
    Click Cancel
    Click Tools -> Session Manager
    Click the drop down and look for the session name and select it.

    This will show the session hours that will be used when you select <Use instrument settings> for the session template.

    Please let me know if I may be of additional assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thanks Jesse for your quick reply.
      I need to access the "end of trading sessions time" in ninjascript, because the indicator is re-started at the beginning of trading session.
      I'm manually configuring the "end of days" but as I want to use in all assets the system has to be set automatically as equal to NinjaTrader plots the vertical grid lines.
      Basically I want to access the id (index) which are plotted on the vertical grid lines NinjaTrader.
      Example code:
      Code:
      			if (CurrentBar == 0)
      			{
      				Maxima[0] = High[0];
      				Minima[0] = Low[0];
      //				FirstTradeOfDay = 1;
      			}
      			else
      			{
      				if ((ToTime(Time[0]) >= 181500 &&
      					ToTime(Time[1]) <= 181500) ||
      					(Math.Abs(Close[0] - Close[1]) > 4*TamanhoRange && //gap que identifica fim do dia
      					ToDay(Time[1]) != ToDay(Time[0])))
      				{
      					Maxima[0] = High[0];
      					Minima[0] = Low[0];
      //					FirstTradeOfDay = 1;
      				}
      				else
      				{
      					Maxima[0] = Math.Max(Maxima[1],High[0]);
      					Minima[0] = Math.Min(Minima[1],Low[0]);
      					if (Maxima[0] > Maxima[1])
      					{
      						UltimoMovIntraday = 1;
      					}
      					else if (Minima[0] < Minima[1])
      					{
      						UltimoMovIntraday = -1;
      					}
      						
      				}
      			}
      In the figures you can see how it should be:
      F - correct indicator is booting;
      E - correct, "End of Day" is the 18:15
      D - not right "End of Day" is the 19:15
      C - not correct, the indicator is starting before the "End of Day"
      A - not right "End of Day" is the 20:15
      B - not correct, the indicator is starting before the "End of Day"

      Thanks for listening
      Attached Files

      Comment


        #4
        Hello,

        For accessing the session times, you could look into using this:


        GetNextBeginEnd gets the Start and End of the session as DateTime object which can be compared against Time[0] for any needs.

        In the example shown in the help guide, this would apply to the current session of the instrument so as long as the session hours for that instrument are what you need, this should return the correct values you need.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Thank you Jesse

          Great

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by PaulMohn, Today, 05:00 AM
          0 responses
          8 views
          0 likes
          Last Post PaulMohn  
          Started by ZenCortexAuCost, Today, 04:24 AM
          0 responses
          6 views
          0 likes
          Last Post ZenCortexAuCost  
          Started by ZenCortexAuCost, Today, 04:22 AM
          0 responses
          3 views
          0 likes
          Last Post ZenCortexAuCost  
          Started by SantoshXX, Today, 03:09 AM
          0 responses
          16 views
          0 likes
          Last Post SantoshXX  
          Started by DanielTynera, Today, 01:14 AM
          0 responses
          5 views
          0 likes
          Last Post DanielTynera  
          Working...
          X