Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Ninja generated code

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

    Ninja generated code

    I am wondering what's the purpose of this array code in built-in ATR code

    ATR[] tmp = new ATR[cacheATR == null ? 1 : cacheATR.Length + 1];
    if (cacheATR != null)
    cacheATR.CopyTo(tmp, 0);
    tmp[tmp.Length - 1] = indicator;
    cacheATR = tmp;

    even I remove this one and compile it, NT always generate this array. Is this an indicator object ? I think this array cause a lot memory allocation when this indicator is running or being called from a strategy. This array code slows down NT when running this indicator. I believe all of NT indicators have this array code.

    #2
    Hello luxurious_04,

    Thank you for your post.

    This is used when another indicator calls the ATR. You will notice there are items for Indicators, Market Analyzer Columns, and Strategies in the Generated code. All of which can call the indicator.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by sjsj2732, Yesterday, 04:31 AM
    0 responses
    24 views
    0 likes
    Last Post sjsj2732  
    Started by NullPointStrategies, 03-13-2026, 05:17 AM
    0 responses
    282 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    280 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    131 views
    1 like
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    90 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Working...
    X