Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Chart custom graphic performance issues

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

    Chart custom graphic performance issues

    I remember reading that the graphics performance is still looked into, but since I stumbled upon one of such issues let me explain it.
    I am converting my heatmap indicator - similar to your SwamiCharts (eg. SwamiStochastics).
    In the NT7 version I could use one rectangle with PathGradientBrush unfortunately this is no longer available in WPF and SharpDX. So the solution I attempted is for each value to have 4 rectangles with the following set up:
    4 3
    2 1
    where:
    1. is using the SolidColorBrush with the MainColor of the value
    2. is a LinearGradientBrush starting with MainColor and ending with PreviousColor (left)
    3. is a LinearGradientBrush starting with MainColor and ending with AboveColor
    4. is a RadialGradientBrush starting with MainColor and ending with PreviousAboveColor (left above)

    If for all rectangles I use SolidColorBrush the performance is quite good - I can resize the chart and Indicator panel, zoom in and out with no problem.
    When I switched to gradient brushes after eg. resize I have to wait few seconds before it draws anything and gives me the cursor back. I can combine rectangles 1 and 2 OR 1 and 3 but it still doesn't improve much since I am only removing SolidColorBrush from the equation.
    Are the issues I am experiencing the kind of issues you are currently looking to resolve?
    Also is there any other alternative to PathGradientBrush than the solution above?

    #2
    Would you mind sending in your indicator so our development team can run analysis? If you're finding poor performance with this implementation in B1, we may be able to use this as a benchmark to test future versions.

    platformsupport[at]ninjatrader[dot]com ATTN: Matthew

    We can see if we can find an alternative for you as well.
    MatthewNinjaTrader Product Management

    Comment


      #3
      Originally posted by NinjaTrader_Matthew View Post
      Would you mind sending in your indicator so our development team can run analysis? If you're finding poor performance with this implementation in B1, we may be able to use this as a benchmark to test future versions.

      platformsupport[at]ninjatrader[dot]com ATTN: Matthew

      We can see if we can find an alternative for you as well.
      I thought you may find it useful so I created the version of your SwamiStochastic with these issues - feel free to finalize it and use it as you please.
      Here is a screencast demonstrating the xGradientBrush performance issue:

      vs the one where all brushes are changed to SolidColorBrush:
      Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.


      I tried to comment in the code all the information you may need. Colors in the attached file are dummy colors selected to better highlight rectangle edges for development purposes.
      Attached Files

      Comment


        #4
        Hello gregid,

        The creation of linear gradient brushes is very cpu intensive.

        To make this easier on the cpu, I've re-coded your script to only create a new brush when there is a new bar. I've also made a second version that uses solid color brushes.

        Both versions run much faster.
        Attached Files
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by philmg, Today, 01:17 PM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_ChristopherJ  
        Started by cre8able, Today, 01:01 PM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by manitshah915, Today, 12:59 PM
        1 response
        3 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by ursavent, Today, 12:54 PM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by Mizzouman1, Today, 07:35 AM
        4 responses
        18 views
        0 likes
        Last Post Mizzouman1  
        Working...
        X