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

How to hide the price label of an indicator on y-axis

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

    How to hide the price label of an indicator on y-axis

    Hello,

    How to hide the price label of an indicator on y-axis?


    - Clearpicks

    #2
    The PaintPriceMarkers property.

    RayNinjaTrader Customer Service

    Comment


      #3
      I set PaintPriceMarkers to false in Initialize() function. However it seems
      PaintPriceMarkers does not alway work. For example, when clicking "F5" to reload the indicator script, the price labels would appear again sometimes. I have not identified the exact scenario to reproduce it. But it seems it depends on whether there is any new realtime bar is generated, the last bar position relative to the chart right margin, whether the datafeed is connected, etc. In summary, PaintPriceMarkers may not work at the beginning or stop to work at some time or may even to work again in some case.

      - Clearpicks

      Comment


        #4
        Please let us know if you do find a reproducible scenario. In the meantime I will play around with it a little too. Thanks for your efforts clearpicks.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          I just tested it by starting with a blank chart, so far it is still working. So it is very likely it was caused by that fact I started with an existing and only reload ninjascripts using "F5" each time I modified the code in the script.

          So to reproduce this issue, try to create a blank 1min chart and get the datafeed connected. Modify the indicator source code by adding
          PaintPriceMarkers = false; in Initialize() and apply it to the chart. Indicator price labels should be hiden at this time. Then create a black chart again, modify the indicator source code and change that line to PaintPriceMarkers = true; in Initialize() and apply it to the chart. The indicator price labels should be shown on chart depends on the last bar position. Then modify that line of code back to PaintPriceMarkers = false; but just press "F5" at this time instead of starting with a blank chart. Now you should see the price labels are still shown on the chart.

          It seems "reloading ninjascript" by "F5" does not reset any indicator property according to the settings in Initialize(). This might be desired behavior for indicator users, but in indicator development stage, this is not a desired design because very oftem the programmer need to change some properties in Initialize() or even add or remove some plots, however he/she can not simply use "F5" to reload the ninjascript to debug it, instead he/she has to start with a black chart.

          So I would like to suggest in NinjaTrader option window add a flag to set whether the user is in trading state or programming state. In the later case, "F5" would reload the script and reset properties according to the Initialize() function, while in the former case, the existing chart properties would override the settings in the Initialize() function.


          - Clearpicks



          Originally posted by Josh View Post
          Please let us know if you do find a reproducible scenario. In the meantime I will play around with it a little too. Thanks for your efforts clearpicks.

          Comment


            #6
            Your observation is correct. Reloading the NinjaScript preserves whatever values you have already set for your indicator/strategy. It does not reset them to their defaults. If you wish to reset everything you will need to remove and readd it, but thank you for your suggestion. We will take it into consideration.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Initialize() is called whenever reloading Ninjascripts using "F5". So it seems ninjascript engine does some extra work after Initialize() and first call of OnBarUpdate(), such as restoring chart properties, right?

              - Clearpicks

              Comment


                #8
                Don't know, but the preservation of variable settings is what it will do so you will just need to accommodate it when developing indicators.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  I've noticed this global settings preservation in NinjaScript when initializing them in Initialize(). This is not always convenient, for example in order to toggle between overlay and separate pane modes I need to reload the chart completely. I suggest for the future that coders have the ability to change the settings dynamically.

                  Comment


                    #10
                    billitin,

                    I guess I don't follow. Overlaying can be selected in the Indicators dialogue window when you choose the panel it goes on. Panel 1 is overlay, 2, 3, 4, etc. would be new panels. You choose whichever one you want. If you changed code and then wanted to have the indicator loaded up again you will need a new instance of the indicator if you changed the Overlay property.
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      I've posted about it here: http://www.ninjatrader-support2.com/...ad.php?t=12769 and wanted to add this on the list for future improvements

                      Comment


                        #12
                        billitin,

                        Please post your code and we can take a brief look at it. Thank you.
                        Josh P.NinjaTrader Customer Service

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by geddyisodin, Yesterday, 05:20 AM
                        8 responses
                        49 views
                        0 likes
                        Last Post geddyisodin  
                        Started by DayTradingDEMON, Today, 09:28 AM
                        3 responses
                        19 views
                        0 likes
                        Last Post NinjaTrader_ChelseaB  
                        Started by Stanfillirenfro, Today, 07:23 AM
                        9 responses
                        23 views
                        0 likes
                        Last Post NinjaTrader_ChelseaB  
                        Started by George21, Today, 10:07 AM
                        0 responses
                        8 views
                        0 likes
                        Last Post George21  
                        Started by navyguy06, Today, 09:28 AM
                        1 response
                        7 views
                        0 likes
                        Last Post NinjaTrader_Gaby  
                        Working...
                        X