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 funk10101, Today, 09:43 PM
                    0 responses
                    3 views
                    0 likes
                    Last Post funk10101  
                    Started by pkefal, 04-11-2024, 07:39 AM
                    11 responses
                    36 views
                    0 likes
                    Last Post jeronymite  
                    Started by bill2023, Yesterday, 08:51 AM
                    8 responses
                    44 views
                    0 likes
                    Last Post bill2023  
                    Started by yertle, Today, 08:38 AM
                    6 responses
                    25 views
                    0 likes
                    Last Post ryjoga
                    by ryjoga
                     
                    Started by algospoke, Yesterday, 06:40 PM
                    2 responses
                    24 views
                    0 likes
                    Last Post algospoke  
                    Working...
                    X