• 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

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:
      http://screencast.com/t/D09jiLvY
      vs the one where all brushes are changed to SolidColorBrush:
      http://screencast.com/t/tYOMvfS1FDb

      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 cirzonorkecv, Yesterday, 11:52 PM
        0 responses
        6 views
        0 likes
        Last Post cirzonorkecv  
        Started by rickyblah12, Yesterday, 01:01 PM
        1 response
        14 views
        0 likes
        Last Post Erwin Beckers  
        Started by dadarara, Yesterday, 12:18 PM
        0 responses
        8 views
        0 likes
        Last Post dadarara  
        Started by joemiller, Yesterday, 07:33 AM
        2 responses
        13 views
        0 likes
        Last Post joemiller  
        Started by TheGameOfProbabilities, 07-18-2019, 06:56 AM
        7 responses
        38 views
        0 likes
        Last Post DaveS
        by DaveS
         
        Working...
        X