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.

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理