Sometimes the orders are not working as we expect. So we need to track them to see what’s going on there.

TraceOrders is a useful property when debugging the behavior of your orders. With the use of this property, you can track orders placed, amended, and cancelled. The traces displayed in the NinjaScript Output window or if used, in the OnOrderTrace Override in the script where this was set. This will provide meaningful information for diagnosis when NinjaTrader ignores, changes or cancels orders when various strategy order methods are called.

Examples

protected override void Initialize()
{
TraceOrders = true;
}

The output will reference a method “PlaceOrder()” which is an internal method that all Enter() and Exit() methods use.

By admin

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.