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 can i configure nt so the lines for low and high of day are always visible?

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

    ¿how can i configure nt so the lines for low and high of day are always visible?



    good day to everyone,



    i am trying to develop an indicator that will plot a horizontal line at some price levels of interest.



    but, i have a problem where if the current price is made to move lower or higher, those lines will be outside the range that nt displays on the screen and thus become useless.


    i want nt to have a range on screen that includes all the lines my indicator plots at all times. and for starters, i want to know ¿how can i configure nt so that the low and high of the day are always visible on screen? then i would just configure my own indicator in this same way.



    very well, thanks, regards.
    Last edited by rtwave; 03-02-2021, 08:51 AM.

    #2
    Hello rtwave,

    Thanks for your post.

    "i want to know ¿how can i configure nt so that the low and high of the day are always visible on screen? then i would just configure my own indicator in this same way."

    If you are using intraday data, I would suggest using the indicator CurrentDayOHL. This indicator will plot a line for the high and the low of the day. If you then set the indicators "Autoscale" to true (By checking the check box for "autoscale" when you apply the indicator) the chart will adjust to consider the price bars and now the indicators plots. Note that this action will cause the price bars to appear smaller and the price scale will feature larger steps in order to accommodate the full height of the price movement inside the High and low plots.

    All you need to do for your indicator is to set its "autoscale" to true and the chart will then adjust to fit the extremes of the plots and price.
    Paul H.NinjaTrader Customer Service

    Comment


      #3



      excellent.


      i will try this, a setting like this is exactly what i had in mind. hopefully, nt will make it available for my own indicators as well.



      thanks.

      Comment


        #4


        actually, i found this fragment of code that hopefully should work. i have now included it in my indicator, i will test it later today if i have a chance.


        Code:
        protected override void OnStateChange()
        {
        if (State == State.SetDefaults)
        {
        Name = "Example Indicator";
        // set this to true to call CalculateMinMix() to ensure drawing tool is fully rendered in chart scale
        IsAutoScale = true;
        }
        else if (State == State.Configure)
        {
        }
        }

        Comment


          #5
          Hello rtwave,

          Thanks for your reply.

          That is the correct code.

          If you create your indicator using the Indicator wizard you will find that that code is automatically added.

          Here is the help guide link to autoscale: https://ninjatrader.com/support/help...sautoscale.htm
          Paul H.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by yertle, Yesterday, 08:38 AM
          7 responses
          28 views
          0 likes
          Last Post yertle
          by yertle
           
          Started by bmartz, 03-12-2024, 06:12 AM
          2 responses
          21 views
          0 likes
          Last Post bmartz
          by bmartz
           
          Started by funk10101, Today, 12:02 AM
          0 responses
          4 views
          0 likes
          Last Post funk10101  
          Started by gravdigaz6, Yesterday, 11:40 PM
          1 response
          8 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by MarianApalaghiei, Yesterday, 10:49 PM
          3 responses
          10 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Working...
          X