• 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

Level 2 question

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

    Level 2 question

    Hello

    How I can read "Pr Close" value from Level 2 to my code?



    Thanks

    #2
    Hello sergey_z,

    Thanks for opening the thread.

    If we look up more information on what Pr Close represents by looking up the Level 2 window documentation, we can see that Pr Close represents "Yesterdays sessions close price."

    You may use the PriorDayOHLC indicator to get this value, or you may use a SessionIterator to keep track of trading hours and store this value with your own code. The PriorDayOHLC indicator also provides example for using a SessionIterator.

    Level 2 window documentation - https://ninjatrader.com/support/help...eLevelIiWindow

    PriorDayOHLC syntax - https://ninjatrader.com/support/help...r_day_ohlc.htm

    SessionIterator - https://ninjatrader.com/support/help...oniterator.htm

    Please let us know if we can be of further assistance.
    Last edited by NinjaTrader_Jim; 09-18-2018, 09:42 AM.
    JimNinjaTrader Customer Service

    Comment


      #3
      ok. when I use PriorDayOHLC indicator to get this value I will have wrong value



      what is correct value: in a chart and from this indicator or from Level 2 ?

      Comment


        #4
        Hello sergey_z,

        I have created a video demonstration that explains this output further.

        You may also use a Daily Bar's close value to get this value. In the demonstration I compare PriorDayOHLC attached to a 1440 minute chart, a daily bar chart, and the Level 2 window. Since the 1440 minute bar has not closed, I have set Calculate to OnEachTick/OnPriceChange so the previous daily value would be that of the last completed bar.

        Demo - https://drive.google.com/file/d/1vjC...w?usp=drivesdk

        If you would like to take the approach of using a daily bar, please refer to the Multi Time Frame and Instruments documentation for a complete walk through.

        Multi Time Frame and Instruments - https://ninjatrader.com/support/help...nstruments.htm

        Please let us know if there is anything else we can do to help.
        JimNinjaTrader Customer Service

        Comment


          #5
          Thanks, its works fine

          Question: when "PR Close" and "Close price of Daily Bar" will be updated-when trade session finished or when new day begin?

          Comment


            #6
            Hello sergey_z,

            This value will be updated when the daily bar has closed and has been sent by your data provider. Typically this will be when the session ends, however this will vary between providers that offer RTH or ETH daily bars.

            Our Data by Provider grid breaks down which trading hours each provider uses for daily bars.

            Data by Provider - https://ninjatrader.com/support/help...y_provider.htm
            JimNinjaTrader Customer Service

            Comment


              #7
              When I`m testing my strategy I see that Level2 in Market Replay not the same like Day Close Bar.



              Please explain my why?

              Comment


                #8
                Any ideas?

                Comment


                  #9
                  Hello sergey_z,

                  I'm just replying to say that I've seen your post and will provide a response after I have been able to fully review.

                  EDIT: I'm seeing a difference in behavior between what I see with realtime data and what I see with Market Replay in the Playback Connection. I'm consulting others in the office for further details.
                  Last edited by NinjaTrader_Jim; 09-24-2018, 10:29 AM.
                  JimNinjaTrader Customer Service

                  Comment


                    #10
                    Do you already have some news?

                    Comment


                      #11
                      Hello sergey_z,

                      I do no not have any further information at this time. When I do, I'll be sure to update this post.
                      JimNinjaTrader Customer Service

                      Comment


                        #12
                        I`m still waiting

                        Comment


                          #13
                          Hello sergey_z,

                          QA has informed me that Pr Close is generated directly from market data, and is not fetched from a daily bar value.

                          The difference that we are seeing appears to be a difference between the way historical daily bars are loaded on a chart and how replay builds daily bars.

                          This is different because a daily bar that is developed with realtime data is built on the NinjaTrader platform and does not include the settlement provided by the exchange. This value will be present for the close of a daily bar built with historical data.

                          Since Pr Close is matching with the historical daily close which would be the settlement price, you could follow the same procedures as the exchange to calculate the Volume Weighted Average Price for the daily close.

                          As an example, SP 500 Futures settlement procedures can be referenced here - https://www.cmegroup.com/confluence/...avpagetreemode

                          Please let us know if there is anything else we can do to help.
                          Last edited by NinjaTrader_Jim; 09-28-2018, 07:50 AM.
                          JimNinjaTrader Customer Service

                          Comment


                            #14
                            So, I can`t read PR Close values by Script without some calculation by myself?

                            Comment


                              #15
                              Hello sergey_z,

                              I just checked if this could be fetched from OnMarketData() and it can.

                              Could you let us know if using the following resolves your inquiry?

                              Code:
                              protected override void OnMarketData(MarketDataEventArgs marketDataUpdate)
                              {
                              	if (marketDataUpdate.MarketDataType == MarketDataType.LastClose)
                              		Print(marketDataUpdate.Price);
                              }
                              OnMarketData() - https://ninjatrader.com/support/help...marketdata.htm

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

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by aboparai1, Yesterday, 09:41 AM
                              1 response
                              12 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Started by nickslad, Yesterday, 09:07 AM
                              1 response
                              3 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Started by thgamey, Today, 06:46 PM
                              0 responses
                              5 views
                              0 likes
                              Last Post thgamey
                              by thgamey
                               
                              Started by AxelrodWins, Yesterday, 09:56 PM
                              2 responses
                              22 views
                              0 likes
                              Last Post AxelrodWins  
                              Started by Johnny Santiago, Yesterday, 08:47 AM
                              1 response
                              13 views
                              0 likes
                              Last Post NinjaTrader_EricB  
                              Working...
                              X