Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

draw between 2 averages

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

    draw between 2 averages

    so I'm trying to have a green area where the slope of the 2 moving averages is both up, and a red area where the slope of the 2 moving averages is down. The slope being defined as just the value of the moving average now, currently, compared to the value at close of last bar. This is not working out well.... code attached. Right now both red and green are drawing at the same time I think. I'm sure I'm not seeing something obvious... any help would be appreciated. Thanks.
    Attached Files

    #2
    Hello tvaughan4,

    Thanks for your post.

    As is your code will error out (check the "Log" tab of the control center for the error message).

    You have public outputs but have not created them (the addplots are commented out). If you uncomment them and recompile the indicator will produce plots in the indicator panel and the draw.region will draw the region on the price panel.

    The draw region can only ever be one color at a time because you are using the same tag name for the red and for the green and you are drawing the region from the first bar of the series to the current bar each time, therefore which ever condition last draws the region, that is the color it will be from beginning to end.

    If you want to region to be colored as the conditions occur and to retain their colors then you will need to add much more logic to be able to draw separate regions. This would involve using unique tag names for each separate region and saving/using specific start/end bars for the regions. You can find an example of the type of logic needed in the NT user apps indicator: https://ninjatraderecosystem.com/use...plestate_v4-2/ Please note: The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.

    Comment


      #3
      would you mind attaching that indicator here? the downloads don't seem to be working in the ecosystem right now.

      ya, I tried the different tag names. I had a feeling it was the start/stop times and tag names. not as easy as I would have hoped it seems...

      Comment


        #4
        Hello tvaughan4,

        Thanks for your reply.
        • I am having no difficulty downloading from the link. We'll need more information to find out why you're unable to download from our Ecosystem site. Please answer all of the following questions:
          • What version of Windows are you using?
          • What web browser are you using?
          • Does this symptom persist if your clear your browser's cache?
          • What about if you use a different web browser?
          • What about after you turn off your PC, turn off your modem/router for at least 30 seconds, then restart your PC?

        Comment


          #5
          ya, I've done everything... Windows 10, using brave, firefox, chrome, cleared everything out, restarted. Posted about it in another thread regarding this issue, it seems to be an issue for a number of people.

          Comment


            #6
            Hello tvaughan4,

            Thanks for your reply.

            Please send an e-mail to PlatformSupport[AT]Ninjatrader[dot]Com, mark the e-mail Atten: Paul, ticket # 2502313. and include a link to this thread.

            Thanks in advance.

            Comment

            Latest Posts

            Collapse

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