Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error on public order

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

    Error on public order

    Hello

    The following line on UserDefinedMethods creates an error (see attached image) when i create a new strategy from strategies bar:

    partial class Strategy
    {
    public IOrder _entryOrder = null;

    The is no error when i change it to private.

    I don't understand why is it happening. is there a way remaining it public?

    10x
    Attached Files

    #2
    kiss,

    Where are you defining this partial class?
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      UserDefinedMethods

      Comment


        #4
        kiss,

        This is bordering on unsupported here, however why do you need a partial class here?

        Partial classes and members in C# split the definition of a class, a struct, an interface, or a member over two or more source files.
        Adam P.NinjaTrader Customer Service

        Comment


          #5
          This is the default for UserDefinedMethod. is simply didn't change it.
          I tried defining a regular class on the NinjaTrader.Strategy namespace in UserDefinedMethod, however there were compilation errors. For example, PrintWithTimeStamp gave a "The name PrintWithTimeStamp doesn'e exists in the current level" error.

          Comment


            #6
            kiss987, for the PrintWithTimeStamp it needs to be a partial class of NinjaTrader Strategy to be able to be used, it would only exist for strategies not for indicators (extending it is on our feedback list).

            The IOrder interface is not exposed (by design no strategy cross communication) and thus you unfortunately cannot serialize it.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by argusthome, Yesterday, 10:06 AM
            0 responses
            14 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            11 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            9 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            4 views
            0 likes
            Last Post TheRealMorford  
            Started by Mindset, 02-28-2026, 06:16 AM
            0 responses
            31 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Working...
            X