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 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 Shansen, 08-30-2019, 10:18 PM
            24 responses
            938 views
            0 likes
            Last Post spwizard  
            Started by Max238, Today, 01:28 AM
            0 responses
            3 views
            0 likes
            Last Post Max238
            by Max238
             
            Started by rocketman7, Today, 01:00 AM
            0 responses
            2 views
            0 likes
            Last Post rocketman7  
            Started by wzgy0920, 04-20-2024, 06:09 PM
            2 responses
            27 views
            0 likes
            Last Post wzgy0920  
            Started by wzgy0920, 02-22-2024, 01:11 AM
            5 responses
            32 views
            0 likes
            Last Post wzgy0920  
            Working...
            X