TraceOrders

<< Click to Display Table of Contents >>

Navigation:  NinjaScript > Language Reference > Strategy >

TraceOrders

Previous page Return to chapter overview Next page

Definition

Determines if OnOrderTrace() would be called for a given strategy.  When enabled, traces are generated and displayed in the NinjaScript Output window for each call of an order method providing confirmation that the method is entered and providing information if order methods are ignored and why. This is valuable for debugging if you are not seeing expected behavior when calling an order method. This property can be set programatically in the OnStateChange() method.

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

 

Property Value

This property returns true if the strategy will output trace information; otherwise, false.  Default value is false.

 

Syntax

TraceOrders

 

 

 

Examples

ns


protected override void OnStateChange()
{
    if (State == State.SetDefaults)
    {
        TraceOrders = true;
    }
}

 

Tips

1.See this article for more examples of how to utilize this property.
2.You can override the default output by using OnOrderTrace() in your strategy.