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 Hwop38, 05-04-2026, 07:02 PM
                0 responses
                160 views
                0 likes
                Last Post Hwop38
                by Hwop38
                 
                Started by CaptainJack, 04-24-2026, 11:07 PM
                0 responses
                308 views
                0 likes
                Last Post CaptainJack  
                Started by Mindset, 04-21-2026, 06:46 AM
                0 responses
                245 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by M4ndoo, 04-20-2026, 05:21 PM
                0 responses
                349 views
                0 likes
                Last Post M4ndoo
                by M4ndoo
                 
                Started by M4ndoo, 04-19-2026, 05:54 PM
                0 responses
                179 views
                0 likes
                Last Post M4ndoo
                by M4ndoo
                 
                Working...
                X