BarsSinceExitExecution()
<< Click to Display Table of Contents >> BarsSinceExitExecution() |
Returns the number of bars that have elapsed since the last exit. When a signal name is provided, the number of bars that have elapsed since that last specific exit will be returned.
An int value that represents a number of bars. A value of -1 will be returned if a previous exit does not exist.
The following method signature should be used when working with multi-time frame and instrument strategies:
BarsSinceExitExecution(int barsInProgressIndex, string signalName, int exitExecutionsAgo)
Note: When working with a multi-series strategy the BarsSinceExitExecution() will return you the elapsed bars as determined by the first Bars object for the instrument specified in the barsInProgressIndex. |
signalName |
The signal name of an exit order specified in an order exit method. |
barsInProgressIndex |
The index of the Bars object the entry order was submitted against.
Note: See the BarsInProgress property. |
exitExecutionsAgo |
Number of exit executions ago. Pass in 0 for the number of bars since the last exit execution. |
Tip: Please see SetStopLoss(), SetProfitTarget() or SetTrailStop() for their corresponding signal name |
protected override void OnBarUpdate() |