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

Autoscaling Indicators

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

    Autoscaling Indicators

    I don't understand why I can't get the chart to autoscale to the bar range and ignore the indicator lines I'm drawing. There should be at least some way to set this in the indicator code if not in the settings. Shouldn't there? I attached a chart to illustrate what I'm referring to. As you can see in the chart all the price bars are in the upper half of the screen and its apparently scaling on the PrevHigh on the top and the ONLow on the bottom. Any idea if there is a way to fix this?
    Attached Files

    #2
    Ed, in the Visual settings for the indicator there's an AutoScale property, if you set this to false - would you still see an issue?
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Yes, the AutoScale property is set to false on both these indicators both in the indicator settings and AutoScale = false has been added to both indicators Initialize section.

      Comment


        #4
        Ok, would make sense if those lines are not created via plots - then the drawing overloads would have a separate autoScale parameter you would set from the code directly.

        BertrandNinjaTrader Customer Service

        Comment


          #5
          Autoscaling Indicators

          Bertrand,

          Thanks for your expeditious response. So I tried converting these lines from a plot to a DrawLine, and apparently I don't have a clue how to do this. Though the indicator compiled without errors, the lines disappeared from the chart. I've attached the Previous Day High and Low indicator. Could you please take a look and see what I'm doing wrong.

          Thanks in advance.
          Attached Files

          Comment


            #6
            Any error in your Control Center log tab? Looks like you miss a CurrentBars check to prevent accessing unavailable bars at the chart series start.



            You also use just one tag id for the drawing object, thus updating only one object - meaning you do not keep the history of objects, as just the current one is continuously modified.

            BertrandNinjaTrader Customer Service

            Comment


              #7
              Autoscale Indicators

              OK, so I implemented the changes you specified in your response to my post and the Previous day High and Low are showing up again on my charts however the chart is still not autoscaling to the pricebars only. It is still autoscaling to the Previous Day high and low just like it was doing when I was plotting the lines. I have attached my new code. Please HELP!!
              Attached Files

              Comment


                #8
                You still have the DrawText set to autoscale for the PrevHigh. Can you try setting these to false and see if it is still autoscaling?

                DrawText("PivotTag1",false,"PrevHigh",-1,prevHigh,0,Color.Red,textFont,StringAlignment.Ne ar, Color.Transparent, Color.Transparent, 0);

                DrawText("PivotTag2",false,"PrevLow ",-1,prevLow ,0,Color.Lime,textFont,StringAlignment.Near, Color.Transparent, Color.Transparent, 0);
                MatthewNinjaTrader Product Management

                Comment


                  #9
                  That did it. I thought that property had a different meaning in DrawText. Silly me.
                  Thanks a lot.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by rhyminkevin, Today, 04:58 PM
                  0 responses
                  2 views
                  0 likes
                  Last Post rhyminkevin  
                  Started by lightsun47, Today, 03:51 PM
                  0 responses
                  5 views
                  0 likes
                  Last Post lightsun47  
                  Started by 00nevest, Today, 02:27 PM
                  1 response
                  12 views
                  0 likes
                  Last Post 00nevest  
                  Started by futtrader, 04-21-2024, 01:50 AM
                  4 responses
                  47 views
                  0 likes
                  Last Post futtrader  
                  Started by Option Whisperer, Today, 09:55 AM
                  1 response
                  14 views
                  0 likes
                  Last Post bltdavid  
                  Working...
                  X