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

Reload Script on first tick of new bar

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

    Reload Script on first tick of new bar

    I am trying to get NT to "Reload NinjaScript" ie "F5" on the fist tick of a new bar forming. Here is what I have which does not work.

    protectedoverridevoid OnBarUpdate()

    if(FirstTickOfBar) Update();

    What change do I need to make?

    thanks

    #2
    velocity, unfortunately a programmatic reload of the NinjaScript's is not supported - just put your code into if (FirstTickOfBar) ... to make it execute on the first bar tick only running CalculateOnBarClose = false.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Here is the problem, The bar is painting when a condition exists and but then when the condition is no longer true the bar remains painted. When it rolls to a new bar, I hit the F5 to remove the paint on the prior bar.

      I NEED to keep CalculateOnBarClose = false.

      So how do I do a work-around?

      thanks

      Comment


        #4
        You could either work with the Reset method of the underlying dataseries object or use a DrawObject and remove it if the condition negates itself -



        BertrandNinjaTrader Customer Service

        Comment


          #5
          suggestion

          It would be helpful to have programmatic reload of the NinjaScript's ie. F5.

          Please consider.

          Thank you.

          Comment


            #6
            Nt7

            I see that this hasn't been incorporated into 7 either?
            Is there any way to programmatically reset all of the data series?

            Comment


              #7
              Mindset, unfortunately not - you would need to reset each DataSeries as needed in your custom code.
              BertrandNinjaTrader Customer Service

              Comment


                #8
                Hint

                Maybe I am not clear?

                Say I have a dataseries that holds an SMA value.
                If I want to clear the whole dataseries including history (or even reset() the whole of the history) - is there any simple way?

                I thought ChartControl.Refresh might do it.

                Comment


                  #9
                  No, this is unfortunately not supported Mindset (same as the undocumented ChartControl properties).
                  BertrandNinjaTrader Customer Service

                  Comment


                    #10
                    Hint

                    Appreciate it's unsupported but I would really like to be able to turn indicator lines on and off with keystrokes.
                    Can you provide a hint?

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by kevinenergy, 02-17-2023, 12:42 PM
                    118 responses
                    2,778 views
                    1 like
                    Last Post kevinenergy  
                    Started by briansaul, Today, 05:31 AM
                    0 responses
                    9 views
                    0 likes
                    Last Post briansaul  
                    Started by traderqz, Yesterday, 12:06 AM
                    11 responses
                    28 views
                    0 likes
                    Last Post NinjaTrader_Gaby  
                    Started by PaulMohn, Today, 03:49 AM
                    0 responses
                    8 views
                    0 likes
                    Last Post PaulMohn  
                    Started by inanazsocial, Today, 01:15 AM
                    1 response
                    10 views
                    0 likes
                    Last Post NinjaTrader_Jason  
                    Working...
                    X