Support

Equilla Formula Language

EntryTime

Returns the time at which the specified position was entered.

Inputs

Position
Numeric: (Optional) The position to examine. Omit this parameter or use zero (0) to indicate the current position.
Index
Numeric: (Optional) The index of the entry order to examine. If omitted, the order which opened the position is used.

Remarks

The function returns the entry time as Time.

The Position parameter specifies the number of the referenced position relative to the current one. A value of zero (0) identifies the current position, a value of one (1) the previous one. If there are multiple entries per position the entry order can be selected by specifying the Index parameter, the index starts at 1.

Examples

Exit after a number of hours
Input: Price( Close ), Period( 10, 1 ), Hours( 2, 1 ); If Average( Price, Period ) Crosses Price Then Buy ("Long") Next Bar at Market Else If Price Crosses Average( Price, Period ) Then Short ("Short") Next Bar at Market; If MarketPosition <;>; MarketPositionFlat Then Begin If Date <;>; EntryDate( 0 ) Or Time = EntryTime( 0 ) + Hours * 100 Then ExitPosition Next Bar at Market; End;