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

Barbrush priority

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

    Barbrush priority

    Hello,

    I have an indicator that paints all bars, either up colour, or red colour. I also have an indicator which paints an occasional bar pink.

    I've played with the order of the indicators in the list. No difference. Both indicators are set to onbarclose. I have no pink bars.

    Is there a priority, in any way, for 2 indicators that change the barbrush of the same bar, onbarclose?

    I hope this makes sense.

    Thanks.

    #2
    Hello pjsmith,

    Thank you for the post.

    I do see that subsequently added indicators will omit their BarBrush if a previously loaded indicator has already painted that bar. I tested this in NT7 and NT8 currently matches the NT7 output so it looks like this is expected here. In my test, I had indicator A paint all bars red, and indicator B paint all bars blue. I only can see red bars if Indicator A loads first, otherwise, if indicator B is loaded first I see all blue bars.

    I would be unsure how this could be handled differently if the slot is already filled with a color. It looks like currently, the first item in the indicator list takes the authority over the slot when it paints it. Would you have a suggestion on how you would like two separate indicators painting the same bar to be handled differently? I can put in a feature request for this, I am just unsure of a different way to handle it to provide a feature request.

    The alternative would be to combine your two indicators into one where you have have an If else else statement or 3 different possible states where one of the 3 states colors the bar at a time. This is the easiest solution if you need the overlapping bars to be painted, or to make the logic work in that way.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thanks for the quick reply. I am specifically trying to keep these indicators separate, because they are very unrelated. I could change to marking the bars with symbols etc., but I prefer to try and keep the chart clean and all the drawing objects can be a pain to manage/process.

      If there were a feature to do this, I would suggest that the last indicator in the list is the one that has priority, for instance.

      Indicator 1 paints all bars green
      indicator 2 paints 1 bar pink

      Then you get all green bars with 1 pink.

      So, if indicators are processed in order, I seems simple to let them all paint the bar and the last indicator processed leaves the bar the colour it set, if at all.

      That makes total sense to me and you could easily manage the order in the indicator list moving them up and down.

      For now, I guess I'll have to mark the bar in another way.

      Thanks.
      Last edited by pjsmith; 06-15-2018, 02:46 PM.

      Comment


        #4
        Please,

        I did an indicator that paints bars with Brush. But the actual bar, the last bar, don't paint. Just when the bar closes. I'm using the code inside the OnBarUpdate. What's wrong?

        Comment


          #5
          Hello earmarques ,

          Thanks for your post and welcome to the Ninjatrader forums.

          Based on your description the likely issue is running the indicator with Calculate.OnBarClose which will only process your code when the currently forming bar closes. If you want to color the currently forming bar, you can use either of the other two modes of Calculate.OnPriceChange or Calculate.OnEachTick.
          Reference: https://ninjatrader.com/support/help...?calculate.htm

          Paul H.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by bortz, 11-06-2023, 08:04 AM
          47 responses
          1,607 views
          0 likes
          Last Post aligator  
          Started by jaybedreamin, Today, 05:56 PM
          0 responses
          9 views
          0 likes
          Last Post jaybedreamin  
          Started by DJ888, 04-16-2024, 06:09 PM
          6 responses
          19 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by Jon17, Today, 04:33 PM
          0 responses
          6 views
          0 likes
          Last Post Jon17
          by Jon17
           
          Started by Javierw.ok, Today, 04:12 PM
          0 responses
          15 views
          0 likes
          Last Post Javierw.ok  
          Working...
          X