Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Add(serurity) trouble

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

    Add(serurity) trouble

    Hello,

    Let say i've a "ES 03-10" 5min and i want to add other securities at another time scale.
    Here is what i write for example:
    Add("ES 03-10", PeriodType.Minute, 1);
    Add("XOM", PeriodType.Minute, 1);
    Add("MSFT", PeriodType.Minute, 1);
    Add("AAPL", PeriodType.Minute, 1);

    then in the onbarupdate:

    for(int i=0;i<5;i++)
    Print(Closes[i].Count+" "+i);

    If i load a full 5min day, it outputs the following:

    81 0
    0 1
    389 2
    389 3
    390 4

    So, why is the "Add("ES 03-10", PeriodType.Minute, 1);" not being added or added without a error?

    Also, if what i add is on the PeriodType.Second time scale, it will fail from time to time and a dialog box will popup. How do i prevent this box from poping up(try/catch doesn't work)?

    Thanks

    #2
    the provider is mbt

    Comment


      #3
      I was actually loading up to 27/01/2010 0 days but if i load up to 26/01/2010 1 day then it's working:
      81 0
      405 1
      389 2
      390 3
      389 4

      Another thing:
      If instead of Add(security, PeriodType.Minute, 1);
      i do: Add(security, PeriodType.Second, 60); it doesn't load(loading...XXX in the bottom right corner of Control Center stays there and nothing happens).
      Is it coming from NT7 or MBT. I,'ve tried to display just a simple chart on the second scale and it's working, so mbt provides seconds data);

      Last, i use a dll which is referenced. When i first run the indicator it comes up with the following:
      Microsoft Visual c++ runtime library
      Runtime error
      Programm:C:\....\NT7.exe
      R6034
      An application has made an attempt to load the c runtime lib incorrectly

      but uses the dll correctly and displays the indicator correctly.
      Why is that?

      Thanks

      Comment


        #4
        For the runtime error, it's because of third party forget about it.

        Comment


          #5
          Is this for indicators or strategies? Are you sure you are on NT7.0.0.6?
          Josh P.NinjaTrader Customer Service

          Comment


            #6
            It's for indicators. yes i'm using 7.0.0.6.

            Comment


              #7
              Unfortunately I was not able to reproduce.

              288 0
              1438 1
              1393 2
              1393 3
              1393 4

              Is the output I got from your exact code. Suggest you try cleaning out your database and trying again with a fresh data set.
              Josh P.NinjaTrader Customer Service

              Comment


                #8
                288*5/12=24hours, i only use the opening hours because of the stocks.
                Are you able to add the stocks with periodType of 60 seconds as opposed to 1 minute?

                Comment


                  #9
                  288*5/60 sorry

                  Comment


                    #10
                    Sorry I am not following what you mean by those math operations.
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      because you obtain:
                      288 0
                      1438 1
                      1393 2
                      1393 3
                      1393 4
                      288 is then the number of bars in the master dataseries. if it's a 5min chart, that's 288*5 minutes, 288*5/60 hours

                      i have 80*5/24= a bit more than 6h30(the session)

                      Comment


                        #12
                        phewww, the market's smoking!

                        Comment


                          #13
                          Sorry, I am not following what point you are trying to make by 288*5/60.

                          It is simply printing the number of bars in that bars series. 5min ES has 288, 1min ES has 1438. Ball park numbering quantity for both looks good.
                          Josh P.NinjaTrader Customer Service

                          Comment


                            #14
                            That's ok thank you.
                            Just one thing, could you tell me please why nt doesn't display the first 20 ish first points in an indicator(like plot.set(close))?

                            Comment


                              #15
                              That would be an "unstable" period for calculations of a vast majority of indicators so it is not displayed.
                              Josh P.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              621 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              359 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              105 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              562 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              567 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X