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

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?
    BertrandNinjaTrader Customer Service

    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.
        BertrandNinjaTrader Customer Service

        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 judysamnt7, 03-13-2023, 09:11 AM
                4 responses
                53 views
                0 likes
                Last Post DynamicTest  
                Started by ScottWalsh, Today, 06:52 PM
                4 responses
                33 views
                0 likes
                Last Post ScottWalsh  
                Started by olisav57, Today, 07:39 PM
                0 responses
                5 views
                0 likes
                Last Post olisav57  
                Started by trilliantrader, Today, 03:01 PM
                2 responses
                19 views
                0 likes
                Last Post helpwanted  
                Started by cre8able, Today, 07:24 PM
                0 responses
                6 views
                0 likes
                Last Post cre8able  
                Working...
                X