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

bug in BarTypes?

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

    bug in BarTypes?

    I have custom simple BarsType script.

    Code:
    protected override void OnStateChange()
    {
    
      ..... 		
       else if (State == State.Configure)
       {
         Print("Hi");
       }		
       Print(State.ToString());
    .....		
    }
    When I check Output Log, there are about 20-30 "HI" printed out.. with plenty of `State` prints... So, the same state are executed numerous times (even `Configure` state, where I am checking License from site, is executed 20-30 times)..

    is that bug in NT? it should be executed once like indis.

    #2
    Hello TazoTodua,

    Thank you for your note.

    I'm looking into this and will follow up when I have more information.

    Thank you for your patience.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Hello TazoTodua,

      Thank you for your patience.

      This is expected.

      Configure will be called once per unique bar type instance.

      Please let us know if you need further assistance.
      Alan P.NinjaTrader Customer Service

      Comment


        #4
        No, i think you misunderstood.
        each state change happens 10-15 times.

        so,

        protected override void OnStateChange()
        {

        Print(State.ToString());
        }


        you will see numerous time, when the same state is executed. This also happens with CONFIGURE too, it is executed not 1, but about 5-10 times. When I debug (use print command like above), all those print-outs happen at the moment, when I change dropdown from minute (or other type) to custom type. There is no special code in my custom bar. Just there is some flaw in NT i think, that causes the state-change to fire numerous times when user tries to setup the initial setttings window.

        Comment


          #5
          Hello TazoTodua,

          Its expected that you see it called a bunch of times, since NT is actually building bars that many times and its not just one instance of bars but multiple bars. E.g. Cache, Merge back adjust, Building Bars for a bars to load requirement, etc.

          Please let us know if you need further assistance.
          Alan P.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by martin70, 03-24-2023, 04:58 AM
          15 responses
          114 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by The_Sec, Today, 02:29 PM
          1 response
          6 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by jeronymite, 04-12-2024, 04:26 PM
          2 responses
          31 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by Mindset, 05-06-2023, 09:03 PM
          10 responses
          265 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by michi08, 10-05-2018, 09:31 AM
          5 responses
          743 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Working...
          X