Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

IOrder programming issue

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

    IOrder programming issue

    Hi,

    I have used an IOrder object to exit orders in a controlled fashion.

    It is not logging errors during Simulations.

    However, it is sending the following error message when the system attempts to run my ExitOrder command during a live demo run:

    "Failed to execute DB job 'StrategyUpdateJob': There was an error reflecting type 'NinjaTrader.Strategy.myExitOrder' of type NinjaTrader.Cbi.Order', see inner exception for more details.: Cannot serialize member NinjaTrader.Strategy.Strategy.myExitOrder of type NinjaTrader.Cbi.IOrder because it is an interface.

    I am confused because I have implemented ExitOrder as per the help file documentation.

    The following lists the programming commands where I have used it: can anyone point out my mistake?

    public IOrder myExitOrder = null;

    myExitOrder = ExitShortLimit(0, true, 1, 5.6, "ExitShortLimit", "EnterShortLimit");

    if (myExitOrder != null) { CancelOrder(myExitOrder); }


    protected override void OnOrderUpdate(IOrder order)
    {
    if (myExitOrder != null && myExitOrder.Token == order.Token)
    {
    //Print(order.ToString());
    if (order.OrderState == OrderState.Filled)
    {
    myExitOrder = null;
    }
    }
    }

    #2
    Help file suggests having this "private" and not public:
    public IOrder myExitOrder = null;
    DierkNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by jeanne, Today, 03:43 AM
    1 response
    18 views
    0 likes
    Last Post NinjaTrader_ShawnB  
    Started by Titli, Today, 09:36 AM
    0 responses
    20 views
    0 likes
    Last Post Titli
    by Titli
     
    Started by Mongo, Today, 09:28 AM
    0 responses
    6 views
    0 likes
    Last Post Mongo
    by Mongo
     
    Started by akvevo, Today, 08:59 AM
    1 response
    12 views
    0 likes
    Last Post NinjaTrader_ShawnB  
    Started by vantojo, Today, 08:14 AM
    0 responses
    8 views
    0 likes
    Last Post vantojo
    by vantojo
     
    Working...
    X