Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawRegion Using Static Values

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

    DrawRegion Using Static Values

    I'd like to take two variables that are manually set and input them as the upper and lower values for DrawRegion.

    For example, the end result i'm looking for is to input 1400.00 and 1405.00 in the indicator variables and have the indicator draw and color the region between these two points.

    I currently get an error stating "cannot convert 'double' to 'NinjaTrader.Data.IDataSeries'"

    How can I accomplish this? Thanks.

    #2
    Mike, can you please provide a sample call / snippet you're using so we could look into?

    Comment


      #3
      DrawRegion("ShortArea1",CurrentBar, 0, shortArea1Upper, shortArea1Lower, Color.Black, Color.Gray, 20);

      shortArea1Upper and shortArea1Lower are double values that I set via the GUI interface.

      Comment


        #4
        Thanks, see the issue now - one parameter has to be a series, you could not supply two doubles to work with directly. You could set the user input value to a series in OnBarUpdate() though and then feed this value into your DrawRegion() call.

        Comment


          #5
          That worked great. Thanks!

          Comment


            #6
            I'm was looking at this thread and don't understand the details. DrawRegion requires one dataseries and one double.

            I want to set the dataseries input to a fixed value.

            Exactly how do I do this?

            Thanks,
            taddypole...

            Comment


              #7
              DrawRegion() does have different overloads that can be used: http://www.ninjatrader.com/support/h...drawregion.htm

              You can pass it two data series, or a data series and a y value.

              Example:
              DrawRegion("tag1", CurrentBar, 0, Bollinger(2, 14).Upper, 52, Color.Empty, Color.Lime, 2);

              If you wanted two fixed points you could use DrawRectangle instead: http://www.ninjatrader.com/support/h...wrectangle.htm
              LanceNinjaTrader Customer Service

              Comment


                #8
                Thanks Lance,

                The rectangle was the best solution.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                574 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                333 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                101 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                553 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                551 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X