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

Drawing Labels in Y Scale

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

    #16
    Chelsea,

    I just tested the workaround you gave in post#10 above. I am baffled as to how/why this works? Why does this work to suppress drawing the line? I noticed when I comment out the OnRender block entirely, it does not work and the line is drawn. Can you explain that? I am confused as to what is actually happening here to make this work.

    Comment


      #17
      Hello swcooke,

      Overriding OnRender() blocks the base.OnRender() so nothing is rendered.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #18
        Is it possible to somehow use this to draw the label but still be able to use OnRender to draw?

        Comment


          #19
          Hello swcooke,

          It would not be possible to have the same indicator render anything if OnRender() is overriden without the base.OnRender() being called.

          I recommend you use a separate indicator for other things you want rendered.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #20
            Sorry, can you give an example of how to do that? Would I just create a partial class as an AddOn and put this override into that? I need a way that makes it easy to distribute the Indicator as one Indicator without the user knowing this is two different indicators. So far, the only way I have found to do that is by putting a partial class in the AddOn folder.

            Comment


              #21
              Hello swcooke,

              I'm not suggesting anything with partial classes.

              I'm suggesting that you create a new indicator in the NinjaScript Editor. In the Explorer pane on the right, right-click the Indicators folder > select New Indicator > click OK.

              In this new indicator add the logic to draw the other items. (You could even call the first indicator to get a plot value from it if you wanted)
              Chelsea B.NinjaTrader Customer Service

              Comment


                #22
                Originally posted by bandass
                I just want to see the label. Setting BarBrush = Brushes.Transparent just changes the color of the brush used in the main pane.
                Even I am looking for the same mate, let me know once you find.

                Regards,

                Comment


                  #23
                  Originally posted by seoking View Post

                  Even I am looking for the same mate, let me know once you find.

                  Regards,
                  Issue solved? If yes. Please help me too. As I am not able to solve it mxplayer

                  Regards, mxplayer for pc
                  Last edited by pinknemo13; 07-18-2020, 11:41 AM.

                  Comment


                    #24
                    Hello pinknemo13,

                    It is possible to custom render text if you wanted to do this in the OnRender() override and then not call base.OnRender() so that the chart objects from the script are not rendered.

                    Below is a link to an example of rendering text.
                    Simple script that adds a background watermark of the instrument symbol (and expiry if a future) to the chart. (Updated July 10th, 2018 ‐ The opacity needed to be casted as a double and divided by 100 to be between 0 and 1) (Update: August 24th, 2021 – Subtracted the ChartPanel.Y so indicator can be […]
                    Chelsea B.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by rbeckmann05, Yesterday, 06:48 PM
                    1 response
                    12 views
                    0 likes
                    Last Post bltdavid  
                    Started by llanqui, Today, 03:53 AM
                    0 responses
                    6 views
                    0 likes
                    Last Post llanqui
                    by llanqui
                     
                    Started by burtoninlondon, Today, 12:38 AM
                    0 responses
                    10 views
                    0 likes
                    Last Post burtoninlondon  
                    Started by AaronKoRn, Yesterday, 09:49 PM
                    0 responses
                    15 views
                    0 likes
                    Last Post AaronKoRn  
                    Started by carnitron, Yesterday, 08:42 PM
                    0 responses
                    11 views
                    0 likes
                    Last Post carnitron  
                    Working...
                    X