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 CarlTrading, 03-31-2026, 09:41 PM
            1 response
            67 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            36 views
            0 likes
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            60 views
            1 like
            Last Post CaptainJack  
            Started by CarlTrading, 03-30-2026, 11:51 AM
            0 responses
            62 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 03-30-2026, 11:48 AM
            0 responses
            53 views
            0 likes
            Last Post CarlTrading  
            Working...
            X