以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://222.73.7.161/bbs/index.asp)
--  期货人生  (http://222.73.7.161/bbs/list.asp?boardid=7)
----  ctppy  (http://222.73.7.161/bbs/dispbbs.asp?boardid=7&id=73475)

--  作者:z7c9
--  发布时间:2014/12/23 20:41:26
--  ctppy
http://www.visualstudio.com/downloads/download-visual-studio-vs#DownloadFamilies_2
--  作者:z7c9
--  发布时间:2015/1/4 20:52:26
--  
EasyQuant:
   EasyUtil  查手续费,保证金
   EasyQuote 收行情
   EasyQuant 自动下单
   EasyTrade 看盘,手工下单
   MiniQuant 高频交易

--  作者:z7c9
--  发布时间:2015/1/4 22:10:02
--  
023500=Stop_EasyQuote,Stop_FundMonitor,Stop_OrderProcess
084000=Start_EasyUtil
085000=Start_FundMonitor,Start_OrderProcess
152000=Stop_EasyQuote,StopFundMonitor,Stop_OrderProcess
204000=Start_EasyUtil
205000=Start_FundMonitor,Start_OrderProcess

--  作者:z7c9
--  发布时间:2015/1/5 20:49:57
--  
EasyTask
EasyUtil
EasyQuote
EasyQuant
EasyTrade
MiniQuant

--  作者:z7c9
--  发布时间:2015/1/12 22:44:51
--  
http://www.visualstudio.com/downloads/download-visual-studio-vs
--  作者:z7c9
--  发布时间:2015/1/12 22:45:53
--  
EasyQuant
EasyData
EasyTest

--  作者:z7c9
--  发布时间:2015/3/15 15:44:53
--  
行情和交易spi

void 函数名(int ,bool, 指针)

行情api:
CreateFtdcMdApi
Release
Init
Join
GetTradingDay
RegisterFront
RegisterNameServer
RegisterFensUserInfo
RegisterSpi
SubscribeMarketData
UnSubscribeMarketData
SubscribeForQuoteRsp
UnSubscribeForQuoteRsp


交易api:
CreateFtdcTraderApi
Release
Init
Join
GetTradingDay
RegisterFront
RegisterNameServer
RegisterFensUserInfo
RegisterSpi
SubscribePrivateTopic
SubscribePublicTopic

CreateFtdcMdApi
CreateFtdcTraderApi

Release,Init,Join

GetTradingDay

RegisterFront,RegisterNameServer,RegisterFensUserInfo

RegisterSpi

SubscribePrivateTopic,SubscribePublicTopic

SubscribeMarketData,UnSubscribeMarketData,SubscribeForQutoeRsp,UnSubscribeForQuoteRsp

--  作者:z7c9
--  发布时间:2017/7/11 17:38:44
--  
import pandas as pd %matplotlib inline df = pd.read_csv(\'/Volumes/homes/admin/CloudStation/Backup/WIN-86HQB8IN67K/D/data/futureday/SHFE_rb1801.csv\', encoding=\'gbk\') df = df.rename(columns={\'tradeDate\': \'date\', \'openPrice\': \'open\', \'highestPrice\': \'high\', \'lowestPrice\': \'low\', \'closePrice\': \'close\'}) df[\'range\'] = (df[\'high\'] - df[\'low\']).shift(1) df[\'upper\'] = df[\'open\'] + df[\'range\'] df[\'lower\'] = df[\'open\'] - df[\'range\'] trades = list() position = 0 n = 0 for i, x in df.iterrows(): if df.loc[i, \'high\'] >= df.loc[i, \'upper\']: if position<0: trade="trade" = {\'date\': df.loc[i, \'date\'], \'action\': \'平空\', \'qty\': 1, \'price\': df.loc[i, \'upper\']} trades.append(trade) position="position" = 0="0" if="if" position="=0: " trade="trade" = {\'date\': df.loc[i, \'date\'], \'action\': \'开多\', \'qty\': 1, \'price\': df.loc[i, \'upper\']} trades.append(trade) position="position" = 1 if="if" df.loc[i, \'low\'] <= df.loc[i, \'lower\']: if="if" position="position" >0: trade = {\'date\': df.loc[i, \'date\'], \'action\': \'平多\', \'qty\': 1, \'price\': df.loc[i, \'lower\']} trades.append(trade) position = 0 if position==0: trade = {\'date\': df.loc[i, \'date\'], \'action\': \'开空\', \'qty\': 1, \'price\': df.loc[i, \'lower\']} trades.append(trade) position = -1 if n == df.shape[0] - 1: if position>0: trade = {\'date\': df.loc[i, \'date\'], \'action\': \'强制平多\', \'qty\': 1, \'price\': df.loc[i, \'close\']} trades.append(trade) position = 0 if position<0: trade = {\'date\': df.loc[i, \'date\'], \'action\': \'强制平空\', \'qty\': 1, \'price\': df.loc[i, \'close\']} trades.append(trade) position = 0 n += 1 trade_df = pd.DataFrame(trades) trade_df openPos = trade_df[trade_df.index % 2 == 0].reset_index(drop=True) closePos = trade_df[trade_df.index % 2 != 0].reset_index(drop=True) ndf = pd.merge(openPos, closePos, left_index="True," right_index="True) ndf.loc[ndf[\'action_x\']" == \'开多\', \'profit\'] = (ndf[\'price_y\'] - ndf[\'price_x\']) * 10 ndf.loc[ndf[\'action_x\'] == \'开空\', \'profit\'] = (ndf[\'price_x\'] - ndf[\'price_y\']) * 10 ndf[\'cum_profit\'] = ndf[\'profit\'].cumsum() ndf[\'cum_profit\'].plot(figsize=(20, 5))