AddPerformanceMetric()

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

AddPerformanceMetric()

Return to chapter overview

Definition

Adds an instance of custom Performance Metric to a strategy used in strategy calculations.

 

Method Return Value

This method does not return a value.

 

Syntax
AddPerformanceMetric(PerformanceMetricBase performanceMetric)

 

Warning:  This method should ONLY be called from the OnStateChange() method during State.Configure

 

 

Parameters

performanceMetric

The performance metric object to be added

 

 

 

Examples

ns

protected override void OnStateChange()
{
    if (State == State.Configure)
    {
        AddPerformanceMetric(new NinjaTrader.NinjaScript.PerformanceMetrics.SampleCumProfit());
    }
}