• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Update bar color dynamically

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

    Update bar color dynamically

    Does the 'TransformBrush' check for brush overrides at the indicator level? If I'm writing candlestyle code that wishes to 'fix' or change the color of the candles dynamically via a volume parameter, would the following be the right way of going about it?

    Code:
    SharpDX.Color cb;
    cb = new ColorBGRA(0, 255, 0, 255);.
    SharpDX.Direct2D1.Brush cbrush = new SharpDX.Direct2D1.SolidColorBrush(RenderTarget, cb);
    Do you have a better suggestion? By which other means can I update a bar's color dynamically based on some other parameter?

    #2
    Hello bkinvent,

    Thanks for your post and welcome to the forums.

    Are you wanting to do this in OnRender() or do you prefer to do this in OnBarUpdate()?
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Is it possible for you to comment on both? What's the difference between changing color in OnRender() and OnBarUpdate? Is it possible to use OnBarUpdate() for a custom Chartstyle? Similarly, for a custom indicator, what benefits is there for one to make use of OnRender()? Is it possible to incorporate an indicator within a custom ChartStyle?

      Comment


        #4
        Hello bkinvent,

        Thanks for your post.

        Please do not duplicate posts and continue your conversation here: http://ninjatrader.com/support/forum...ad.php?t=75762

        Thank-you.
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Sorry, I guess I'm new, but that should've been obvious. Thank you for your reminder!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by jeliner, 02-05-2019, 09:01 AM
          6 responses
          336 views
          0 likes
          Last Post NinjaTrader_PatrickG  
          Started by pmallya.nt, Today, 12:55 PM
          0 responses
          14 views
          0 likes
          Last Post pmallya.nt  
          Started by itrader46, Today, 12:39 PM
          2 responses
          6 views
          0 likes
          Last Post itrader46  
          Started by rtwave, Today, 12:46 PM
          0 responses
          3 views
          0 likes
          Last Post rtwave
          by rtwave
           
          Started by Zeos6, Today, 11:45 AM
          2 responses
          8 views
          0 likes
          Last Post Zeos6
          by Zeos6
           
          Working...
          X