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 charlesugo_1, 05-26-2026, 05:03 PM
            0 responses
            67 views
            0 likes
            Last Post charlesugo_1  
            Started by DannyP96, 05-18-2026, 02:38 PM
            1 response
            150 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 05-11-2026, 05:56 AM
            0 responses
            162 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 05-10-2026, 08:12 PM
            0 responses
            99 views
            0 likes
            Last Post CarlTrading  
            Started by Hwop38, 05-04-2026, 07:02 PM
            0 responses
            286 views
            0 likes
            Last Post Hwop38
            by Hwop38
             
            Working...
            X