Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawRegion Problems

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

    DrawRegion Problems

    Hi,

    I am trying to add a color fill for overbought/oversold areas of an indicator (i.e > 80 color fill the area)

    I have read everything and tried everything but it will not work, the indicator compiles without error, but nothing shows up...

    I am trying to just add this line of code into the indicator script:

    if (DoubleStochastics(10)[0] > 90)
    {
    DrawRegion("Upper" + CurrentBar, 1, 0, DoubleStochastics(10), Color.Black, Color.Gold, 5);

    any help is greatly appreciated...

    Thanks,
    R.T.

    #2
    Hello RT,
    Thanks for writing in and I am happy to assist you.

    If you the custom indicator plots on a different panel (i.e. Overlay = false), then please do make sure you have set DrawOnPricePanel to false in the Initialize section of the code.

    I can assist you further if you post the indicator here or send it to support[AT]ninjatrader[DOT]com. Please do append Attn:Joydeep in the subject line and refer this thread in the body of the email.

    Please let me know if I can assist you any further.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Thanks,

      I only have one plot on the indicator, the overbought and oversold are Lines, do you need 2 plots for DrawRegion?

      Comment


        #4
        Hello RT,
        To draw a region you need atleast one data series. Please refer to the various overloads which a DrawRegion accepts http://www.ninjatrader.com/support/h...drawregion.htm

        If you have no data series then please draw a rectangle instead using the DrawRectangle method http://www.ninjatrader.com/support/h...wrectangle.htm

        Please let me know if I can assist you any further.
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          Thanks for the help Joydeep,

          Got it all worked out last night... Just had to change this line of code:

          ("Upper" + CurrentBar, 1, 0,

          Thanks again,
          R.T.

          Comment


            #6
            Hello RT,
            Glad you could make it work.
            Please let me know if I can assist you any further.
            JoydeepNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            571 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            331 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
            549 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            550 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X