PDF下载 下载

交易类

阅读 1271

Account - 账户结构

  1. public class Account
  2. {
  3. public string accountId; //账号ID
  4. public string accountName; //账户登录名
  5. public string title; //账号名称
  6. public string intro; //账号描述
  7. public string comment; //账号备注
  8. };

AccountStatus - 账户状态结构

  1. public class AccountStatus
  2. {
  3. public string accountId; //账号ID
  4. public string accountName; //账户登录名
  5. public int state; //账户状态
  6. public int errorCode; //错误码
  7. public string errorMsg; //错误信息
  8. };

Order - 委托结构

  1. public class Order
  2. {
  3. public string strategyId; //策略ID
  4. public string accountId; //账号ID
  5. public string accountName; //账户登录名
  6. public string clOrdId; //委托客户端ID
  7. public string orderId; //委托柜台ID
  8. public string exOrdId; //委托交易所ID
  9. public string symbol; //symbol
  10. public int side; //买卖方向,取值参考enum OrderSide
  11. public int positionEffect; //开平标志,取值参考enum PositionEffect
  12. public int positionSide; //持仓方向,取值参考enum PositionSide
  13. public int orderType; //委托类型,取值参考enum OrderType
  14. public int orderDuration; //委托时间属性,取值参考enum OrderDuration
  15. public int orderQualifier; //委托成交属性,取值参考enum OrderQualifier
  16. public int orderSrc; //委托来源,取值参考enum OrderSrc
  17. public int status; //委托状态,取值参考enum OrderStatus
  18. public int ordRejReason; //委托拒绝原因,取值参考enum OrderRejectReason
  19. public string ordRejReasonDetail; //委托拒绝原因描述
  20. public double price; //委托价格
  21. public double stopPrice; //委托止损/止盈触发价格
  22. public int orderStyle; //委托风格,取值参考 enum OrderStyle
  23. public Int64 volume; //委托量
  24. public double value; //委托额
  25. public double percent; //委托百分比
  26. public Int64 targetVolume; //委托目标量
  27. public double targetValue; //委托目标额
  28. public double targetPercent; //委托目标百分比
  29. public Int64 filledVolume; //已成量
  30. public double filledVwap; //已成均价
  31. public double filledAmount; //已成金额
  32. public double filledCommission; //已成手续费
  33. public DateTime createdAt; //委托创建时间
  34. public DateTime updatedAt; //委托更新时间
  35. };

ExecRpt - 回报结构

  1. public class ExecRpt
  2. {
  3. public string strategyId; //策略ID
  4. public string accountId; //账号ID
  5. public string accountName; //账户登录名
  6. public string clOrdId; //委托客户端ID
  7. public string orderId; //委托柜台ID
  8. public string execId; //委托回报ID
  9. public string symbol; //symbol
  10. public int positionEffect; //开平标志,取值参考enum PositionEffect
  11. public int side; //买卖方向,取值参考enum OrderSide
  12. public int ordRejReason; //委托拒绝原因,取值参考enum OrderRejectReason
  13. public string ordRejReasonDetail; //委托拒绝原因描述
  14. public int execType; //执行回报类型, 取值参考enum ExecType
  15. public double price; //委托成交价格
  16. public Int64 volume; //委托成交量
  17. public double amount; //委托成交金额
  18. public double commission; //委托成交手续费
  19. public double cost; //委托成交成本金额
  20. public DateTime createdAt; //回报创建时间
  21. };

Cash - 资金结构

  1. public class Cash
  2. {
  3. public string accountId; //账号ID
  4. public string accountName; //账户登录名
  5. public int currency; //币种
  6. public double nav; //净值(cum_inout + cum_pnl + fpnl - cum_commission)
  7. public double pnl; //净收益(nav-cum_inout)
  8. public double fpnl; //浮动盈亏(sum(each position fpnl))
  9. public double frozen; //持仓占用资金
  10. public double orderFrozen; //挂单冻结资金
  11. public double available; //可用资金
  12. public double balance; //资金余额
  13. public double cumInout; //累计出入金
  14. public double cumTrade; //累计交易额
  15. public double cumPnl; //累计平仓收益(没扣除手续费)
  16. public double cumCommission; //累计手续费
  17. public double lastTrade; //上一次交易额
  18. public double lastPnl; //上一次收益
  19. public double lastCommission; //上一次手续费
  20. public double lastInout; //上一次出入金
  21. public int changeReason; //资金变更原因,取值参考enum CashPositionChangeReason
  22. public string changeEventId; //触发资金变更事件的ID
  23. public DateTime createdAt; //资金初始时间
  24. public DateTime updatedAt; //资金变更时间
  25. };

Position - 持仓结构

  1. public class Position
  2. {
  3. public string accountId; //账号ID
  4. public string accountName; //账户登录名
  5. public string symbol; //symbol
  6. public int side; //持仓方向,取值参考enum PositionSide
  7. public Int64 volume; //总持仓量; 昨持仓量(volume-volume_today)
  8. public Int64 volumeToday; //今日持仓量
  9. public double vwap; //持仓均价
  10. public double amount; //持仓额(volume*vwap*multiplier)
  11. public double price; //当前行情价格
  12. public double fpnl; //持仓浮动盈亏((price-vwap)*volume*multiplier)
  13. public double cost; //持仓成本(vwap*volume*multiplier*margin_ratio)
  14. public Int64 orderFrozen; //挂单冻结仓位
  15. public Int64 orderFrozenToday; //挂单冻结今仓仓位
  16. public Int64 available; //非挂单冻结仓位(volume-order_frozen); 可平昨仓位(available-available_today)
  17. public Int64 availableToday; //非挂单冻结今仓位(volume_today-order_frozen_today)
  18. public double lastPrice; //上一次成交价
  19. public Int64 lastVolume; //上一次成交量
  20. public Int64 lastInout; //上一次出入持仓量
  21. public int changeReason; //仓位变更原因,取值参考enum CashPositionChangeReason
  22. public string changeEventId; //触发资金变更事件的ID
  23. public int hasDividend; //持仓区间有分红配送
  24. public DateTime createdAt; //建仓时间
  25. public DateTime updatedAt; //仓位变更时间
  26. };

Indicator - 绩效指标结构

  1. public class Indicator
  2. {
  3. public string accountId; //账号ID
  4. public double pnlRatio; //累计收益率(pnl/cum_inout)
  5. public double pnlRatioAnnual; //年化收益率
  6. public double sharpRatio; //夏普比率
  7. public double maxDrawdown; //最大回撤
  8. public double riskRatio; //风险比率
  9. public int openCount; //开仓次数
  10. public int closeCount; //平仓次数
  11. public int winCount; //盈利次数
  12. public int loseCount; //亏损次数
  13. public double winRatio; //胜率
  14. public DateTime createdAt; //指标创建时间
  15. public DateTime updatedAt; //指标变更时间
  16. };

Parameter - 动态参数结构

  1. public class Parameter
  2. {
  3. public string key; //参数键
  4. public double value; //参数值
  5. public double min; //可设置的最小值
  6. public double max; //可设置的最大值
  7. public string name; //参数名
  8. public string intro; //参数说明
  9. public string group; //组名
  10. public bool readonlyFlag; //是否只读
  11. };
0 篇笔记