trade

Test blocks only: a value of closed trade `index` (0 = the oldest). Fields: direction, entry_price, exit_price, size, pnl, stop, target. direction is 1 long, -1 short; stop and target are na without one. An index out of range gives na.

trade(index: int, field: string) -> float

Parameters

Example

expect(trade(0, "direction"), 1)