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 NullPointStrategies, Today, 05:17 AM
      0 responses
      44 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      124 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      65 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      42 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      46 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X