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

Sessions

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

    Sessions

    Hello

    NT8
    I need filter data by session time. Will OnMarketData() trigger for data events outside selected Trading hours in Data series settings? As I can see answer is 'no'. Correct?

    #2
    Hello ren37,

    Thank you for your post.

    OnMarketData() can still trigger outside of the selected session template for the chart. This is because only OnBarUpdate() is restricted to the bars on the chart. OnMarketData() is fed by the market updates from your data feed provider.

    Comment


      #3
      Ty

      I checked and found that OnMarketData() triggers only inside session time.
      This data are from OnMarketData() stored in volume profiles with CME US Index RTH session template applied for data serie.
      Begin - is the first tick of session time
      End - is the last tick of session time

      PHP Code:
      Total1638178POC2160,25Begin/End30.09.2016 8:30:00-30.09.2016 15:14:59Range 2168,25-2150,5
      Total
      2111927POC2146Begin/End29.09.2016 8:30:00-29.09.2016 15:14:59Range 2165,75-2137,25 
      code, NT8 RC1

      PHP Code:
              protected override void OnMarketData(MarketDataEventArgs marketDataUpdate)
              {
                  if (
      marketDataUpdate.MarketDataType == MarketDataType.Last)
                  {
                      ...

                      
      //if (SessionIterator != null && SessionIterator.IsInSession(marketDataUpdate.Time, true, true))
                      
      {
                          
      profiles[0].AddVolume(marketDataUpdate.PricemarketDataUpdate.VolumemarketDataUpdate.Time);
                      }
                  }
              } 
      Last edited by ren37; 10-04-2016, 05:34 AM.

      Comment


        #4
        Can anybody advise?

        Comment


          #5
          Will anybody from Ninja support respond me?

          Comment


            #6
            Hello ren37,

            Thank you for your response.

            Where are your prints? Are they inside OnBarUpdate() or OnMarketData()?
            What are you attempting to achieve that started these tests?

            Comment


              #7
              Originally posted by NinjaTrader_PatrickH View Post
              Hello ren37,

              Thank you for your response.

              Where are your prints? Are they inside OnBarUpdate() or OnMarketData()?
              What are you attempting to achieve that started these tests?
              Patrick
              Yes, data collected inside OnMarketData().
              Actually this is not a test but some indicator with debug output.
              This shows that OnMarketData() triggers only inside session. And this is not what is in your answer on my first question.
              Last edited by ren37; 10-05-2016, 12:48 PM.

              Comment


                #8
                ren37,

                What session template (Trading Hours) is selected on the chart?

                Comment


                  #9
                  CME US Index RTH

                  Comment


                    #10
                    Thank you, ren37.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by cls71, Today, 04:45 AM
                    0 responses
                    1 view
                    0 likes
                    Last Post cls71
                    by cls71
                     
                    Started by mjairg, 07-20-2023, 11:57 PM
                    3 responses
                    213 views
                    1 like
                    Last Post PaulMohn  
                    Started by TheWhiteDragon, 01-21-2019, 12:44 PM
                    4 responses
                    544 views
                    0 likes
                    Last Post PaulMohn  
                    Started by GLFX005, Today, 03:23 AM
                    0 responses
                    3 views
                    0 likes
                    Last Post GLFX005
                    by GLFX005
                     
                    Started by XXtrader, Yesterday, 11:30 PM
                    2 responses
                    12 views
                    0 likes
                    Last Post XXtrader  
                    Working...
                    X