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

Do not refresh current indicators when adding new ones

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

    Do not refresh current indicators when adding new ones

    Hi,

    I have an indicator which draws Fibo retracements figures on each bar update. I can amend this fibo figure (remove some levels, increase line width,...) and these amendments saved even after bar updates.

    However, when I'm trying to open Indicators list and add new additional indicator (or simply press Ok w/o adding anything), my fibo indicator fully redraws and my amendments (removed levels/etc) getting lost.

    Is there a way to save a state of my indicator, so after adding new indicator, current one will keep old settings and will not be fully redrawn?

    Thanks.

    #2
    Hello,

    If you are making these adjustents manually in the Fib Properties window, then this would be expected, since when the chart reloads all NinjaScript files, it will essentially be drawing a new Fib object with the default settings applied.

    You should be able to get around this by saving your changes as the default for all Fib objects of that type (retracement, extension, etc.). While you are in the Properties window, first right-click in the window, then click "Manage Templates." Then, save the template with the name "Default." Now, the next time a new Fib object of that type is drawn, it should use those same settings, so you should see no change when you add another indicator.

    If you find this not to be the case, please let me know, and I will see if there is another solution for you.
    Dave I.NinjaTrader Product Management

    Comment


      #3
      Dave, Thanks for reply.

      Side question: When I open Indicators list on some chart and simply click Ok button, does it reloads my chart window and also reload and recalculate my indicators?


      Let me provide an example of what I need:
      I have an indicator which is simply drawing fib retracements based on startTime and endTime input values and which is calculating high and low automatically.
      I'm putting two of these indicators on my chart at different time periods (for example 9am - 11am and 2pm - 4pm) and manually changing properties of fib figures (for example, on 1st indicator hide 4th and 5th levels, on 2nd indicator hide 2nd and 3rd levels).
      Then I want to add 3rd indicator (as example for 5pm-6pm). When I'm opening Indicators list, adding new indicator and clicking Ok button, chart is getting refreshed and my previous two indicators getting redrawn (so all levels are visible again).

      My situation:
      1. Templates are not suitable in current case, because I'm planning to put 3 and more such indicators on each chart and all manual amendments will be unique for each indicator/figure.
      2. I have provided example for "static" indicator, however I have the same "dynamic" indicator which is updated on each bar and suffer from the same behavior (note that manual changes are not lost on bar update)

      Questions:
      1. Is there a way (except templates) to save my manual changes before reload and restore these changes after indicators get refreshed (after I click Ok in Indicators list)? (I was thinking about save and load changes to/from file, but it does't look like the best solution)
      2. Is it possible not to reload existing indicators when adding new one on the chart?
      3. Is it possible to "disconnect" figure from indicator. For example, indicator has drawn Fib retracement figure on the chart and then it doesn't impact this figure in any way (indicators reload have no impact on this figure as well). If answer is yes, then is it possible to "connect" to this figure (by the tag, for example) after indicator reload?

      Thanks in advance

      Comment


        #4
        Hello,

        Unfortunately, it would be a No for each of those possibilities. All of the scripts are reloaded each time a new indicator is applied, and there would not be a supported way to either save the properties of the Fib template to bring back upon reload, or to detach the actual drawing object from the script itself.
        Dave I.NinjaTrader Product Management

        Comment


          #5
          Is it possible to somehow set or unlock "Attach To" property of figures drawn by indicator?
          I have "neoHarmonics Toolkit" installed, it works like an indicator, but I'm able to set "Attach To" property for figures drawn by this indicator.

          Comment


            #6
            Hello,

            Unfortunately there is not a supported way to do this. None of the drawing object methods that can be accessed in code include an Attach To parameter, so it sounds like this is something that the newHarmonics team has programmed in themselves for their product.
            Dave I.NinjaTrader Product Management

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by sidlercom80, 10-28-2023, 08:49 AM
            168 responses
            2,262 views
            0 likes
            Last Post sidlercom80  
            Started by Barry Milan, Yesterday, 10:35 PM
            3 responses
            10 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by WeyldFalcon, 12-10-2020, 06:48 PM
            14 responses
            1,429 views
            0 likes
            Last Post Handclap0241  
            Started by DJ888, 04-16-2024, 06:09 PM
            2 responses
            9 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by jeronymite, 04-12-2024, 04:26 PM
            3 responses
            41 views
            0 likes
            Last Post jeronymite  
            Working...
            X