• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

PriorDayOHLC and prices

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

    PriorDayOHLC and prices

    Hello,

    I'd like to get the value, for example, of the NQ or ES at 4:00pm EST yesterday, and compare it to the value at the open 9:30am EST this morning. I know using the PriorDayOHLC will return values from different times than the ones I'd like.

    I suppose I could compare the open[0] to close[900] or how many ever bars ago, but I'm sure that's an inefficient way of doing it. Is there a simpler way of doing it? Thank you for your help!

    #2
    Hello VV Cephei,

    Thank you for your note.

    Since, 4:00 PM is the first bar of the session you could use -
    Code:
    if(Bars.FirstBarOfSession)
    double openPrice = Close[0];
    You can than take openPrice and compare it to Open[0] at 9:30 AM

    http://www.ninjatrader.com/support/h...rofsession.htm

    Let me know if I can be of further assistance.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Hi there, thanks for your help.

      I'm still having some problems, so I attached sample so you could see if I'm on the right track:

      if (Bars.FirstBarOfSession == true)
      {
      double PrevDayClose = Close[0];
      }

      // condition
      if (Open[0] - PrevDayClose > 5 && ToTime(Time[0]) == ToTime(9, 30, 0))
      {
      EnterLong(DefaultQuantity, "");
      }

      I"m getting the message that 'close' and 'prevdayclose' do not exist in this context.

      Comment


        #4
        You can apply a session template to your chart which isolates the regular session within the full session. This allows you to catch the regular open (open of the first bar of the session) and the regular close (close of the last bar of the session). It is better to use the settlement price instead of the regular close. The settelement price can only be taken from daily data, if supplied by your data provider.

        The chart below catches the settlement price from daily Kinetick data and compares it to the open of today's session. The difference is displayed as gap. The gap remains on the chart until it is closed durgin the regular session.

        Today's new gap was insignificant, as today's regular open (4324.50) was only 1 tick below yesterday's settlement price (4324.75). However, there were two open gaps on the chart from February 12 and March 12. Both were closed during the first 3 hours of the regular session.
        Attached Files

        Comment


          #5
          Thanks Harry for the idea as well as posting that chart.

          I was wondering if someone could help or clear something up for me with the suggestion that Harry made.

          I tried to create a template by going to tools>session manager then I try to change it from the 24/7 default setting. I put it to US Equities RTH. But what's strange is that when I go back into Tools>Session Manager I see that 24/7 default is selected. And it doesn't seem to matter if I change it back or not, each time I go back to session manager it appears that my selection doesn't stay for some reason. I even made my own template and saved it under a name, but when I select it the same thing happens. Once I come back in, the default 24/7 appears to be selected.

          Comment


            #6
            Originally posted by VV Cephei View Post
            Thanks Harry for the idea as well as posting that chart.

            I was wondering if someone could help or clear something up for me with the suggestion that Harry made.

            I tried to create a template by going to tools>session manager then I try to change it from the 24/7 default setting. I put it to US Equities RTH. But what's strange is that when I go back into Tools>Session Manager I see that 24/7 default is selected. And it doesn't seem to matter if I change it back or not, each time I go back to session manager it appears that my selection doesn't stay for some reason. I even made my own template and saved it under a name, but when I select it the same thing happens. Once I come back in, the default 24/7 appears to be selected.
            You do not select session templates within the session manager. The session manager is only used to build and store session templates.

            You select the session template when you open a new chart or for existing charts under DataSeries settings. Please be aware that any chart template that you select overrides the session template settings.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by manueldecastro, Today, 12:57 AM
            0 responses
            5 views
            0 likes
            Last Post manueldecastro  
            Started by JulieG, Today, 12:40 AM
            0 responses
            5 views
            0 likes
            Last Post JulieG
            by JulieG
             
            Started by jimjoe123, Yesterday, 09:28 PM
            2 responses
            14 views
            0 likes
            Last Post NinjaTrader_ChrisSch  
            Started by 12VMan, 08-20-2019, 09:29 AM
            2 responses
            27 views
            0 likes
            Last Post Lancer
            by Lancer
             
            Started by tgn55, Yesterday, 09:50 PM
            0 responses
            5 views
            0 likes
            Last Post tgn55
            by tgn55
             
            Working...
            X