Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Drawing method optimization

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

    Drawing method optimization

    Hello! I'm working on a Ichimoku indicator and I used Draw.Region() function in order to draw the kumo (the cloud) 26 periods in the future as we don't have the ability to displace a specific dataSerie/Line in a multi line indicator like Ichimoku.
    Here is a part of my code :

    ```
    protected override void OnBarUpdate()
    {
    ...
    Values[2][0] = senkouSpanA; // Senkou Span A
    Values[3][0] = senkouSpanB; // Senkou Span B​
    // Use DrawRegion to fill the area between Senkou Span A and Senkou Span B
    string regionID = "KumoCloud" + CurrentBar;
    Brush outlineColor = new SolidColorBrush(Color.FromArgb(70, 78, 45, 13));
    Brush areaColor = new SolidColorBrush(Color.FromArgb(30, 54, 137, 164));
    Draw.Region(this, regionID, CurrentBar, 0, Values[2], Values[3], outlineColor, areaColor, 100, 26);
    }
    ```
    The thing is this method draw a slice of the cloud for every bar and there is a lot of drawing objects on the chart. If I extend the chart too much this become laggy.
    Do you know if there is a better way to draw the ichimoku cloud on the chart ?

    #2
    Hello Tessan,

    You may find the ichimoku indicators on the User App Share have helpful code for adjusting the region displacement.


    This thread will remain open for any community members that would like to provide advice as to what logic you should write.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

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