Skip to content

TradeDiffRecord

📄 Structure: TradeDiffRecord

Used in trade plugins to represent order modifications (diffs).

Field Type Description
volume int Order volume in minimal lot units (e.g., 100 = 0.1 lots)
open_time time_t Order open time (Unix timestamp)
state int Current order state (see TS_* enum)
open_price double Order open price
sl double Stop Loss level
tp double Take Profit level
close_time time_t Order close time, if closed
expiration time_t Order expiration time (for pending orders)
reason int Reason for order creation (see TR_REASON_* enum)
commission double Commission charged for the trade
storage double Swap (overnight fee)
close_price double Price at which the order was closed
taxes double Taxes applied to the trade
magic int Magic number (usually used by EAs or advisors)
comment string Order comment
gw_order int Order ID in the external gateway
activation int Type of order activation (see ACTIVATION_* enum)
gw_open_price short Open price reported by external gateway
gw_close_price short Close price reported by external gateway
timestamp time_t Last modification timestamp