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

Right Scale Chart Properties

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

    Right Scale Chart Properties

    Hi,

    I have two questions:

    1. Is there a way to access the Right Scale settings for a chart?
    2. If Horizontal Grid Lines are set to automatic, how does NT decide where to draw the horizontal line. I would like to find out how far apart the lines on the chart are.

    Thanks for your help.

    #2
    1. Right-click directly on the vertical/price scale to access the scale/panel settings.
    2. You can define how far apart the horizontal grid lines are if you change the 'horizontal grid lines' property to 'fixed'. Then, adjust the 'horizontal grid lines type' and 'horizontal grid lines value' as you desire.

    Comment


      #3
      Thanks, PatrickG.
      I should have said that I want to access these programatically. My apologies. I know that I can get these via ChartScale.Properties but I am having a bit of an issue creating an instance of ChartScale outside of OnRender() so I can get access.

      Comment


        #4
        Hello Zeos6,

        Thank you for the post.

        The suggested way to access the ChartScale object is generally by setting a class level variable to the ChartScale instance that is passed in to OnRender. Can you tell me, are you currently using an Indicator or another type as this is posted in the Addon development forum?

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Hi Jesse,


          I am trying to access the various members of ChartScale.Properties programatically from inside indicator so that I can use them for calculations done in the indicator. I am not using OnRender(). Ideally I'd like to get the values of these during OnStateChange() if possible.

          Comment


            #6
            Hello Zeos6,

            Thank you for the reply.

            Because you are using an Indicator, you could either pass a variable from OnRender depending on the use case or you can take a look at the following example:



            The ChartPanel object has a Scales collection which you can iterate over. Depending on what you are trying to affect, you may or may not see an update in the chart when setting the values of UI objects programmatically. You will need to test your idea to see if this object gives that ability.


            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment


              #7
              Thanks Jesse.

              This is actually quite helpful. I thought about the OnRender approach but the Scales approach might actually work better for me. I will give it a try. Thanks for pointing it out.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by frankthearm, Today, 09:08 AM
              7 responses
              29 views
              0 likes
              Last Post NinjaTrader_Clayton  
              Started by NRITV, Today, 01:15 PM
              1 response
              5 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by maybeimnotrader, Yesterday, 05:46 PM
              5 responses
              25 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by quantismo, Yesterday, 05:13 PM
              2 responses
              17 views
              0 likes
              Last Post quantismo  
              Started by adeelshahzad, Today, 03:54 AM
              5 responses
              33 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Working...
              X