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 SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    35 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    20 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    12 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    18 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    20 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X