Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Custom Classes

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

    Custom Classes

    apologies if this is out of scope but could someone advise me because if I do the following Tools > Import appears to stop working NT8 (version 8.1.2.1)?

    creating a c# List of myClass

    Code:
    public class myIndicator : Indicator
    {
        List<myClass> myList = new List<myClass>();
    
        protected override void OnBarUpdate()
        {
    
            if (IsFirstTickOfBar)
            {
                myClass myItem = new myClass()
                myList.Add(myItem);
            }
        }
    }
    
    public class myClass
    {
            int myData;
    }


    This issue could be something else? but I just want to ask if this could potentially conflict with NT8 (version 8.1.2.1)
    Last edited by fingers; 12-03-2023, 05:47 AM.

    #2
    Hello fingers,

    Thanks for your post.

    NinjaTrader 8.1.2.1 does have the ability to use C# Lists in a custom NinjaScript.

    Using C# Linsts in a custom NinjaScript would go outside of the scope of support we would be able to provide you with in the Support department at NinjaTrader.

    I suggest doing a Google search for something like "working with C# Lists" to find more information about how to work with Lists in C#.

    The DotNetPearls publicly available link has some great information about working with C# Lists and examples: https://www.dotnetperls.com/list

    This forum thread will be open for other community members to share their insights on the topic.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      apologies I didn't make myself clear.

      I'm ok using C# Lists, my question was could the above code conflict with NT8 (version 8.1.2.1)? because Tools > Import doesn't work if I use it.

      if you need more detail let me know?

      Comment


        #4
        Hello fingers,

        Thanks for your notes.

        Was the script exported as an assembly (dll)?

        If so, is this a protected assembly by clicking the 'Protect compiled assembly' option when exporting the script?

        Please send us a reduced test script that is exported as a source file (not an assembly (dll)) so we may look into this further.

        Exporting: https://ninjatrader.com/support/help...nt8/export.htm
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        598 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        343 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        557 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        556 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X