接口说明(内部接口定义,对外无用)

删除回忆录丶 提交于 2020-04-27 06:06:33

接口范例:(地址可能会有变更)

1.检验用户期货账号和密码 (socket),并且保存到接口网站数据库

有效时间:交易日 8:30- 15:30  20:30- 3:00

请求数据:
B|{"chk":1,"user_name":null,"account_id":5,"account_no":"061198","account_pw":"xxxxxx","broker_id":"","broker_name":"simnow",“margin_no”:"010716607265",“margin_pw”:"zg816891","is_login":0,
"catalog":0,"status":0,"remark":""}
返回值:同上,修改部分值
如果margin_no和margin_pw(保证金中心账号和密码)有值,将对其进行登录验证,验证成功后,启动数据采集进程。此功能涉及验证码(服务来做超级鹰http://www.chaojiying.com,收费)
B(命令类型)|(数据分隔),
{"chk":1固定,"user_name":null(可选),"account_id":5(系统唯一id,要在数据库唯一),"account_no":账号,"account_pw":密码,"broker_id":席位ID,"broker_name":席位名,“margin_no”:"010716607265",“margin_pw”:"zg816891",

"is_login":(返回值)是否登录成功,"catalog":(0跟单,1指引),"status":0,"remark":(返回值)登录备注}

解绑
C|{"chk":1,"user_name":null,"account_id":5,"account_no":"061198","account_pw":"xxxxxx","broker_id":"","broker_name":"simnow","is_login":0,"catalog":0,"status":0,"remark":"登录失败:061198"}

返回:C|{"chk":1,"user_name":null,"account_id":5,"account_no":"061198","account_pw":"xxxxxx","broker_id":"","broker_name":"simnow","is_login":0,"catalog":0,"status":1,"remark":"解绑成功"}
status>0成功, remark备注

更新密码:交易密码和保证金密码
D|{"chk":1,"user_name":null,"account_id":5,"account_no":"061198","account_pw":"xxxxxx","broker_id":"","broker_name":"simnow","is_login":0,"catalog":0,"status":0,"remark":""}

返回:D|{"chk":1,"user_name":null,"account_id":5,"account_no":"061198","account_pw":"xxxxxx","broker_id":"","broker_name":"simnow","is_login":0,"catalog":0,"status":1,"remark":"修改成功"}
status>0成功, remark备注

 2.设置用户跟单(socket),并且保存到接口网站数据库

接口网站会保存跟单设置。但是如果此跟单已经在运行,会根据最新设置改变状态如果未在执行或新增的,不会立即执行,而是等下次开盘加载数据时执行

请求数据:
K|{"_id":"5c24ef20c72a3412401bb3e8","user_name":"admin","from_date":"2018-12-26T00:00:00+08:00","end_date":"2019-12-27T23:59:59+08:00","keep_id":1,
"lead_id":22,"keep_no":"075402","lead_no":"061198","product_name":"admin","keep_dc":1,"vol_type":0,"keep_vol":1.0,"keep_pos":0,"open_slip":0,"close_slip":0,"in_inst":"","out_inst":"","max_inst":"",
"run_status":9,"create_time":"2018-12-27T23:26:24.501+08:00","excutor":"test","ip":"","noclear_ids":null,"b_syncpo":0}
返回值:同上,修改部分值
B(命令类型)|(数据分隔),
字段说明
public class T_Keep
    {
        public string _id { get; set; }//唯一id,24位objectid
        public string user_name { get; set; }//网站用户,可选
        public DateTime from_date { get; set; }//* 开始日期
        public DateTime end_date { get; set; }//*结束日期
        public int keep_id { get; set; } //*跟单账号id
        public int lead_id { get; set; } //*指引账号id
        public string keep_no{ get; set; }//*跟单账号no
        public string lead_no { get; set; }//*指引账号no
        public string product_name { get; set; }//产品名称,可选
        public int keep_dc { get; set; }//*跟单方向,1正向,-1反向
        public int vol_type { get; set; }//*手数类型,1固定手数,0:按比例
        public double keep_vol { get; set; }//*跟单数量
        public int keep_pos { get; set; }//*跟单位置:0报单,1成交
        public int open_slip { get; set; }//开仓滑点,正数快速成交,负数挂单
        public int close_slip { get; set; }//平仓滑点
        public string in_inst { get; set; }//仅跟合约: rb,hc  (逗号间隔)
        public string out_inst { get; set; }//排除合约: rb,hc  (逗号间隔)与上面的最多设置一个,排除设置优先
        public string max_inst { get; set; }//最大开仓数量限制,暂不起作用
        public int run_status { get; set; }//运行状态 1在运行,0暂停,-1:失效
        public DateTime create_time { get; set; } //创建时间
        public string excutor { get; set; }//执行者,分流过滤用
        public string ip { get; set; }//执行ip,分流过滤用
        public string noclear_ids { get; set; }//不检查裸仓合约,暂不用
        public int b_syncpo { get; set; }//是否执行同步(同步频率由跟单软件本地设置)
    }
返回值修改
run_status (<0:设置失败 >0设置成功 0不做保存) max_inst(错误备注)

 辅助接口:生成_id

http://62.234.143.52/API/_id

返回: 

"5d269e8d5657ff122c5282a8"

 

 3.合约数据

http://62.234.143.52/api/insts 

数据:
[{"instId":"SR911","instName":"白砂糖911","exchangeId":"CZCE","multi":10,"priceTick":1.0,"productID":"SR","vol":0},...]

说明:
[{"instId":合约,"instName":名称,"exchangeId":交易所代码,"multi":倍数,"priceTick":最小价格位,"productID":合约分类,"vol":用来区分是否主力合约(值最大),暂未生效},...]

 

4.期货席位数据

http://62.234.143.52/api/brokers

数据:
[{"id":"0155","name":"中财期货主席"},{"id":"5010","name":"国金主席"},...]
说明:
[{"id":席位id,"name":席位名},...]

这个数据源文件需要经常人工更新的,包括增加期货公司,变更等。文件在服务器上,所有brokers.xml

5.K线和分时数据

http://62.234.143.52/api/kbars?i=rb1910&p=1m&days=1

参数说明   i:合约 p:周期(1m,5m,1h,1d,1w),days (天数0:全部,最近N天)   
注:期货的1年没意义,都只有几个月-1年生存期
返回值json,数据全部为字符串:
[["2019-07-04 21:00:59","4016","4024","4013","4022","42404"],....}
日期,开,高,低,收,量
  

6.行情

http://62.234.143.52/api/market?i=rb1910  某合约

{"tradingDay":"20190704","instrumentID":"rb1910","exchangeID":"","exchangeInstID":"","lastPrice":4026.0,"preSettlementPrice":4042.0,"preClosePrice":4030.0,
"preOpenInterest":2481090.0,"openPrice":4027.0,"highestPrice":4077.0,"lowestPrice":3996.0,"volume":4178770,"turnover":168566965400.0,"openInterest":2477224.0,
"closePrice":1.7976931348623157E+308,"settlementPrice":1.7976931348623157E+308,"upperLimitPrice":4284.0,"lowerLimitPrice":3799.0,"preDelta":1.7976931348623157E+308,
"currDelta":1.7976931348623157E+308,"updateTime":"14:59:55","updateMillisec":0,"bidPrice1":4025.0,"bidVolume1":164,"askPrice1":4026.0000000000009,"askVolume1":634,
"averagePrice":40338.9,"actionDay":"20190704"}
几个重点字段

public class T_Market
{
/// <summary>
/// 交易日
/// </summary>
public string TradingDay{ get; set; }
/// <summary>
/// 合约代码
/// </summary>
public string InstrumentID{ get; set; }
/// <summary>
/// 交易所代码
/// </summary>
public string ExchangeID{ get; set; }
/// <summary>
/// 合约在交易所的代码
/// </summary>
public string ExchangeInstID{ get; set; }
/// <summary>
/// 最新价
/// </summary>
public double LastPrice{ get; set; }
/// <summary>
/// 上次结算价
/// </summary>
public double PreSettlementPrice{ get; set; }
/// <summary>
/// 昨收盘
/// </summary>
public double PreClosePrice{ get; set; }
/// <summary>
/// 昨持仓量
/// </summary>
public double PreOpenInterest{ get; set; }
/// <summary>
/// 今开盘
/// </summary>
public double OpenPrice{ get; set; }
/// <summary>
/// 最高价
/// </summary>
public double HighestPrice{ get; set; }
/// <summary>
/// 最低价
/// </summary>
public double LowestPrice{ get; set; }
/// <summary>
/// 数量
/// </summary>
public int Volume{ get; set; }
/// <summary>
/// 成交金额
/// </summary>
public double Turnover{ get; set; }
/// <summary>
/// 持仓量
/// </summary>
public double OpenInterest{ get; set; }
/// <summary>
/// 今收盘
/// </summary>
public double ClosePrice{ get; set; }
/// <summary>
/// 本次结算价
/// </summary>
public double SettlementPrice{ get; set; }
/// <summary>
/// 涨停板价
/// </summary>
public double UpperLimitPrice{ get; set; }
/// <summary>
/// 跌停板价
/// </summary>
public double LowerLimitPrice{ get; set; }
/// <summary>
/// 昨虚实度
/// </summary>
public double PreDelta{ get; set; }
/// <summary>
/// 今虚实度
/// </summary>
public double CurrDelta{ get; set; }
/// <summary>
/// 最后修改时间
/// </summary>
public string UpdateTime{ get; set; }
/// <summary>
/// 最后修改毫秒
/// </summary>
public int UpdateMillisec{ get; set; }
/// <summary>
/// 申买价一
/// </summary>
public double BidPrice1{ get; set; }
/// <summary>
/// 申买量一
/// </summary>
public int BidVolume1{ get; set; }
/// <summary>
/// 申卖价一
/// </summary>
public double AskPrice1{ get; set; }
/// <summary>
/// 申卖量一
/// </summary>
public int AskVolume1{ get; set; }
/// <summary>
/// 当日均价
/// </summary>
public double AveragePrice{ get; set; }
public string ActionDay{ get; set; }
}

 7.账号数据:权益

http://62.234.143.52/api/amounts?accid=1&days=0

参数 账号id,days:天数(0全部,1最近1天)

[{"keyid":"1_636981984000000000","user_name":null,"account_id":1,"account_no":"075402","amount":142106.28,"avaiable":88538.41,"margin":31601.0,"cash":0.0,"fee":7.4,
"position_profit":-650.0,"close_profit":30.0,"pre_amount":142733.68,"update_time":"2019-07-06T02:35:00.411+08:00","day":20190706}]

字段说明:
[{"keyid":"1_636981984000000000","user_name":null,"account_id":1,"account_no":"075402","amount":权益,"avaiable":可用,"margin":保证金,"cash":出入金,"fee":手续费,
"position_profit":持仓盈亏,"close_profit":平仓盈亏,"pre_amount":昨权益,"update_time":"2019-07-06T02:35:00.411+08:00","day":20190706}]

 

8.账号数据:成交

http://62.234.143.52/api/trades?accid=1&days=0

参数 账号id,days:天数(0全部,1最近1天)

[{"_id":null,"keyid":"1_636979392000000000_       17095","account_id":1,"account_no":"075402","sys_id":"       17095","order_id":"       42070","inst_id":"SR909","inst_name":null,
"dc":0,"kp":1,"price":5227.0,"vol":1,"comment":null,"day":20190705,"deal_time":"2019-07-05T09:53:39+08:00","profit":0.0,"dots":0,"status":0},...]
[{"_id":(内部使用),"keyid":(内部使用),"account_id":唯一账号id,"account_no":"075402","sys_id":系统号,"order_id":对应报单号,"inst_id":"SR909","inst_name":null,
"dc":0,"kp":1,"price":5227.0,"dots":盈亏点数,"vol":手数,"comment":null,"day":20190705,"deal_time":成交时间,"profit":0.0,"status":0},...]

备注: dc:(0买 1卖) kp(0:开,1平)

 

9.账号数据:持仓

http://62.234.143.52/api/positions?accid=1&days=0

[
{"_id":"","account_id":114,"account_no":"147114","keyid":"114_ru1909_0","sid":"114_ru1909_0","inst_id":"ru1909","inst_name":"天然橡胶","dc":0,"vol":8,"vol_yd":1,"vol_td":7,
"vol_opening":0,"vol_closing":0,"avg_price":10704.38,"profit":0.0,"dots":0.0,"rate":0.0,"update_time":"2019-07-19T12:51:40.997+08:00","day":20190719},...]

说明:
[{"_id":null,"account_id":1,"account_no":"075402","keyid":"1_AP910_0","sid":"1_AP910_0","inst_id":"AP910","inst_name":合约名,"dc":方向,"vol":持仓数量,"vol_yd":昨仓,"vol_td":今仓,
"vol_opening":挂开量,"vol_closing":挂平量,"avg_price":持仓均价,"profit":持仓盈亏,"rate":0.0,"update_time":统计时间,"day":20190705},...]
dc:0多仓,1空仓; 
每个本账号当天交易过合约有2行,一多一空

10.账号数据:报单

http://62.234.143.52/api/orders?accid=1&days=0

[{"_id":null,"keyid":"1_636979392000000000_rb1910_050953335754","account_id":1,"account_no":"075402","inst_id":"rb1910","dc":1,"kp":1,"price":4049.0,"vol":1,"vol_traded":0,"vol_real":1,
"status":"submit","sys_id":"","local_id":"050953335754","ref_id":"KEEP_PRICE","from":null,"comment":"清仓","day":20190705,"cancel_slop":0,"cancel_ns":0,"re_slop":0,
"insert_time":"2019-07-05T09:53:33.576+08:00","update_time":"0001-01-01T08:00:00+08:00"},....]

字段说明:
[{"_id":内部用,"keyid":内部用,"account_id":1,"account_no":"075402","inst_id":"rb1910","dc":1,"kp":1,"price":4049.0,"vol":报单量,"vol_traded":成交量,"vol_real":(内部用),
"status":状态,"sys_id":报单号,"local_id":本地报单号,"ref_id":内部用,"from":报单来源,"comment":备注,"day":20190705,"cancel_slop":(内部用),"cancel_ns":(内部用),"re_slop":(内部用),

"insert_time":报单时间,"update_time":"0001-01-01T08:00:00+08:00"},

备注: dc:(0买 1卖) kp(0:开,1平)
状态:canceled(报单失败或被撤) submit(报单中) completed已成交
 

 

交易能力统计数据

public class T_AmountStat
{
public string keyid { get; set; } //按日存放的唯一标识
public int account_id { get; set; } //帐号
public string account_no { get; set; } //帐号
public int catalog { get; set; }

public double amount { get; set; } //当前资金
public double day_rate { get; set; } //当日收益率 = (当日权益+当日出金)/(昨日权益+当日入金)-1
public double week_rate { get; set; } //周收益率
public double month_rate { get; set; } //月收益率
//public double day_net { get; set; } //当日净值=1+当日收益率
//public double day_fee { get; set; } //当日手续费
//public double day_profit { get; set; } //当日盈亏
//public double day_cash { get; set; } //当日出入金

public double rate { get; set; } //累计收益率
public double net { get; set; } //累计净值
public double profit { get; set; } //累计收益
public double cashin { get; set; } //累计入金
public double cashout { get; set; } //累计出金
public double fee { get; set; } //累计手续费

public double dots { get; set; } //累计盈亏点数
public int days { get; set; } //累计交易天数
public int orders { get; set; }//累计笔数
public long vols { get; set; }//累计手数
public double maxpo { get; set; }//最大持仓手数
public double day_orders { get; set; }//日均交易笔数
public double day_vols { get; set; }//日均交易手数
public double winlossrate { get; set; }//盈亏比
public double winrate { get; set; }//胜率
public double retracement { get; set; }//回撤
public double order_profit { get; set; }//最大单笔盈利
public double order_loss { get; set; }//最大单笔亏损
public double avg_profit { get; set; }//平均单笔盈利
public double avg_loss { get; set; }//平均单笔亏损
public double avg_po_time { get; set; }//平均持仓时间

public double score { get; set; }//能力评分

public string level { get; set; }//能力等级

public DateTime update_time { get; set; } //更新时间
public int leedid { get; set; }//指引账号
public int keepcnt { get; set; }//跟单数
public double keep_profit { get; set; } //当前跟单累计收益
public double keep_rate { get; set; } //当前跟单累计收益率
public int keep_days { get; set; } //当前跟单天数
public int keep_vols { get; set; } //当前跟单手数

}

 

 

接口对照表:

1.期货席位数据

http://62.234.143.52/api/brokers

数据:
[{"id":"0155","name":"中财期货主席"},{"id":"5010","name":"国金主席"},...]
说明:
[{"id":席位id,"name":席位名},...]

这个数据源文件需要经常人工更新的,包括增加期货公司,变更等。文件在服务器上,所有brokers.xml


2.合约
http://62.234.143.52/api/insts
[{"instId":"SR911","instName":"白砂糖911","exchangeId":"CZCE","multi":10,"priceTick":1.0,"productID":"SR","vol":0},。。]
说明:
[{"instId":合约,"instName":名称,"exchangeId":交易所代码,"multi":倍数,"priceTick":最小价格位,"productID":合约分类,"vol":用来区分是否主力合约(值最大),暂未生效},...]

3.K线
完成 见上)


4.收益率排行 日月周(实时等同日)
http://62.234.143.52/API/rank?sort=day_rate&catalog=1
返回:[{"keyid":"","account_id":3,"account_no":"061198","amount":365457.83,"net":1.0,"rate":0.0,"profit":0.0,"cashin":0.0,"cashout":0.0,"fee":0.0,"dots":0.0,"days":0,"orders":0,"vols":0,"avgvols":0.0,
"maxpo":0.0,"day_orders":0.0,"day_vols":0.0,"winlossrate":0.0,"winrate":0.0,"retracement":0.0,"order_profit":0.0,"order_losss":0.0,
"update_time":"2019-07-13T16:53:50.012+08:00","leedid":0,"keepcnt":1,"keep_profit":0.0,"keep_rate":0.0,"keep_days":0,"keep_vols":0},..]

参数:sort 排序字段(day_rate 最近日收益 week_rate 最近一周收益 month_rate 最近一月收益)
catalog 1指引账号,0跟单账号


5.高频排行 同上
hhttp://62.234.143.52/API/rank?sort=orders&catalog=1
返回:[{"keyid":"","account_id":3,"account_no":"061198","amount":365457.83,"net":1.0,"rate":0.0,"profit":0.0,"cashin":0.0,"cashout":0.0,"fee":0.0,"dots":0.0,"days":0,"orders":0,"vols":0,"avgvols":0.0,
"maxpo":0.0,"day_orders":0.0,"day_vols":0.0,"winlossrate":0.0,"winrate":0.0,"retracement":0.0,"order_profit":0.0,"order_losss":0.0,
"update_time":"2019-07-13T16:53:50.012+08:00","leedid":0,"keepcnt":1,"keep_profit":0.0,"keep_rate":0.0,"keep_days":0,"keep_vols":0},..]
参数:sort 排序字段(orders 报单数)
catalog 1指引账号,0跟单账号,-1全部

7.见上 socket接口 

8.统计接口
http://62.234.143.52/API/stat?accid=3
{"keyid":"141_637013952000000000","account_id":141,"account_no":"140534","catalog":0,"amount":1001306.53,"real_rate":0.0,"day_rate":0.0,"week_rate":0.0,"month_rate":0.0,"day_profit":-18.0,"month_profit":927.8,"rate":0.0,"net":1.0,"profit":927.8,"cashin":0.0,"cashout":0.0,"fee":22.2,"dots":0.0,"days":2,"orders":5,"vols":16,"maxpo":15.0,"day_orders":2.5,"day_vols":8.0,"winlossrate":1.0,"winrate":0.33,"retracement":0.0,"order_profit":10.0,"order_loss":-10.0,"avg_profit":10.0,"avg_loss":-10.0,"avg_po_time":2.74,"score":0.0,"level":"C-","update_time":"2019-08-14T16:00:00+08:00","day":0,"leedid":137,"keepcnt":0,"keep_profit":-10.0,"keep_rate":0.0,"keep_days":1,"keep_vols":16}
字段说明见上 交易能力统计数据 T_AmountStat

9.交易账号每日收益
http://62.234.143.52/API/fund?accid=3&type=dayprofit&days=1

参数:days 最近多少天
返回值:  [["2019-07-13 02:35:00","0"]]
参数说明: [日期,收益]

10.跟单设置,同2

11.解绑,同2
12.跟随者
http://62.234.143.52/API/leedkeeps?accid=1
参数:accid 指引账号id
[["5d272fcaf0a9da0cec0be82c","3","2019-07-11 20:47:06",null,null,null,null]]
数据说明:[_id,领单账号id,开始日期,天数,跟随金额,收益,手数]


13,跟单账号

正在跟单
http://62.234.143.52/API/keepkeeps?accid=5
返回值: [["5d272fcaf0a9da0cec0be82c","3","2019-07-11 20:47:06","0","138974.27","0","0"]]
数据说明:[_id,领单账号id,开始日期,天数,跟随金额,收益,手数]
历史跟单 http://62.234.143.52/API/keepkeeps?accid=5&status=-1 (需要历史数据:已过期或作废的跟单)
返回值: ["5d272fcaf0a9da0cec0be82c","3","2019-07-11 20:47:06","0","138974.27","0","0"]
数据说明:[_id,领单账号id,开始日期,天数,跟随金额,收益,手数]
14.1 收益率
请求:
http://62.234.143.52/API/fund?accid=3&type=dayrate

数据:
[["2019-07-05 14:59:05","-0.33"],..]
14.2 月收益
请求:
http://62.234.143.52/API/fund?accid=1&type=monthprofit
数据:
[["2019-07-01 00:00:00","-11250.01"],....]
14.3 净值/余额
http://62.234.143.52/API/fund?accid=1&type=dayfund
[["2019-07-05 14:59:05","0.9967","141733.69","0"],
数据分别是:时间,净值,余额,出入金(入金>0,出金<0)

15.1 品种分析
http://localhost:49323/api/inst_stat?accid=1

返回:
[["j1909","1100.00","焦炭"],["ru1909","-150.00","天然橡胶"],["jm1909","0.00","焦煤"]]
数据说明:
 

15.2 多空
http://62.234.143.52/api/dc_stat?accid=1
返回:[["多","0.00","28"],["空","0.00","9"]] 固定2行3列 
说明:[方向,盈亏,手数]
15.3 盈亏

http://62.234.143.52/API/fund?accid=1&type=dayprofit
返回: [["2019-07-09 14:59:25","-5850"],["2019-07-10 15:01:06","-5400.01"]]
15.4 持仓时间
http://62.234.143.52/api/po_stat?accid=1

返回:[["m1909","0","0.00"],...]
说明:[[合约,持仓分钟,盈亏],......]
16 持仓. 参考上面 9.账号数据:持仓 ,需要说明的是,期货不同与外汇,没有止盈止损设定
http://62.234.143.52/api/positions?accid=1&days=1
[{"_id":null,"account_id":1,"account_no":"075402","keyid":"1_AP910_0","sid":"1_AP910_0","inst_id":"AP910","dc":0,"vol":0,"vol_yd":0,"vol_td":0,
"vol_opening":0,"vol_closing":0,"avg_price":0.0,"profit":0.0,"rate":0.0,"update_time":"2019-07-05T15:01:07.77+08:00","day":20190705},...]
17.历史持仓 参考上面 9.账号数据:持仓,需要说明的是,期货不同与外汇,没有止盈止损设定
http://62.234.143.52/api/positions?accid=1&days=0

18.账号跟随 同上13
http://62.234.143.52/API/leedkeeps?accid=1

返回:[["5d272fcaf0a9da0cec0be82c","4","2019-07-11 20:47:06","0","141224.27","0","0"]]
数据说明:[_id,跟单账号id,开始日期,天数,跟随金额,收益,手数]
19.跟单设置,同2,已完成

20.账号交易能力的统计,
http://62.234.143.52/API/stats?ids=3,4  (与 http://62.234.143.52/API/stat?accid=1 数据接口相同)
返回:
[{
{"keyid":"42_637000992000000000","account_id":42,"account_no":"30810330","catalog":1,"amount":2373.68,"real_rate":0.02,"day_rate":0.02,"week_rate":-0.11,"month_rate":-0.54,"day_profit":40.0,
"month_profit":-1863.22,"rate":-0.38,"net":0.62,"profit":-996.32,"cashin":4700.0,"cashout":-1350.0,"fee":136.32,"dots":-184.0,"days":163,"orders":113,"vols":57,"maxpo":1.0,"day_orders":0.69,
"day_vols":0.35,"winlossrate":0.78,"winrate":0.57,"retracement":0.49,"order_profit":980.0,"order_loss":-1960.0,"avg_profit":199.69,"avg_loss":-374.09,"avg_po_time":5965.73,"score":-3.14,
"level":"D","update_time":"2019-07-30T16:00:00+08:00","day":0,"leedid":0,"keepcnt":0,"keep_profit":0.0,"keep_rate":0.0,"keep_days":0,"keep_vols":0}
}]
数据说明参考public class T_AmountStat

补充:
21.跟单设置接口
/api/keeps?accid=55
[{"_id":"5d43a108f2a9da060085d1fd","user_id":0,"user_name":null,"from_date":"2019-08-02T10:33:45+08:00","end_date":"2019-08-31T00:00:00+08:00","keep_id":55,"lead_id":42,
"keep_no":"","lead_no":"","product_name":null,"keep_dc":1,"vol_type":1,"keep_vol":1.0,"keep_pos":0,"open_slip":0,"close_slip":0,"in_inst":"","out_inst":"","max_inst":"",
"run_status":0,"create_time":"2019-08-02T10:33:45+08:00","update_time":"2019-08-07T08:34:53.7052458+08:00","excutor":"","ip":"","noclear_ids":"","b_syncpo":0}]
参数:accid 为空获取所有在运行跟单,有值的话为 keep_id
返回值:屏蔽了keep_no leed_no

22.账号接口
/api/tds?accid=55
[{"chk":1,"user_name":"","account_id":103,"account_no":"8006000891","account_pw":"","margin_no":"02188006000891","margin_pw":"","broker_id":"4500","broker_name":"国投安信",
"is_login":0,"catalog":1,"status":1,"margin_status":2,"remark":"登录成功:8006000891"}]
参数:accid 为空获取所有在运行跟单,有值的话为 account_id
返回值:屏蔽了密码


 

统计公式

当日收益率: 公式:当日收益率
=(当日权益+当日出金)/(昨日权益+当日入金)-1 注:出金一律按盘后,入金按盘前。 当日净值: 公式:当日净值=1+当日收益率 累计净值: 公式:P=P1*P2*P3.....*Pn,其中P为累计净值,Pn为当日净值。 解读:累计净值是从盘手加入网站排名以来的累计盈利,可以比较直观和全面地反映盘手账户在运作期间的历史表现,结合账户的运作时间,则可以更准确地体现盘手的真实业绩水平。一般说来,累计净值越高,盘手业绩越好。 累计收益率: 公式:累计收益率=(累计净值-1)×100% 解读:累计收益率与累计净值所体现盘手业绩基本相同,一般说来,累计收益率越高,盘手业绩越好。 年化收益率: 公式:累计收益率 / 交易天数×250天 解读:由于每个盘手加入排名的时间不同,其累计收益率由于统计周期长短的原因也会有较大的差距,但并非是累计收益率越小的盘手实力就一定越弱。为了公平起见,网站排名时会带入计算出盘手的年化收益率供用户参考。年化收益率越高,代表盘手统计期内的盈利能力越强。 综合积分: 公式:综合积分 = (当日净值-1) × (1-|最大回撤|)2 × (|总盈利额度|)1/2 /100 解读:综合积分按照不同的权重综合考量盘手累计收益率、回撤及总盈亏额三个方面,积分越高说明盘手交易能力越强、越稳定。 收益风险比: 公式:收益风险比=年化收益率 / 历史最大回撤 解读:收益风险比是衡量盘手创造高收益的同时面临的风险可能是多少,其表明可能获取多大的收益的同时需要承担多大的损失。 胜率: 公式:盈利次数 /总交易次数×100% 解读:胜率是衡量一个盘手在交易过程中盈利次数的占比,胜率越高,说明盘手每交易一次盈利的概率就越大。 最大回撤率: 公式:历史最大回撤率=max[(历史最大累计净值-当日累计净值)/ 历史最大累计净值 ] 解读:在统计周期内任一历史时点往后推,账户净值走到最低点时的收益率回撤幅度的最大值。最大回撤用来描述账户可能出现的最糟糕的情况。最大回撤率越小说明盘手操作越稳健。 盈亏比: 公式:累计盈利/累计亏损 解读:盈亏比是衡量盘手账户盈利和亏损的比值,这个比值越大说明其盈利能力越强,这个指标跟收益风险比有异曲同工的效果,只是两者计算公式稍有不同。

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!