Announcement

Collapse
No announcement yet.

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.

    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 -



        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.

              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).

                  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 Geovanny Suaza, 02-11-2026, 06:32 PM
                    0 responses
                    566 views
                    0 likes
                    Last Post Geovanny Suaza  
                    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                    0 responses
                    330 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by Mindset, 02-09-2026, 11:44 AM
                    0 responses
                    101 views
                    0 likes
                    Last Post Mindset
                    by Mindset
                     
                    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                    0 responses
                    547 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by RFrosty, 01-28-2026, 06:49 PM
                    0 responses
                    548 views
                    1 like
                    Last Post RFrosty
                    by RFrosty
                     
                    Working...
                    X