AverageBarsInTrade

<< Click to Display Table of Contents >>

Navigation:  NinjaScript > Language Reference > Strategy > TradeCollection > TradesPerformance >

AverageBarsInTrade

Previous page Return to chapter overview Next page

Definition

Returns the average number of bars per trade.
 

Property Value

A double value that represents the average number of bars per trade.

 

Syntax
<TradeCollection>.TradesPerformance.AverageBarsInTrade

 

 

 

Examples

ns

protected override void OnBarUpdate()
{
    // Print out the average number of bars per trade of all trades
    Print("Average # bars per trade is: " + SystemPerformance.AllTrades.TradesPerformance.AverageBarsInTrade);
}