Profile Picture

NullReferenceException : SetValueCore

Posted By alpha23 6 Years Ago
Posted Friday October 05 2012
the following exception is thrown at end of day. MOC orders may be the cause. The exception is thrown outside of system and broker code (using TWS). Can you provide insight into what the issue may be because it terminates a live system?

An exception of type System.NullReferenceException was thrown.
Object reference not set to an instance of an object.
at RightEdgeUI.GridFormatCell.SetValueCore(Object value)
at RightEdge.LiveSystemwindow.x5f9b399496adfbe8(PositionInformation x8d3f74e5f925679c)
at RightEdge.LiveSystemwindow.x8fc0d816911af80f(PositionInformation x8d3f74e5f925679c)
at RightEdge.LiveSystemwindow.x516efd9a6cd87a3f()
at RightEdge.LiveSystemwindow.x8c3b46858f2d1101()

Thanks, Duane
Posted Wednesday October 17 2012
please let me know.

Posted Thursday November 08 2012
I think I figured out what is causing this. It may be happening when a trade is filled where the Description of the trade is null. We will work on fixing it for the next build, but you can also try setting the Description on all orders you submit to see if that helps with the issue.

Posted Sunday November 11 2012
I've verified that this error is caused by an order with a Description set to null. This will be fixed in the next build, and you may be able to work around it in the meantime by setting the Description on all your orders (an empty string is fine).

Posted Wednesday November 14 2012
For BrokerOrder, used for MOC orders, how do I set Description since it is not available in the api?

Thanks, Duane
Posted Wednesday November 14 2012
How are you creating the MOC order from your system? If you create an OrderSettings object you should be able to set the type to MarketOnClose and also set the Description, then submit it with Position.SubmitOrder().

Posted Thursday November 15 2012
I’m creating MOC orders using BrokerOrder because of the issue of being able to handle positions manually ( Since there is not an existing position in RE in this case, even though the position exists in the live account, I must place subsequent orders via BrokerOrder.

The root of all the problems is that RE and TWS become un-synced. I can handle with a resolution to the linked topic above because my code paths will be collapsed to one; however, ultimately having RE and TWS synced regardless of network connectivity, exceptions, etc is the best way to simplify and eliminate any issues.

Can we please quickly find a scalable resolution to the linked topic above for the time being - entering by hand will not work because, for example, yesterday I had 50 positions open - until it can be guaranteed that RE and TWS will always be synced - because when one problem arises, such as Description being required to be set which is an easy fix, it cascades into a series of other issues?

Thanks, Duane

Edited: Thursday November 15 2012 by alpha23

Similar Topics

Reading This Topic

2005-2018 © RightEdge Systems