PineForge v0.1.2-7-ga095e36
Deterministic PineScript v6 backtest runtime — C ABI reference
Loading...
Searching...
No Matches
pf_trade_t Struct Reference

Closed-trade record returned in pf_report_t::trades. More...

#include <pineforge.h>

Data Fields

int64_t entry_time
 Entry fill time (Unix ms).
 
int64_t exit_time
 Exit fill time (Unix ms).
 
double entry_price
 Entry fill price (incl.
 
double exit_price
 Exit fill price (incl.
 
double pnl
 Net realized PnL in account currency.
 
double pnl_pct
 Net realized PnL as a percentage of entry capital.
 
int is_long
 1 if long, 0 if short.
 
double max_runup
 Peak favorable price travel during the trade ($/unit qty).
 
double max_drawdown
 Peak adverse price travel during the trade ($/unit qty).
 
double qty
 Filled quantity.
 

Detailed Description

Closed-trade record returned in pf_report_t::trades.

Layout-compatible with internal pineforge::TradeC.

Definition at line 107 of file pineforge.h.

Field Documentation

◆ entry_time

int64_t pf_trade_t::entry_time

Entry fill time (Unix ms).

Definition at line 108 of file pineforge.h.

◆ exit_time

int64_t pf_trade_t::exit_time

Exit fill time (Unix ms).

Definition at line 109 of file pineforge.h.

◆ entry_price

double pf_trade_t::entry_price

Entry fill price (incl.

slippage).

Definition at line 110 of file pineforge.h.

◆ exit_price

double pf_trade_t::exit_price

Exit fill price (incl.

slippage).

Definition at line 111 of file pineforge.h.

◆ pnl

double pf_trade_t::pnl

Net realized PnL in account currency.

Definition at line 112 of file pineforge.h.

◆ pnl_pct

double pf_trade_t::pnl_pct

Net realized PnL as a percentage of entry capital.

Definition at line 113 of file pineforge.h.

◆ is_long

int pf_trade_t::is_long

1 if long, 0 if short.

Definition at line 114 of file pineforge.h.

◆ max_runup

double pf_trade_t::max_runup

Peak favorable price travel during the trade ($/unit qty).

Definition at line 115 of file pineforge.h.

◆ max_drawdown

double pf_trade_t::max_drawdown

Peak adverse price travel during the trade ($/unit qty).

Definition at line 116 of file pineforge.h.

◆ qty

double pf_trade_t::qty

Filled quantity.

Definition at line 117 of file pineforge.h.


The documentation for this struct was generated from the following file: