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 Hwop38, 05-04-2026, 07:02 PM
            0 responses
            168 views
            0 likes
            Last Post Hwop38
            by Hwop38
             
            Started by CaptainJack, 04-24-2026, 11:07 PM
            0 responses
            322 views
            0 likes
            Last Post CaptainJack  
            Started by Mindset, 04-21-2026, 06:46 AM
            0 responses
            246 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by M4ndoo, 04-20-2026, 05:21 PM
            0 responses
            350 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