Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order objects must be private, why?

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

    Order objects must be private, why?

    Hello,

    I read somewhere in the forums from the support team that the usage of orders must or should be limited to private fields only, otherwise it causes problems.

    Code:
    private Order myOrder1, myOrder2;
    Can't seem to find the forum link, and the reference docs don't say a thing.

    I wonder why? I'd like to have the option to have them as public properties, is there an alternative?

    Regards,

    #2
    Hello Waxavi,

    Thanks for your post.

    There may be some types of objects which cannot be serialized, such as order objects, or you may not wish for this property to be saved/restored. Should that be the case, you can optionally set the object to be ignored by defining the XmlIgnore attribute.

    To have the order objects be public instead of private, you would need to make sure to use the [XmlIgnore] attribute.

    See this help guide documentation for more information: https://ninjatrader.com/support/help...eattribute.htm

    Let us know if we may further assist.
    <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
      Thanks, I thought it was something more complex will try it out.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      90 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      135 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      119 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      69 views
      0 likes
      Last Post PaulMohn  
      Working...
      X