Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

refresh only my indicator on the chart

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

    refresh only my indicator on the chart

    Hello !
    I am practicing indicator development. I am drawing lines in a new panel with specific time durations, and the beginning and end of these lines are given as input from the user. Is there any way to make only this indicator of mine recalculate and not all the other ninjascripts ? (I am using an indicator that uses tickreplay and it takes a while to recalculate).

    I ask because I happened to use indicators developed by others that add a “button” in the title bar of the chart window (after the indicators, strategies, properties buttons) to change the indicator settings. I am pretty sure what I would like to do is feasible but I am new to this and have no idea where to look on the reference

    thanks !
    ​​

    #2
    Hello sn0z33r,

    Unfortunately, there isn't a supported way of reloading a single indicator.

    There is an existing feature request for this tracked with ID # SFT-1726 and I will be happy to add your vote.

    Please note, we receive many requests and cannot reasonably implement all requested features or changes. Interest is tracked internally and if enough interest is tracked, it would be weighed against how feasible it would be to make those changes to consider implementing, so we cannot offer an ETA or promise of fulfillment.

    When new features are implemented, they will be listed in the Release Notes page of the Help Guide. The ID number may be different than the internal feature request tracking ID, but the description of the feature will let you know if that feature has been implemented.

    Release Notes - https://ninjatrader.com/support/help...ease_notes.htm


    It is possible to add buttons to the chart and trigger actions. You could draw objects or remove objects from the button click event handler using TriggerCustomEvent() or set a variable to a value.
    Below are links to examples.




    Further, its possible to reload all NinjaScripts (all indicators and strategies and not just a single one) by calling ReloadAllHistoricalData().
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      thanks, so I can't recalculate it but I can delete the drawn objects and draw them again without recalculating. Did I understand correctly ?
      The indicator I would like to implement is static, it does not calculate anything. I need it to draw lines from a beginning to an end, it doesn't calculate anything.

      How can I do to add a button in the title bar that shows the indicator settings ?​​

      Comment


        #4
        Hello sn0z33r,

        " so I can't recalculate it but I can delete the drawn objects and draw them again without recalculating."

        It wouldn't be possible to recalculate one specific indicator is multiple indicators are added to a chart, only possible to reload all historical data which reloads all scripts.

        It is possible to remove drawing objects or redraw them from a button click.

        "The indicator I would like to implement is static, it does not calculate anything."

        By "calculate" you can think of this as running any logic in OnBarUpdate() (such as calling drawing tool methods), which is controlled by the Calculate setting.

        "I need it to draw lines from a beginning to an end, it doesn't calculate anything."

        I'm not sure I'm understanding the issue. Why are you needing to remove the drawing objects an re-draw them?

        "How can I do to add a button in the title bar that shows the indicator settings ?​​"

        See the SampleWPFModifications​ reference sample I have provided a link to in post # 2.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          I try to explain myself better
          1 time a day I want to draw lines that have a fixed beginning and end for the whole session. I don't have to calculate anything to draw these lines, I manually set the values each day.

          I am looking for a way to set the start and end of these lines without having to have all the indicators I have on the chart recalculated because it would mean load everything, change my indicator, apply, recalculate everything. The need is to edit these drawn lines without being forced to recalculate everything 2 times. I don't want to draw them by hand on the chart but in a separate panel that does automatic scaling along with the chart keeping the end time that I set manually​

          Comment


            #6
            Hello sn0z33r,

            You could just manually adjust the lines in the Drawing objects window.
            You could change the price, or the start bar and end bar time..
            Help guide: Operations > Charts > Working with Drawing Tools & Objects > Understanding drawing object properties

            If you wanted to have buttons added to the title bar that calculate a new start bar and end bar time and price, you can do this as well.
            To adjust a drawing object call the Draw method again using the same tag name.
            To remove a drawing object supply the tag name to RemoveDrawingObject().
            Help guide: NinjaScript > Language Reference > Common > Drawing > RemoveDrawObject()

            Be sure to use TriggerCustomEvent() before calling Draw methods.
            Help guide: NinjaScript > Language Reference > Common > TriggerCustomEvent()
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              thanks for the links, I will run to read them and write a few lines of code to test !

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              576 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              334 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
              553 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              551 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X