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 Gerik, Today, 09:40 AM
          1 response
          5 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by RookieTrader, Today, 09:37 AM
          1 response
          10 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by alifarahani, Today, 09:40 AM
          0 responses
          5 views
          0 likes
          Last Post alifarahani  
          Started by KennyK, 05-29-2017, 02:02 AM
          3 responses
          1,284 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Started by AttiM, 02-14-2024, 05:20 PM
          11 responses
          185 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Working...
          X