dbo.fn_TradeProperty

Syntax:
dbo.fn_TradeProperty(id_trade, property)

Output:
(decimal) Returns properties of a trade.

Input parameters:
id_trade (integer)Id of the trade
property (string) Can return one of the following properties:
  • 'profit' = profit of the trade. If the trade is settled is a net profit (BF fees deducted), if not is a gross profit. If the parameter [id_trade] equals the current trade (@id_trade) the function returns the same value of the variable @trade_profit.
  • 'back_size' = sum of back sizes of all bets of the trade. Only cancelled bets are excluded.
  • 'lay_size' = sum of lay sizes of all bets of the trade. Only cancelled bets are excluded.
  • 'back_avg_price' = average price of all back bets. Weighted with sizes of the bets.
  • 'lay_avg_price' = average price of all lay bets. Weighted with sizes of the bets.
  • 'unmatched_bets' = count of unmatched or partially unmatched bets.

Example:

dbo.fn_TradeProperty(@id_trade,'profit')

returns the profit of the current trade.