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

Where can i find this data ?

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

    #16
    ok thanks for the info. i dont write script so am at a dead end for now. am i the only one thinking this info would be greatly helpful?

    Comment


      #17
      to AdamP and Austin,
      here is a snapshot as you can see :
      above is the print on the output window; bid and ask prices are right, the change_net and change_per are wrong.
      Below the same ouput on the chart
      In the middle the real quotation.

      Ticker: ES 03-12
      Attached Files

      Comment


        #18
        mate01,

        How is it off? You have your calculation set to do : Close[0] - sess_Open, with sess_Open set to :

        sess_Open = PriorDayOHLC().PriorClose[0];

        You could try changing this to CurrentDayOHL().CurrentOpen[0];

        Please let me know if I may assist further.
        Adam P.NinjaTrader Customer Service

        Comment


          #19
          AdamP,
          i tried some tickers and the sess_open is wrong for both currentDay and priorDay.
          In this case ES (future) and RIG (stock).
          So the retrieved data from the data provider seems to be wrong.

          Comment


            #20
            mate41,

            You could try modifying your session template to be 24/7 to see if it gives you more data. This is done by right click > data series > set session template to "Default 24/7". What data source are you comparing to for your session open that you see a difference?
            Adam P.NinjaTrader Customer Service

            Comment


              #21
              AdamP,
              i think we can't solve the problem because the data isn't retrieved correctly.
              The data provider is IB and i tried the 'default 24/7'.
              I also created and tried a 'startup' section to avoid retrieving the sess_open on every tick. Nothing works as it has to do.
              I need the the differences from the quotes and 'previous session close' to trade CFD's but this may not be the reason for having the correct data.

              Comment


                #22
                Mate,

                What data source are you comparing to to get the opening for the day? In other words, what data are you looking at that pinpoints the NT data from IB as wrong?

                Please make sure your PC clock is synced to a standardized source like NIST. Please find instructions below.

                Set your computer clock via the Internet using tools built into the operating system NIST has established a maili
                Adam P.NinjaTrader Customer Service

                Comment


                  #23
                  Adam,
                  look at the screenshot i attached below.
                  The line at the middle indicate:
                  close previous session, price at the open of the market, current price, etc.... At the most right you have the differences net and percent between the current price and the previous session close.
                  The line above indicate the sess_Open = taken by NT from IB and see also the calculated differences.
                  In this shot you have all what you need to compare.

                  Comment


                    #24
                    mate,

                    Please see the attached screenshot. I added daily bars to the chart, checked the opening of the day price, then compared to some of your code modified to print session open. I put some ellipses around the prices so you can see.

                    I would recommend using CurrentDayOHL.CurrentOpen[0] to get session open.

                    Please let me know if I may assist further.
                    Attached Files
                    Adam P.NinjaTrader Customer Service

                    Comment


                      #25
                      Adam,
                      the variable-name was a bad name. I had to name it sess_previous_close or sess_start_new_market or whatever...
                      So this session open on the market to start trading is 1253.00 and not 1250.25 !
                      The 1250.25 quote is the first traded price when the market opened a new session.
                      That way there is already a negative started price and the chg_net schould be -2.75 at that moment.

                      And yes, i used on my first code sess_Open = CurrentDayOHL().CurrentOpen[0] but that isn't what it must be.
                      Last edited by mate41; 12-12-2011, 03:20 PM.

                      Comment


                        #26
                        mate,

                        So you actually want the previous day's close?

                        You could add a second data series Add(PeriodType.Day,1); in Initialize(), then every OnBarUpdate(), check if(BarsInProgress==1 && FirstTickOfBar), if it is, set prev_Day_Close = Closes[1][1]; The FirstTickOfBar is to ensure you aren't resetting the variable every tick.

                        I.e.

                        Code:
                        protected override void Initialize()
                        {
                        Add(PeriodType.Day,1);
                        
                        //other code here
                        }
                        
                        protected override void OnBarUpdate()
                        {
                        
                        if ( BarsInProgress == 1 && FirstTickOfBar)
                        {
                             previous_Day_Close = Closes[1][1];
                        }
                        
                        //other code here
                        
                        }
                        Please let me know if I may assist further.
                        Adam P.NinjaTrader Customer Service

                        Comment


                          #27
                          Hi Adam,
                          thanks for your hints. I am back to the first (hint) code, others don't work.
                          Code:
                          if ( BarsInProgress == 0 && FirstTickOfBar) 
                              sess_Open = PriorDayOHLC().PriorClose[0];  // ok, right one and taken only once
                          // here are the problems: the calculation is wrong; 
                          // [B]difference of 0.25[/B] compared with the real quote (on ES 03-12)
                          change_Net = CurrentPriceValue[0] - sess_Open;  
                          // and of course the calculated percent also
                          change_Per = (change_Net * 100) / sess_Open;
                          Conclusion: what is really wrong? The displayed (% and Net) quotes on the TWS or the NT calculation? Or a ROUND of the calculation ?

                          Comment


                            #28
                            Hi mate41,

                            The only way to track this down is to Print() all values used in your calculation, in order to identify which exact value isn't working as you expected. Verify that every element in your calculation matches expectations. You could also consider contacting IB support to see if they can offer details on their provided net change value. They may use a settlement value, or a different session close definition.
                            Ryan M.NinjaTrader Customer Service

                            Comment


                              #29
                              Ryan,
                              of course i compared the data with a Print(....).
                              The data from a future like ES can't be better.
                              But data from for ex. RIG is completely wrong.
                              This is the answer from IB:
                              "The shown closing price is the official closing price of the exchanges. Currently we show for RIG@NYSE a closing price of 41.84 which is the official close of yesterday's trading. I double checked with Bloomberg and this one is correct"

                              Comment


                                #30
                                Hi mate41,

                                Can you please clarify if what you're seeing is specific to your custom script, or is a data comparison issue, NT charts compared to TWS?
                                Ryan M.NinjaTrader Customer Service

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Kaledus, Today, 01:29 PM
                                1 response
                                7 views
                                0 likes
                                Last Post NinjaTrader_Jesse  
                                Started by frankthearm, Yesterday, 09:08 AM
                                13 responses
                                45 views
                                0 likes
                                Last Post frankthearm  
                                Started by PaulMohn, Today, 12:36 PM
                                2 responses
                                16 views
                                0 likes
                                Last Post PaulMohn  
                                Started by Conceptzx, 10-11-2022, 06:38 AM
                                2 responses
                                55 views
                                0 likes
                                Last Post PhillT
                                by PhillT
                                 
                                Started by yertle, Yesterday, 08:38 AM
                                8 responses
                                37 views
                                0 likes
                                Last Post ryjoga
                                by ryjoga
                                 
                                Working...
                                X