import { ComputedRef } from 'vue';
import { Taaccount } from '@/services/go/TaAccount/interface';
import { QueryErmcpTradePositionRsp } from '@/services/go/ermcp/futures/interface';

/**
 * 交易账户
 */
export interface TradeAccount extends Taaccount {
    equity: ComputedRef<number>; // 当前权益/净值
    availableBalance: ComputedRef<number>; // 可用余额/可用资金
    positionProfitAndLoss: ComputedRef<number>; // 总浮动盈亏/总持仓盈亏
    freezeAmount: ComputedRef<number>; // 冻结资金
    hazardRatio: ComputedRef<number>; // 风险率
    positionList: TradePosition[]; // 期货持仓列表
}

/**
 * 交易头寸
 */
export interface TradePosition extends QueryErmcpTradePositionRsp {
    openAveragePrice: ComputedRef<number>; // 开仓均价
    positionAveragePrice: ComputedRef<number>; // 持仓均价
    positionProfitAndLoss: ComputedRef<number>; // 浮动盈亏/持仓盈亏 - 对应市场收益权
    capitalization: ComputedRef<number>; // 市值 - 对应市场所有权
    positionProfitAndLossRate: ComputedRef<number>; // 盈亏比例
}