OnCopyTo()

<< Click to Display Table of Contents >>

Navigation:  NinjaScript > Language Reference > Performance Metrics >

OnCopyTo()

Previous page Return to chapter overview Next page

Definition

Called as the values of a trade metric are saved.

 

Syntax

protected override void OnCopyTo(PerformanceMetricBase target)
{
 
}

 

Examples

ns


protected override void OnCopyTo(PerformanceMetricBase target)
{
  // You need to cast, in order to access the right type
  SampleCumProfit targetMetrics = (target as SampleCumProfit);
 
  if (targetMetrics != null)
    Array.Copy(Values, targetMetrics.Values, Values.Length);
}