diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..2de924a47 --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +SPHINXPROJ = QUANTAXIS +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file diff --git a/_build/doctrees/QUANTAXIS_Trade/README.doctree b/_build/doctrees/QUANTAXIS_Trade/README.doctree new file mode 100644 index 000000000..dcb048873 Binary files /dev/null and b/_build/doctrees/QUANTAXIS_Trade/README.doctree differ diff --git a/_build/doctrees/README.doctree b/_build/doctrees/README.doctree new file mode 100644 index 000000000..82d8c60c2 Binary files /dev/null and b/_build/doctrees/README.doctree differ diff --git a/_build/doctrees/environment.pickle b/_build/doctrees/environment.pickle new file mode 100644 index 000000000..3cfd94750 Binary files /dev/null and b/_build/doctrees/environment.pickle differ diff --git a/_build/doctrees/index.doctree b/_build/doctrees/index.doctree new file mode 100644 index 000000000..62fad5261 Binary files /dev/null and b/_build/doctrees/index.doctree differ diff --git a/_build/doctrees/source/QUANTAXIS.QAARP.doctree b/_build/doctrees/source/QUANTAXIS.QAARP.doctree new file mode 100644 index 000000000..a6bcc6c7a Binary files /dev/null and b/_build/doctrees/source/QUANTAXIS.QAARP.doctree differ diff --git a/_build/doctrees/source/QUANTAXIS.QAAnalysis.doctree b/_build/doctrees/source/QUANTAXIS.QAAnalysis.doctree new file mode 100644 index 000000000..21736895f Binary files /dev/null and b/_build/doctrees/source/QUANTAXIS.QAAnalysis.doctree differ diff --git a/_build/doctrees/source/QUANTAXIS.QABacktest.doctree b/_build/doctrees/source/QUANTAXIS.QABacktest.doctree new file mode 100644 index 000000000..1e7d77530 Binary files /dev/null and b/_build/doctrees/source/QUANTAXIS.QABacktest.doctree differ diff --git a/_build/doctrees/source/QUANTAXIS.QACmd.doctree b/_build/doctrees/source/QUANTAXIS.QACmd.doctree new file mode 100644 index 000000000..cefec6858 Binary files /dev/null and b/_build/doctrees/source/QUANTAXIS.QACmd.doctree differ diff --git a/_build/doctrees/source/QUANTAXIS.QAData.doctree b/_build/doctrees/source/QUANTAXIS.QAData.doctree new file mode 100644 index 000000000..98a4ce620 Binary files /dev/null and b/_build/doctrees/source/QUANTAXIS.QAData.doctree differ diff --git a/_build/doctrees/source/QUANTAXIS.QAData.proto.doctree b/_build/doctrees/source/QUANTAXIS.QAData.proto.doctree new file mode 100644 index 000000000..373068dd6 Binary files /dev/null and b/_build/doctrees/source/QUANTAXIS.QAData.proto.doctree differ diff --git a/_build/doctrees/source/QUANTAXIS.QAEngine.doctree b/_build/doctrees/source/QUANTAXIS.QAEngine.doctree new file mode 100644 index 000000000..62613a096 Binary files /dev/null and b/_build/doctrees/source/QUANTAXIS.QAEngine.doctree differ diff --git a/_build/doctrees/source/QUANTAXIS.QAFetch.doctree b/_build/doctrees/source/QUANTAXIS.QAFetch.doctree new file mode 100644 index 000000000..0e940a1a3 Binary files /dev/null and b/_build/doctrees/source/QUANTAXIS.QAFetch.doctree differ diff --git a/_build/doctrees/source/QUANTAXIS.QAIndicator.doctree b/_build/doctrees/source/QUANTAXIS.QAIndicator.doctree new file mode 100644 index 000000000..66a3627ea Binary files /dev/null and b/_build/doctrees/source/QUANTAXIS.QAIndicator.doctree differ diff --git a/_build/doctrees/source/QUANTAXIS.QAMarket.doctree b/_build/doctrees/source/QUANTAXIS.QAMarket.doctree new file mode 100644 index 000000000..2c75a341d Binary files /dev/null and b/_build/doctrees/source/QUANTAXIS.QAMarket.doctree differ diff --git a/_build/doctrees/source/QUANTAXIS.QASU.doctree b/_build/doctrees/source/QUANTAXIS.QASU.doctree new file mode 100644 index 000000000..02b4d0b88 Binary files /dev/null and b/_build/doctrees/source/QUANTAXIS.QASU.doctree differ diff --git a/_build/doctrees/source/QUANTAXIS.QAUtil.doctree b/_build/doctrees/source/QUANTAXIS.QAUtil.doctree new file mode 100644 index 000000000..12c460387 Binary files /dev/null and b/_build/doctrees/source/QUANTAXIS.QAUtil.doctree differ diff --git a/_build/doctrees/source/QUANTAXIS.QAWeb.doctree b/_build/doctrees/source/QUANTAXIS.QAWeb.doctree new file mode 100644 index 000000000..44013251e Binary files /dev/null and b/_build/doctrees/source/QUANTAXIS.QAWeb.doctree differ diff --git a/_build/doctrees/source/QUANTAXIS.doctree b/_build/doctrees/source/QUANTAXIS.doctree new file mode 100644 index 000000000..15f370c27 Binary files /dev/null and b/_build/doctrees/source/QUANTAXIS.doctree differ diff --git a/_build/doctrees/source/modules.doctree b/_build/doctrees/source/modules.doctree new file mode 100644 index 000000000..366d8a163 Binary files /dev/null and b/_build/doctrees/source/modules.doctree differ diff --git a/_build/html/.buildinfo b/_build/html/.buildinfo new file mode 100644 index 000000000..adad204ab --- /dev/null +++ b/_build/html/.buildinfo @@ -0,0 +1,4 @@ +# Sphinx build info version 1 +# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. +config: 18e9302a06caccca0fbd1c9498c2e667 +tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/_build/html/.nojekyll b/_build/html/.nojekyll new file mode 100644 index 000000000..e69de29bb diff --git a/_build/html/QUANTAXIS_Trade/README.html b/_build/html/QUANTAXIS_Trade/README.html new file mode 100644 index 000000000..ac8b5bf5e --- /dev/null +++ b/_build/html/QUANTAXIS_Trade/README.html @@ -0,0 +1,208 @@ + + + + + + + + QUANTAXIS quantitative financial strategy framework — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

QUANTAXIS quantitative financial strategy framework

+

QUANTAXIS quantitative framework to achieve the stock and futures market, the whole species back to the test.Through the distributed crawler for data capture, to build a response to the data cleaning and market push engine to build a multi-language open response frame. And build interactive visualization of clients and websites.

+'Stories in Ready' +
+

0.4.x Release Note

+

QUANTAXIS Quantitative Financial Strategy Framework is a quantitative analysis solution for small and medium-sized strategy teams.We can quickly implement scene-oriented customization solutions with highly decoupled modularity and standardized protocols. QUANTAXIS is a progressive open Framework, you can according to their own needs, the introduction of their own data, analysis programs, visualization process, you can also RESTful interface, the rapid realization of multi-LAN / WAN collaboration.

+

QUANTAXIS and many excellent domestic quantitative platform is the difference, QA more concerned about the user experience and the actual situation, for the user needs will be more optimized, so will pay more attention to openness, the introduction of custom convenience, and the team Collaborative details are handled, such as custom data introductions, custom policy chart comparison, custom risk and policy portfolio management, and so on.

+ +
+

More info on https://github.com/yutiansut/quantaxis

+

An EXAMPLE of QUANTAXIS BACKTEST like that below:

+
import QUANTAXIS as QA
+from QUANTAXIS import QA_Backtest_stock_day as QB
+
+
+"""
+Written Before:
+===============QUANTAXIS BACKTEST STOCK_DAY's Constant
+Constant:
+QB.account.message
+QB.account.cash
+QB.account.hold
+QB.account.history
+QB.account.assets
+QB.account.detail
+QB.account.init_assest
+
+
+
+QB.strategy_stock_list
+QB.strategy_start_date
+QB.strategy_end_date
+
+
+QB.today
+
+QB.benchmark_code
+
+
+
+
+Function:
+get the market data (based on gap):
+QB.QA_backtest_get_market_data(QB,code,QB.today)
+get the market data as you want:
+QA.QA_fetch_stock_day(code,start,end,model)
+
+
+Order :
+QB.QA_backtest_send_order(QB, code,amount,towards,order: dict)
+
+order has three model:
+1.Limited order order['order_model']=0 or l,L
+attention: this model should have a order['price'] key
+order['price']=xxxx
+
+2.Market order order['order_model']=1 or m,M,market,Market
+3.Strict model order['order_model']=2 or s,S
+    which is buy in the highest price or sell in the lowest price
+
+Query the hold amount
+
+QB.QA_backtest_hold_amount(QB,code)
+
+
+"""
+
+
+@QB.backtest_init
+def init():
+    #
+    QB.setting.QA_util_sql_mongo_ip='127.0.0.1'
+
+    QB.account.init_assest=2500000
+    QB.benchmark_code='hs300'
+
+    QB.strategy_stock_list=['000001','000002','600010','601801','603111']
+    QB.strategy_start_date='2017-03-01'
+    QB.strategy_end_date='2017-07-01'
+
+@QB.before_backtest
+def before_backtest():
+    global risk_position
+    QA.QA_util_log_info(QB.account.message)
+
+
+
+@QB.load_strategy
+def strategy():
+    #print(QB.account.message)
+    #print(QB.account.cash)
+    #input()
+
+    for item in QB.strategy_stock_list:
+        QA.QA_util_log_info(QB.QA_backtest_get_market_data(QB,item,QB.today))
+        if QB.QA_backtest_hold_amount(QB,item)==0:
+            QB.QA_backtest_send_order(QB,item,10000,1,{'order_model':'Market'})
+
+
+        else:
+            #print(QB.QA_backtest_hold_amount(QB,item))
+            QB.QA_backtest_send_order(QB,item,10000,-1,{'order_model':'Market'})
+
+@QB.end_backtest
+def after_backtest():
+    pass
+
+
+
+
+ + +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/README.html b/_build/html/README.html new file mode 100644 index 000000000..c787edead --- /dev/null +++ b/_build/html/README.html @@ -0,0 +1,208 @@ + + + + + + + + QUANTAXIS quantitative financial strategy framework — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

QUANTAXIS quantitative financial strategy framework

+

QUANTAXIS quantitative framework to achieve the stock and futures market, the whole species back to the test.Through the distributed crawler for data capture, to build a response to the data cleaning and market push engine to build a multi-language open response frame. And build interactive visualization of clients and websites.

+'Stories in Ready' +
+

0.4.x Release Note

+

QUANTAXIS Quantitative Financial Strategy Framework is a quantitative analysis solution for small and medium-sized strategy teams.We can quickly implement scene-oriented customization solutions with highly decoupled modularity and standardized protocols. QUANTAXIS is a progressive open Framework, you can according to their own needs, the introduction of their own data, analysis programs, visualization process, you can also RESTful interface, the rapid realization of multi-LAN / WAN collaboration.

+

QUANTAXIS and many excellent domestic quantitative platform is the difference, QA more concerned about the user experience and the actual situation, for the user needs will be more optimized, so will pay more attention to openness, the introduction of custom convenience, and the team Collaborative details are handled, such as custom data introductions, custom policy chart comparison, custom risk and policy portfolio management, and so on.

+ +
+

More info on https://github.com/yutiansut/quantaxis

+

An EXAMPLE of QUANTAXIS BACKTEST like that below:

+
import QUANTAXIS as QA
+from QUANTAXIS import QA_Backtest_stock_day as QB
+
+
+"""
+Written Before:
+===============QUANTAXIS BACKTEST STOCK_DAY's Constant
+Constant:
+QB.account.message
+QB.account.cash
+QB.account.hold
+QB.account.history
+QB.account.assets
+QB.account.detail
+QB.account.init_assest
+
+
+
+QB.strategy_stock_list
+QB.strategy_start_date
+QB.strategy_end_date
+
+
+QB.today
+
+QB.benchmark_code
+
+
+
+
+Function:
+get the market data (based on gap):
+QB.QA_backtest_get_market_data(QB,code,QB.today)
+get the market data as you want:
+QA.QA_fetch_stock_day(code,start,end,model)
+
+
+Order :
+QB.QA_backtest_send_order(QB, code,amount,towards,order: dict)
+
+order has three model:
+1.Limited order order['order_model']=0 or l,L
+attention: this model should have a order['price'] key
+order['price']=xxxx
+
+2.Market order order['order_model']=1 or m,M,market,Market
+3.Strict model order['order_model']=2 or s,S
+    which is buy in the highest price or sell in the lowest price
+
+Query the hold amount
+
+QB.QA_backtest_hold_amount(QB,code)
+
+
+"""
+
+
+@QB.backtest_init
+def init():
+    #
+    QB.setting.QA_util_sql_mongo_ip='127.0.0.1'
+
+    QB.account.init_assest=2500000
+    QB.benchmark_code='hs300'
+
+    QB.strategy_stock_list=['000001','000002','600010','601801','603111']
+    QB.strategy_start_date='2017-03-01'
+    QB.strategy_end_date='2017-07-01'
+
+@QB.before_backtest
+def before_backtest():
+    global risk_position
+    QA.QA_util_log_info(QB.account.message)
+
+
+
+@QB.load_strategy
+def strategy():
+    #print(QB.account.message)
+    #print(QB.account.cash)
+    #input()
+
+    for item in QB.strategy_stock_list:
+        QA.QA_util_log_info(QB.QA_backtest_get_market_data(QB,item,QB.today))
+        if QB.QA_backtest_hold_amount(QB,item)==0:
+            QB.QA_backtest_send_order(QB,item,10000,1,{'order_model':'Market'})
+
+
+        else:
+            #print(QB.QA_backtest_hold_amount(QB,item))
+            QB.QA_backtest_send_order(QB,item,10000,-1,{'order_model':'Market'})
+
+@QB.end_backtest
+def after_backtest():
+    pass
+
+
+
+
+ + +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAARP/QAAccount.html b/_build/html/_modules/QUANTAXIS/QAARP/QAAccount.html new file mode 100644 index 000000000..ff41ce3b3 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAARP/QAAccount.html @@ -0,0 +1,447 @@ + + + + + + + + QUANTAXIS.QAARP.QAAccount — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAARP.QAAccount

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+
+import pandas as pd
+import datetime
+from QUANTAXIS.QAEngine.QAEvent import QA_Worker
+from QUANTAXIS.QAMarket.QAOrder import QA_Order
+from QUANTAXIS.QASU.save_account import save_account, update_account
+from QUANTAXIS.QAUtil.QAParameter import (ACCOUNT_EVENT, AMOUNT_MODEL,
+                                          BROKER_TYPE, ENGINE_EVENT, FREQUENCE,
+                                          MARKET_TYPE, TRADE_STATUS)
+from QUANTAXIS.QAUtil.QARandom import QA_util_random_with_topic
+
+# 2017/6/4修改: 去除总资产的动态权益计算
+
+
+
[docs]class QA_Account(QA_Worker): + """[QA_Account] + + 2018/1/5 再次修改 改版本去掉了多余的计算 精简账户更新 + ====================== + + - 不再计算总资产/不再计算当前持仓/不再计算交易对照明细表 + - 不再动态计算账户股票/期货市值 + - 只维护 cash/history两个字段 剩下的全部惰性计算 + + + QA_Account 是QUANTAXIS的最小不可分割单元之一 + + QA_Account是账户类 需要兼容股票/期货/指数 + QA_Account继承自QA_Worker 可以被事件驱动 + QA_Account可以直接被QA_Strategy继承 + + 有三类输入: + 信息类: 账户绑定的策略名/账户的用户名/账户类别/账户识别码/账户的broker + 资产类: 现金/可用现金/交易历史/交易对照表 + 规则类: 是否允许卖空/是否允许t0结算 + + 方法: + 惰性计算:最新持仓/最新总资产/最新现金/持仓面板 + 生成订单/接受交易结果数据 + 接收新的数据/on_bar/on_tick方法/缓存新数据的market_data + + + """ + + def __init__(self, strategy_name=None, user_cookie=None, market_type=MARKET_TYPE.STOCK_CN, frequence=FREQUENCE.DAY, + broker=BROKER_TYPE.BACKETEST, portfolio_cookie=None, account_cookie=None, + sell_available={}, init_assets=None, cash=None, history=None, + margin_level=False, allow_t0=False, allow_sellopen=False): + super().__init__() + self._history_headers = ['datetime', 'code', 'price', + 'amount', 'order_id', 'trade_id', 'account_cookie', 'commission', 'tax'] + # 信息类: + self.strategy_name = strategy_name + self.user_cookie = user_cookie + self.market_type = market_type + self.portfolio_cookie = portfolio_cookie + self.account_cookie = QA_util_random_with_topic( + 'Acc') if account_cookie is None else account_cookie + self.broker = broker + self.frequence = frequence + self.market_data = None + self._currenttime = None + # 资产类 + self.init_assets = 1000000 if init_assets is None else init_assets + self.cash = [self.init_assets] if cash is None else cash + self.cash_available = self.cash[-1] # 可用资金 + self.sell_available = sell_available + self.history = [] if history is None else history + self.time_index = [] + # 规则类 + # 两个规则 + # 1.是否允许t+0 及买入及结算 + # 2.是否允许卖空开仓 + # 3.是否允许保证金交易/ 如果不是false 就需要制定保证金比例(dict形式) + self.allow_t0 = allow_t0 + self.allow_sellopen = allow_sellopen + self.margin_level = margin_level + + def __repr__(self): + return '< QA_Account {}>'.format(self.account_cookie) + + @property + def message(self): + 'the standard message which can be transef' + return { + 'source': 'account', + 'account_cookie': self.account_cookie, + 'portfolio_cookie': self.portfolio_cookie, + 'user_cookie': self.user_cookie, + 'broker': self.broker, + 'market_type': self.market_type, + 'strategy_name': self.strategy_name, + 'current_time': self._currenttime, + + 'allow_sellopen': self.allow_sellopen, + 'allow_t0': self.allow_t0, + 'margin_level': self.margin_level, + 'init_assets': self.init_assets, + 'cash': self.cash, + 'history': self.history, + 'trade_index': self.time_index, + 'running_time': datetime.datetime.now() + } + + @property + def code(self): + """该账户曾交易代码 用set 去重 + """ + return list(set([item[1] for item in self.history])) + + @property + def start_date(self): + return str(self.time_index[0])[0:10] + + @property + def end_date(self): + return str(self.time_index[-1])[0:10] + + @property + def history_table(self): + '交易历史的table' + return pd.DataFrame(data=self.history, columns=self._history_headers).sort_index() + + @property + def cash_table(self): + '现金的table' + _cash = pd.DataFrame(data=[self.cash[1::], self.time_index], index=[ + 'cash', 'datetime']).T + _cash = _cash.assign(date=_cash.datetime.apply(lambda x: str(x)[0:10])).assign( + account_cookie=self.account_cookie) + + return _cash.set_index(['datetime', 'account_cookie'], drop=False).sort_index() + + @property + def hold(self): + '持仓' + return pd.DataFrame(data=self.history, columns=self._history_headers).groupby('code').amount.sum().sort_index() + + @property + def trade(self): + '每次交易的pivot表' + return self.history_table.pivot_table(index=['datetime', 'account_cookie'], columns='code', values='amount').fillna(0).sort_index() + + @property + def daily_cash(self): + '每日交易结算时的现金表' + return self.cash_table.drop_duplicates(subset='date', keep='last').sort_index() + + @property + def daily_hold(self): + '每日交易结算时的持仓表' + data = self.trade.cumsum() + + data = data.assign(account_cookie=self.account_cookie).assign( + date=data.index.levels[0]) + data.date = data.date.apply(lambda x: str(x)[0:10]) + return data.set_index(['date', 'account_cookie'], drop=False).sort_index() + + # 计算assets的时候 需要一个market_data=QA.QA_fetch_stock_day_adv(list(data.columns),data.index[0],data.index[-1]) + # (market_data.to_qfq().pivot('close')*data).sum(axis=1)+user_cookie.get_account(a_1).daily_cash.set_index('date').cash + + @property + def latest_cash(self): + 'return the lastest cash' + return self.cash[-1] + + @property + def current_time(self): + 'return current time (in backtest/real environment)' + return self._currenttime + +
[docs] def reset_assets(self, init_assets=None): + 'reset_history/cash/' + self.sell_available = {} + self.history = [] + self.init_assets = init_assets + self.cash = [self.init_assets] + self.cash_available = self.cash[-1] # 在途资金
+ +
[docs] def receive_deal(self, message): + """[用于更新账户] + + [description] + + update history and cash + """ + if message['header']['status'] is TRADE_STATUS.SUCCESS: + self.time_index.append(str(message['body']['order']['datetime'])) + self.history.append( + [str(message['body']['order']['datetime']), str(message['body']['order']['code']), + float(message['body']['order']['price']), int(message['body']['order']['towards']) * + float(message['body']['order']['amount']), str( + message['header']['order_id']), str(message['header']['trade_id']), str(self.account_cookie), + float(message['body']['fee']['commission']), float(message['body']['fee']['tax'])]) + self.cash.append(float(self.cash[-1]) - float(message['body']['order']['price']) * + float(message['body']['order']['amount']) * message['body']['order']['towards'] - + float(message['body']['fee']['commission'])) + + return self.message
+ +
[docs] def send_order(self, code, amount, time, towards, price, order_model, amount_model): + """[summary] + + Arguments: + code {[type]} -- [description] + amount {[type]} -- [description] + time {[type]} -- [description] + towards {[type]} -- [description] + price {[type]} -- [description] + order_model {[type]} -- [description] + amount_model {[type]} -- [description] + + Returns: + [type] -- [description] + """ + + flag = False + date = str(time)[0:10] if len(str(time)) == 19 else str(time) + time = str(time) if len( + str(time)) == 19 else '{} 09:31:00'.format(str(time)[0:10]) + + amount = amount if amount_model is AMOUNT_MODEL.BY_AMOUNT else int( + amount / price) + if self.market_type is MARKET_TYPE.STOCK_CN: + amount = int(amount / 100) * 100 + + marketvalue = amount * price if amount_model is AMOUNT_MODEL.BY_AMOUNT else amount + + amount_model = AMOUNT_MODEL.BY_AMOUNT + if int(towards) > 0: + # 是买入的情况(包括买入.买开.买平) + if self.cash_available >= marketvalue: + self.cash_available -= marketvalue + flag = True + elif int(towards) < 0: + if self.allow_sellopen: + flag = True + if self.sell_available.get(code, 0) >= amount: + self.sell_available[code] -= amount + flag = True + + if flag and amount > 0: + return QA_Order(user_cookie=self.user_cookie, strategy=self.strategy_name, frequence=self.frequence, + account_cookie=self.account_cookie, code=code, market_type=self.market_type, + date=date, datetime=time, sending_time=time, callback=self.receive_deal, + amount=amount, price=price, order_model=order_model, towards=towards, + amount_model=amount_model) # init + else: + return flag
+ +
[docs] def settle(self): + '同步可用资金/可卖股票' + self.cash_available = self.cash[-1] + self.sell_available = self.hold
+ +
[docs] def on_bar(self, event): + 'while updating the market data' + print(event.market_data)
+ +
[docs] def on_tick(self, event): + 'on tick event' + pass
+ +
[docs] def from_message(self, message): + """resume the account from standard message + 这个是从数据库恢复账户时需要的""" + self.account_cookie = message.get('account_cookie', None) + self.portfolio_cookie = message.get('portfolio_cookie', None) + self.user_cookie = message.get('user_cookie', None) + self.broker = message.get('broker', None) + self.market_type = message.get('market_type', None) + self.strategy_name = message.get('strategy_name', None) + self._currenttime = message.get('current_time', None) + self.allow_sellopen = message.get('allow_sellopen', False) + self.allow_t0 = message.get('allow_t0', False) + self.margin_level = message.get('margin_level', False) + + self.history = message['history'] + self.cash = message['cash'] + self.time_index = message['trade_index'] + self.init_assets = message['init_assets'] + return self
+ + @property + def table(self): + """ + 打印出account的内容 + """ + return pd.DataFrame([self.message, ]).set_index('account_cookie', drop=False).T + +
[docs] def run(self, event): + 'QA_WORKER method' + if event.event_type is ACCOUNT_EVENT.SETTLE: + self.settle() + + elif event.event_type is ACCOUNT_EVENT.UPDATE: + self.receive_deal(event.message) + elif event.event_type is ACCOUNT_EVENT.MAKE_ORDER: + """generate order + if callback callback the order + if not return back the order + """ + data = self.send_order(code=event.code, amount=event.amount, time=event.time, + amount_model=event.amount_model, towards=event.towards, + price=event.price, order_model=event.order_model) + if event.callback: + event.callback(data) + else: + return data + elif event.event_type is ENGINE_EVENT.UPCOMING_DATA: + """update the market_data + 1. update the inside market_data struct + 2. tell the on_bar methods + """ + self._currenttime = event.market_data.datetime[-1] + if self.market_data is None: + self.market_data = event.market_data + else: + self.market_data = self.market_data + event.market_data + self.on_bar(event) + + if event.callback: + event.callback(event)
+ +
[docs] def save(self): + save_account(self.message)
+ +
[docs] def change_cash(self, money): + res = self.cash[-1]+money + if res >= 0: + # 高危操作 + self.cash[-1] = res
+ + +
[docs]class Account_handler(): + def __init__(self): + pass + +
[docs] def get_account(self, message): + pass
+ + +if __name__ == '__main__': + account = QA_Account() + # 创建一个account账户 +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAARP/QAPortfolio.html b/_build/html/_modules/QUANTAXIS/QAARP/QAPortfolio.html new file mode 100644 index 000000000..cfb2b11b7 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAARP/QAPortfolio.html @@ -0,0 +1,343 @@ + + + + + + + + QUANTAXIS.QAARP.QAPortfolio — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAARP.QAPortfolio

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+from functools import lru_cache
+import pandas as pd
+from QUANTAXIS.QAARP.QAAccount import QA_Account
+from QUANTAXIS.QAUtil import (DATABASE, QA_util_log_info,
+                              QA_util_random_with_topic)
+
+# pylint: disable=old-style-class, too-few-public-methods
+
+
+
[docs]class QA_Portfolio(): + + """ + QUANTAXIS 多账户 + 以及组合管理 + + # 适用 回测/实盘 + + # PORTFOLIO应当作为一个视图来处理,这个视图作为一个静态的观察点 可以去衡量风险 观察业绩等等 + @2018/02/26 + + :::::::::::::::::::::::::::::::::::::::::::::::: + :: ::STRATEGY 1 -- ACCOUNT 1 --{P1,P3} :: + :: USER ::STRATEGY 2 -- ACCOUNT 2 --{P1,P2} :: + :: ::STRATEGY 3 -- ACCOUNT 3 --{P2,P3} :: + :::::::::::::::::::::::::::::::::::::::::::::::: + + + PORTFOLIO + + 在portfolio中,我们希望通过cookie来控制account_unit + + 对于account的指标,要进行风险控制,组合成最优的投资组合的量 + + 用account的cookie来管理控制account + + portfolio里面的资产主要考虑的是 资金的分配 + """ + + def __init__(self, user_cookie=None, strategy_name=None, init_assets=1000000, cash=None, sell_available=None, history=None): + self.accounts = {} + self.portfolio_cookie = QA_util_random_with_topic('Portfolio') + self.user_cookie = user_cookie + self.strategy_name = strategy_name + # 和account一样的资产类 + self.init_assets = 1000000 if init_assets is None else init_assets + self.cash = [self.init_assets] if cash is None else cash + self.cash_available = self.cash[-1] # 可用资金 + self.sell_available = sell_available + self.history = [] if history is None else history + self.time_index = [] + + for cookie in self.accounts.keys(): + self.accounts[cookie] = QA_Account(account_cookie=cookie) + + def __repr__(self): + return '< QA_Portfolio {} with {} Accounts >'.format(self.portfolio_cookie, len(self.accounts.keys())) + +
[docs] def get_portfolio(self): + 'return the accounts dict' + return self.accounts
+ +
[docs] def add_account(self, account): + 'portfolio add a account/stratetgy' + if account.account_cookie not in self.accounts.keys(): + account.portfolio_cookie = self.portfolio_cookie + account.user_cookie = self.user_cookie + self.accounts[account.account_cookie] = account + else: + pass
+ +
[docs] def new_account(self, account_cookie=None): + 'portfolio create a account/strategy' + if account_cookie is None: + temp = QA_Account(portfolio_cookie=self.portfolio_cookie, + user_cookie=self.user_cookie) + if temp.account_cookie not in self.accounts.keys(): + self.accounts[temp.account_cookie] = temp + return temp + + else: + return self.new_account() + else: + if account_cookie not in self.accounts.keys(): + self.accounts[account_cookie] = QA_Account(portfolio_cookie=self.portfolio_cookie, + user_cookie=self.user_cookie, account_cookie=account_cookie) + return self.accounts[account_cookie] + else: + return self.new_account(account_cookie)
+ +
[docs] def get_account(self, cookie): + 'give the account_cookie and return the account/strategy back' + try: + return self.accounts[cookie] + except: + QA_util_log_info('Can not find this account') + return None
+ +
[docs] def cookie_mangement(self): + pass
+ + @property + def table(self): + return pd.concat([acc.table for acc in self.accounts.values()], axis=1) + +
[docs] def get_cash(self): + """拿到整个portfolio的可用资金 + + 统计每一个时间点的时候的cash总和 + """ + + pass
+ +
[docs] def pull(self, account_cookie=None, collection=DATABASE.account): + 'pull from the databases' + if account_cookie is None: + for item in self.accounts.keys(): + try: + message = collection.find_one({'account_cookie': item}) + QA_util_log_info('{} sync successfully'.format(item)) + except Exception as e: + QA_util_log_info( + '{} sync wrong \\\n wrong info {}'.format(item, e)) + self.accounts[item].from_message(message) + + else: + try: + message = collection.find_one( + {'account_cookie': account_cookie}) + QA_util_log_info('{} sync successfully'.format(item)) + except Exception as e: + QA_util_log_info( + '{} sync wrong \\\n wrong info {}'.format(account_cookie, e)) + self.accounts[account_cookie].from_message(message)
+ +
[docs] def push(self, account_cookie=None, collection=DATABASE.account): + 'push to databases' + message = self.accounts[account_cookie].message + if account_cookie is None: + for item in self.accounts.keys(): + try: + message = collection.find_one_and_update( + {'account_cookie': item}) + QA_util_log_info('{} sync successfully'.format(item)) + except Exception as e: + QA_util_log_info( + '{} sync wrong \\\n wrong info {}'.format(item, e)) + self.accounts[item].from_message(message) + + else: + try: + message = collection.find_one( + {'account_cookie': account_cookie}) + QA_util_log_info('{} sync successfully'.format(item)) + except Exception as e: + QA_util_log_info( + '{} sync wrong \\\n wrong info {}'.format(account_cookie, e)) + self.accounts[account_cookie].from_message(message)
+ + +
[docs]class QA_TEST_MAKEPortfolio(): + + def __init__(self): + """ + this is a dict for account_cookie----account instance + """ + self.account_list = dict() + +
[docs] def make_portfolio(self, account_list): + pass
+ + +
[docs]class QA_PortfolioView(): + """ + 对于Portfolio而言,一切都是基于内部的account的信息的变更而变更的 + + Portfolio不应该有过多可以修改的部分(作为一个view存在) + """ + + def __init__(self, account_list): + """ + ||portfolio|| + ||acc1_cookie--acc1||acc2-cookie--acc2||...|| + + + ||cash||assets||hold||history||trade_index|| + + + ||Risk_analysis||Performace_analysis|| + """ + self.account_list = dict( + zip([account.account_cookie for account in account_list], account_list)) + self.portfolio_cookie = QA_util_random_with_topic('Portfolio') + self.user_cookie = None + # self._broker = None + # self.user_cookie = None + # self._market_type = None + # self._strategy_name = None + # self._currenttime = None + # self._init_assets = None + # self._cash = None + # self._history = None + # self._trade_index = None + + @property + def account_cookie(self): + return [account.account_cookie for account in self.accounts] + + @property + def accounts(self): + """ + return all accounts inside the portfolio view + """ + return list(self.account_list.values()) + + @property + def start_date(self): + return str(pd.to_datetime(pd.Series([account.start_date for account in self.accounts])).min())[0:10] + + @property + def end_date(self): + return str(pd.to_datetime(pd.Series([account.end_date for account in self.accounts])).max())[0:10] + + @property + def code(self): + return pd.concat([pd.Series(account.code) for account in self.accounts]).drop_duplicates().tolist() + + @property + def init_assets(self): + return sum([account.init_assets for account in self.accounts]) + + @property + def daily_cash(self): + res = pd.DataFrame(sum([account.daily_cash.set_index( + 'datetime').cash for account in self.accounts])) + res = res.assign(date=res.index) + res.date = res.date.apply(lambda x: str(x)[0:10]) + return res + + @property + def daily_hold(self): + return pd.concat([account.daily_hold.set_index('date') for account in self.accounts]).groupby('date').sum()
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAARP/QARisk.html b/_build/html/_modules/QUANTAXIS/QAARP/QARisk.html new file mode 100644 index 000000000..0d9f4f039 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAARP/QARisk.html @@ -0,0 +1,367 @@ + + + + + + + + QUANTAXIS.QAARP.QARisk — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAARP.QARisk

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+
+"""收益性的包括年化收益率、净利润、总盈利、总亏损、有效年化收益率、资金使用率。
+
+风险性主要包括胜率、平均盈亏比、最大回撤比例、最大连续亏损次数、最大连续盈利次数、持仓时间占比、贝塔。
+
+综合性指标主要包括风险收益比,夏普比例,波动率,VAR,偏度,峰度等"""
+
+import math
+from functools import lru_cache
+
+import numpy as np
+import pandas as pd
+
+from QUANTAXIS.QAFetch.QAQuery_Advance import (QA_fetch_index_day_adv,
+                                               QA_fetch_stock_day_adv)
+from QUANTAXIS.QASU.save_account import save_riskanalysis
+from QUANTAXIS.QAUtil.QADate_trade import QA_util_get_trade_gap
+from QUANTAXIS.QAUtil.QAParameter import MARKET_TYPE
+
+
+
[docs]class QA_Risk(): + """QARISK 是一个风险插件 + + 需要加载一个account/portfolio类进来: + 需要有 + code,start_date,end_date,daily_cash,daily_hold + """ + + def __init__(self, account, benchmark_code='000300', benchmark_type=MARKET_TYPE.INDEX_CN): + self.account = account + self.benchmark_code = benchmark_code # 默认沪深300 + self.benchmark_type = benchmark_type + + self.fetch = {MARKET_TYPE.STOCK_CN: QA_fetch_stock_day_adv, + MARKET_TYPE.INDEX_CN: QA_fetch_index_day_adv} + self.market_data = QA_fetch_stock_day_adv( + self.account.code, self.account.start_date, self.account.end_date) + + self.assets = ((self.market_data.to_qfq().pivot('close') * self.account.daily_hold).sum( + axis=1) + self.account.daily_cash.set_index('date').cash).fillna(method='pad') + + self.time_gap = QA_util_get_trade_gap( + self.account.start_date, self.account.end_date) + self.init_assets= self.account.init_assets + + def __repr__(self): + return '< QA_RISK ANALYSIS ACCOUNT/PORTFOLIO >' + + def __call__(self): + return pd.DataFrame([self.message]) + + @property + def max_dropback(self): + """最大回撤 + """ + return max([self.assets.iloc[idx::].max() - self.assets.iloc[idx::].min() for idx in range(len(self.assets))]) / float(self.assets.iloc[0]) + + @property + def profit(self): + return self.calc_profit(self.assets) + + @property + def profit_pct(self): + """利润 + """ + return self.calc_profitpctchange(self.assets) + + @property + def annualize_return(self): + """年化收益 + + Returns: + [type] -- [description] + """ + + return self.calc_annualize_return(self.assets, self.time_gap) + + @property + def volatility(self): + """波动率 + + Returns: + [type] -- [description] + """ + return self.profit_pct.std() * math.sqrt(250) + + @property + def message(self): + return { + 'account_cookie': self.account.account_cookie, + 'portfolio_cookie': self.account.portfolio_cookie, + 'user_cookie': self.account.user_cookie, + 'annualize_return': self.annualize_return, + 'profit': self.profit, + 'max_dropback': self.max_dropback, + 'time_gap': self.time_gap, + 'volatility': self.volatility, + 'benchmark_code': self.benchmark_code, + 'beta': self.beta, + 'alpha': self.alpha, + 'sharpe': self.sharpe, + 'init_assets': self.init_assets, + 'last_assets': self.assets.iloc[-1] + } + + @property + def benchmark_data(self): + """ + 基准组合的行情数据(一般是组合,可以调整) + """ + return self.fetch[self.benchmark_type]( + self.benchmark_code, self.account.start_date, self.account.end_date) + + @property + def benchmark_assets(self): + """ + 基准组合的账户资产队列 + """ + return (self.benchmark_data.open / float(self.benchmark_data.open.iloc[0]) * float(self.init_assets)) + + @property + def benchmark_annualize_return(self): + """基准组合的年化收益 + + Returns: + [type] -- [description] + """ + + return self.calc_annualize_return(self.benchmark_assets, self.time_gap) + + @property + def benchmark_profitpct(self): + """ + benchmark 基准组合的收益百分比计算 + """ + return self.calc_profitpctchange(self.benchmark_assets) + + @property + def beta(self): + """ + beta比率 组合的系统性风险 + """ + return self.calc_beta(self.profit_pct.dropna(), self.benchmark_profitpct.dropna()) + + @property + def alpha(self): + """ + alpha比率 与市场基准收益无关的超额收益率 + """ + return self.calc_alpha(self.annualize_return, self.benchmark_annualize_return, self.beta, 0.05) + + @property + def sharpe(self): + """ + 夏普比率 + + """ + return self.calc_sharpe(self.annualize_return, self.volatility, 0.05) + + @property + def sortino(self): + """ + 索提诺比率 投资组合收益和下行风险比值 + + """ + pass + + @property + def calmar(self): + """ + 卡玛比率 + """ + pass + +
[docs] def set_benchmark(self, code, market_type): + self.benchmark_code = code + self.benchmark_type = market_type
+ +
[docs] def calc_annualize_return(self, assets, days): + return (float(assets.iloc[-1]) / float(assets.iloc[0]) -1 )/(float(days) /250 )
+ + # def calc_profit(self, assets): + # return (assets.iloc[-1] / assets.iloc[1]) - 1 + +
[docs] def calc_profitpctchange(self, assets): + return self.assets[::-1].pct_change()
+ +
[docs] def calc_beta(self, assest_profit, benchmark_profit): + + calc_cov = np.cov(assest_profit, benchmark_profit) + beta = calc_cov[0, 1] / calc_cov[1, 1] + return beta
+ +
[docs] def calc_alpha(self, annualized_returns, benchmark_annualized_returns, beta, r=0.05): + + alpha = (annualized_returns - r) - (beta) * \ + (benchmark_annualized_returns - r) + return alpha
+ +
[docs] def calc_profit(self, assets): + return (float(assets.iloc[-1]) / float(assets.iloc[0])) - 1
+ +
[docs] def calc_sharpe(self, annualized_returns, volatility_year, r=0.05): + '计算夏普比率' + return (annualized_returns - r) / volatility_year
+ +
[docs] def save(self): + """save to mongodb + + """ + save_riskanalysis(self.message)
+ + +
[docs]class QA_Performance(): + """ + QA_Performance是一个绩效分析插件 + + 需要加载一个account/portfolio类进来: + 需要有 + code,start_date,end_date,daily_cash,daily_hold + """ + + def __init__(self, account): + + self.account = account + self._style_title = ['beta', 'momentum', 'size', 'earning_yield', + 'volatility', 'growth', 'value', 'leverage', 'liquidity', 'reversal'] + + @property + def prefer(self): + pass + + @property + def style(self): + """风格分析 + """ + pass + +
[docs] def abnormal_active(self): + """ + 账户的成交发生异常成交记录的分析 + """ + pass
+ +
[docs] def brinson(self): + """Brinson Model analysis + """ + pass
+ +
[docs] def hold(self): + """持仓分析 + """ + pass
+ + @property + def accumulate_return(self): + """ + returns a pd-Dataframe format accumulate return for different periods + """ + pass + +
[docs] def save(self): + """save the performance analysis result to database + """ + pass
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAARP/QAStrategy.html b/_build/html/_modules/QUANTAXIS/QAARP/QAStrategy.html new file mode 100644 index 000000000..2096f8dee --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAARP/QAStrategy.html @@ -0,0 +1,113 @@ + + + + + + + + QUANTAXIS.QAARP.QAStrategy — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAARP.QAStrategy

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+
+from QUANTAXIS.QAARP.QAAccount import QA_Account
+
+
+
[docs]class QA_Strategy(QA_Account): + """account + + [description] + """ + def __init__(self): + super().__init__()
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAARP/QAUser.html b/_build/html/_modules/QUANTAXIS/QAARP/QAUser.html new file mode 100644 index 000000000..1f8088791 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAARP/QAUser.html @@ -0,0 +1,180 @@ + + + + + + + + QUANTAXIS.QAARP.QAUser — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAARP.QAUser

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+import pandas as pd
+from QUANTAXIS.QAARP.QAPortfolio import QA_Portfolio
+from QUANTAXIS.QAUtil.QALogs import QA_util_log_info
+from QUANTAXIS.QAUtil.QARandom import QA_util_random_with_topic
+from QUANTAXIS.QAUtil.QASetting import QA_Setting
+
+
+
[docs]class QA_User(): + """QA_User + User--Portfolio--Account/Strategy + """ + + def __init__(self): + self.setting = QA_Setting() + self.portfolio_list = {} + self.user_cookie = QA_util_random_with_topic('USER') + + def __repr__(self): + return '< QA_USER {} with {} portfolio >'.format(self.user_cookie, len(self.portfolio_list.keys())) + + @property + def table(self): + return pd.concat([po.table for po in self.portfolio_list.values()], axis=1) + +
[docs] def client(self): + 'user.client to connect database' + return self.setting.client
+ +
[docs] def connect_database(self, ip='127.0.0.1', port=27017): + 'connect is also a way to change database from IP_A to IP_B' + self.setting.change(ip, port)
+ +
[docs] def login(self, user_name, password): + 'login to a database' + if self.setting.login(user_name, password): + QA_util_log_info('SUCCESS') + else: + QA_util_log_info('FAILD')
+ +
[docs] def new_portfolio(self): + 'create a portfolio' + _portfolio = QA_Portfolio(user_cookie=self.user_cookie) + if _portfolio.portfolio_cookie not in self.portfolio_list.keys(): + self.portfolio_list[_portfolio.portfolio_cookie] = _portfolio + return _portfolio
+ +
[docs] def get_portfolio(self, portfolio): + 'get a portfolio' + return self.portfolio_list[portfolio]
+ +
[docs] def generate_simpleaccount(self): + """make a simple account with a easier way + 如果当前user中没有创建portfolio, 则创建一个portfolio,并用此portfolio创建一个account + 如果已有一个或多个portfolio,则使用第一个portfolio来创建一个account + """ + if len(self.portfolio_list.keys()) < 1: + po = self.new_portfolio() + else: + po = list(self.portfolio_list.values())[0] + ac = po.new_account() + return ac, po
+ +
[docs] def register_account(self, account): + if len(self.portfolio_list.keys()) < 1: + po = self.new_portfolio() + else: + po = list(self.portfolio_list.values())[0] + po.add_account(account) + return (po, account)
+ + +if __name__ == '__main__': + user = QA_User() + portfolio1 = user.new_portfolio() + ac1 = user.get_portfolio(portfolio1).new_account() + + print(user) + print(user.get_portfolio(portfolio1)) + print(user.get_portfolio(portfolio1).get_account(ac1)) +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAAnalysis/QAAnalysis_block.html b/_build/html/_modules/QUANTAXIS/QAAnalysis/QAAnalysis_block.html new file mode 100644 index 000000000..154e7b2fc --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAAnalysis/QAAnalysis_block.html @@ -0,0 +1,218 @@ + + + + + + + + QUANTAXIS.QAAnalysis.QAAnalysis_block — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAAnalysis.QAAnalysis_block

+# coding:utf-8
+
+# 输入一个stock_list/stock_block
+# 生成相关因子
+
+import datetime
+
+import pandas as pd
+
+from QUANTAXIS.QAAnalysis.QAAnalysis_dataframe import QAAnalysis_stock
+from QUANTAXIS.QAFetch.QAQuery import QA_fetch_stock_info
+from QUANTAXIS.QAFetch.QAQuery_Advance import (QA_fetch_stock_block_adv,
+                                               QA_fetch_stock_day_adv,
+                                               QA_fetch_stock_min_adv)
+from QUANTAXIS.QAFetch.QATdx import QA_fetch_get_stock_info
+from QUANTAXIS.QAFetch.QATdx_adv import QA_Tdx_Executor
+from QUANTAXIS.QAUtil.QADate_trade import QA_util_get_real_datelist
+
+
+
[docs]def get_gap_trade(gap): + return QA_util_get_real_datelist(datetime.date.today() + datetime.timedelta(days=-int(gap)), datetime.date.today())
+ + +#from QUANTAXIS.QAAnalysis.QAAnalysis_dataframe import QAAnalysis_stock +
[docs]class QAAnalysis_block(): + def __init__(self, block=None, block_name=None, lens=90, *args, **kwargs): + + try: + self.block_code = block.code + except: + self.block_code = block + + if block_name is not None: + self.block_code = QA_fetch_stock_block_adv().get_block(block_name).code + self.lens = lens + # self.Executor=QA_Tdx_Executor() + +
[docs] def market_data(self, start, end, _type='day'): + return QA_fetch_stock_day_adv(self.block_code, start, end)
+ + @property + def week_data(self): + 'this weekly data' + 'return a QUANTAXIS DATASTRUCT' + _start, _end = get_gap_trade(7) + return self.market_data(_start, _end) + + @property + def month_data(self): + 'this monthly data' + 'return a QUANTAXIS DATASTRUCT' + _start, _end = get_gap_trade(90) + return self.market_data(_start, _end) + + @property + def _data(self): + _start, _end = get_gap_trade(self.lens) + return self.market_data(_start, _end) + +
[docs] def block_price(self, market_data=None): + if market_data is None: + market_data = self._data.to_qfq() + else: + market_data = market_data.to_qfq() + return QAAnalysis_stock(market_data).price.groupby('date').mean()
+ +
[docs] def block_pcg(self, market_data=None): + if market_data is None: + market_data = self._data.to_qfq() + else: + market_data = market_data.to_qfq() + return QAAnalysis_stock(market_data).day_pct_change.groupby('date').mean()
+ +
[docs] def stock_turnover(self, market_data=None): + if market_data is None: + market_data = self._data.to_qfq() + else: + market_data = market_data.to_qfq() + _data = market_data.data + _info = self.stock_info() + _data['ltgb'] = _data.code.apply(lambda x: _info.liutongguben[x]) + _data['turnover'] = 100 * _data['volume'] / _data['ltgb'] + return _data
+ +
[docs] def block_turnover(self, market_data=None): + return self.stock_turnover(market_data).turnover.groupby('date').mean()
+ +
[docs] def stock_info(self): + data = [] + + for item in self.block_code: + try: + _data = QA_fetch_stock_info(item) + except: + _data = QA_fetch_get_stock_info(item) + data.append(_data) + + return pd.concat(data).set_index('code', drop=False)
+ +
[docs] def res(self): + import matplotlib.pyplot as plt + self.block_pcg().plot() + self.block_turnover().plot() + plt.show()
+ + + +
[docs]class QAAnalysis_codewithblock(): + def __init__(self, block): + self.block = block + self.code = block.code
+ + + + + +if __name__ == "__main__": + import QUANTAXIS as QA + # print(get_this_week()) + ana = QAAnalysis_block( + QA.QA_fetch_stock_block_adv().get_block('昨日涨停').code) + + """ + 计算换手率 + d=QA.QA_fetch_get_stock_day('tdx','000001','2017-11-14','2017-11-15','00').vol.values[0]*100 # 一手100股 + f=QA.QA_fetch_get_stock_info('tdx','000001').liutongguben.values[0] + turnover=d/f + """ + # print(js) + + x = [] + y = [] + block = QA.QA_fetch_stock_block_adv().get_type('gn').block_name + for item in block: + print(item) + data = QAAnalysis_block(block_name=item) + x.append(data.block_pcg()) + y.append(data.block_turnover()) + print(len(x)) + print(len(y)) +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAAnalysis/QAAnalysis_dataframe.html b/_build/html/_modules/QUANTAXIS/QAAnalysis/QAAnalysis_dataframe.html new file mode 100644 index 000000000..d0ed981a7 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAAnalysis/QAAnalysis_dataframe.html @@ -0,0 +1,311 @@ + + + + + + + + QUANTAXIS.QAAnalysis.QAAnalysis_dataframe — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAAnalysis.QAAnalysis_dataframe

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+
+import statistics
+from functools import lru_cache
+
+
+#import scipy
+#import statsmodels
+#from scipy import integrate, optimize, stats
+
+#from QUANTAXIS.QAData.QADataStruct import QA_DataStruct_Index_day,QA_DataStruct_Index_min,QA_DataStruct_Stock_day,QA_DataStruct_Stock_min
+
+
+
[docs]class QAAnalysis_stock(): + """ + 行情分析器 + + 计算所有的指标 + + """ + + def __init__(self, dataStruct, *args, **kwargs): + try: + # 如果是QA_Data_系列 + self.data = dataStruct.data + self._data = dataStruct + except AttributeError: + # 如果是dataframe + self.data = dataStruct + + # self.data=DataSturct.data + + def __repr__(self): + return '< QAAnalysis_Stock >' + + def __call__(self): + return self.data + + # 使用property进行懒运算 + + @property + def open(self): + return self.data['open'] + + @property + def high(self): + return self.data['high'] + + @property + def low(self): + return self.data['low'] + + @property + def close(self): + return self.data['close'] + + @property + def vol(self): + if 'volume' in self.data.columns: + return self.data['volume'] + else: + return self.data['vol'] + + @property + def volume(self): + if 'volume' in self.data.columns: + return self.data['volume'] + else: + return self.data['vol'] + + @property + def date(self): + + return self.data.index.levels[self.data.index.names.index( + 'date')] if 'date' in self.data.index.names else self.data['date'] + + @property + def datetime(self): + + return self.data.index.levels[self.data.index.names.index( + 'datetime')] if 'datetime' in self.data.index.names else self.data.index.levels[self.data.index.names.index( + 'date')] + + @property + def index(self): + return self.data.index + + # 均价 + @property + def price(self): + return 0.25 * (self.open + self.close + self.high + self.low) + + @property + def max(self): + return self.price.max() + + @property + def min(self): + return self.price.min() + + @property + def mean(self): + return self.price.mean() + # 一阶差分序列 + + @property + def price_diff(self): + return self.price.diff(1) + + # 样本方差(无偏估计) population variance + @property + def pvariance(self): + return statistics.pvariance(self.price) + + # 方差 + @property + def variance(self): + + return statistics.variance(self.price) + # 标准差 + + @property + def day_pct_change(self): + return (self.open - self.close) / self.open + + @property + def stdev(self): + + return statistics.stdev(self.price) + # 样本标准差 + + @property + def pstdev(self): + return statistics.pstdev(self.price) + + # 调和平均数 + @property + def mean_harmonic(self): + return statistics.harmonic_mean(self.price) + + # 众数 + @property + def mode(self): + return statistics.mode(self.price) + + # 波动率 + + # 振幅 + @property + def amplitude(self): + return self.max - self.min + # 偏度 Skewness + + @property + def skewnewss(self): + return self.price.skew() + # 峰度Kurtosis + + @property + def kurtosis(self): + return self.price.kurt() + # 百分数变化 + + @property + def pct_change(self): + return self.price.pct_change() + + # 平均绝对偏差 + @property + def mad(self): + return self.price.mad() + + # 函数 指标计算 +
[docs] @lru_cache() + def add_func(self, func, *arg, **kwargs): + return func(self.data, *arg, **kwargs)
+ + +
[docs]def shadow_calc(data): + """计算上下影线 + + Arguments: + data {DataStruct.slice} -- 输入的是一个行情切片 + + Returns: + up_shadow {float} -- 上影线 + down_shdow {float} -- 下影线 + entity {float} -- 实体部分 + date {str} -- 时间 + code {str} -- 代码 + """ + + up_shadow = abs(data.high - (max(data.open, data.close))) + down_shadow = abs(data.low - (min(data.open, data.close))) + entity = abs(data.open - data.close) + towards = True if data.open < data.close else False + print('=' * 15) + print('up_shadow : {}'.format(up_shadow)) + print('down_shadow : {}'.format(down_shadow)) + print('entity: {}'.format(entity)) + print('towards : {}'.format(towards)) + return up_shadow, down_shadow, entity, data.date, data.code
+ + +
[docs]class shadow(): + def __init__(self, data): + self.data = data + +
[docs] def shadow_panel(self): + return
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAAnalysis/QAAnalysis_machinelearning.html b/_build/html/_modules/QUANTAXIS/QAAnalysis/QAAnalysis_machinelearning.html new file mode 100644 index 000000000..6eaf0cf33 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAAnalysis/QAAnalysis_machinelearning.html @@ -0,0 +1,125 @@ + + + + + + + + QUANTAXIS.QAAnalysis.QAAnalysis_machinelearning — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAAnalysis.QAAnalysis_machinelearning

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+"""
+一个通用的可以接入不同模型的类
+"""
+
+
+
[docs]class QAAnalysis_Machine_Learning(): + def __init__(self, *args, **kwargs): + pass + +
[docs] def training(self): + pass
+ +
[docs] def data_co(self): + pass
+ +
[docs] def cross_valid(self): + pass
+ +
[docs] def load_modules(self): + pass
+ +
[docs] def load_data(self): + pass
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAAnalysis/QAAnalysis_series.html b/_build/html/_modules/QUANTAXIS/QAAnalysis/QAAnalysis_series.html new file mode 100644 index 000000000..3107f7081 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAAnalysis/QAAnalysis_series.html @@ -0,0 +1,105 @@ + + + + + + + + QUANTAXIS.QAAnalysis.QAAnalysis_series — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAAnalysis.QAAnalysis_series

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+
+
[docs]def QAAnalysis_Series_slope(data): + pass
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAAnalysis/QAAnalysis_tick.html b/_build/html/_modules/QUANTAXIS/QAAnalysis/QAAnalysis_tick.html new file mode 100644 index 000000000..e56d0a8b2 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAAnalysis/QAAnalysis_tick.html @@ -0,0 +1,130 @@ + + + + + + + + QUANTAXIS.QAAnalysis.QAAnalysis_tick — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAAnalysis.QAAnalysis_tick

+# coding=utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+from QUANTAXIS.QAData.QADataStruct import QA_DataStruct_Stock_transaction
+from QUANTAXIS.QAFetch.QATdx import QA_fetch_get_stock_transaction, QA_fetch_get_future_transaction_realtime
+from QUANTAXIS.QAFetch.QAQuery import QA_fetch_stock_info
+
+
+
[docs]class QAAnalysis_Transaction(): + def __init__(self): + self.data = None + self.code = None + self.stock_info = None + +
[docs] def get_data(self, code, start, end): + self.code = code + try: + self.data = QA_DataStruct_Stock_transaction( + QA_fetch_get_stock_transaction(code, start, end)) + return self.data + except Exception as e: + raise e
+ +
[docs] def get_stock_info(self, code): + try: + self.stock_info = QA_fetch_stock_info(code) + except Exception as e: + raise e
+ +
[docs] def winner(self): + pass
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAAnalysis/QAAnalysis_trade.html b/_build/html/_modules/QUANTAXIS/QAAnalysis/QAAnalysis_trade.html new file mode 100644 index 000000000..2c59c8ece --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAAnalysis/QAAnalysis_trade.html @@ -0,0 +1,178 @@ + + + + + + + + QUANTAXIS.QAAnalysis.QAAnalysis_trade — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAAnalysis.QAAnalysis_trade

+# coding=utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+
+from statistics import mean
+
+import pandas as pd
+
+from QUANTAXIS.QAARP.QAAccount import QA_Account
+from QUANTAXIS.QAARP.QARisk import QA_Performance, QA_Risk
+from QUANTAXIS.QAEngine.QAEvent import QA_Event
+from QUANTAXIS.QAFetch.QAQuery import (QA_fetch_backtest_history,
+                                       QA_fetch_backtest_info)
+from QUANTAXIS.QAFetch.QAQuery_Advance import QA_fetch_stock_day_adv
+from QUANTAXIS.QAMarket.QABacktestBroker import QA_BacktestBroker
+from QUANTAXIS.QAUtil.QADate_trade import (QA_util_date_gap,
+                                           QA_util_get_next_day)
+from QUANTAXIS.QAUtil.QAParameter import (AMOUNT_MODEL, ORDER_DIRECTION,
+                                          ORDER_MODEL)
+
+
+
[docs]class QAAnalysis_trade(): + + """ + Account/Portfolio是一个标准单元,所有成交记录分析 都会被加载到该单元中进行分析 + 当我们只有一个成交记录的时候,我们会创建一个账户单元 + """ + + def __init__(self, init_assets, *args, **kwargs): + self.account = QA_Account(init_assets=init_assets) + self.backtest_broker = QA_BacktestBroker() + +
[docs] def import_trade(self, trade): + """ + trade是一个可迭代的list/generator + """ + for item in trade: + self.make_deal(item.code, item.datetime, item.amount, + item.towards, item.price.item.order_model, item.amount_model)
+ +
[docs] def make_deal(self, code, datetime, amount=100, towards=ORDER_DIRECTION.BUY, price=0, order_model=ORDER_MODEL.MARKET, amount_model=AMOUNT_MODEL.BY_AMOUNT): + """ + 这是一个一定会成交,并且立刻结转(及t+0)的交易入口 + """ + self.account.receive_deal(self.backtest_broker.receive_order(QA_Event(order=self.account.send_order( + code=code, time=datetime, amount=amount, towards=towards, price=price, order_model=order_model, amount_model=amount_model + )))) + self.account.settle()
+ + + + # @property + # def codes(self): + # return self.code + + # def get_stock_tradehistory(self, code): + # return self.history.query('code=="{}"'.format(code)) + + # def get_stock_tradedetail(self, code): + # return self.detail.query('code=="{}"'.format(code)) + + # def get_loss_trade(self, num=5): + # return self.detail[self.detail.pnl_precentage <= 0].sort_values(by=['pnl_precentage'], ascending=True).head(num) + + # def get_profit_trade(self, num=5): + # return self.detail[self.detail.pnl_precentage >= 0].sort_values(by=['pnl_precentage'], ascending=False).head(num) + + # def get_trade_marketdata(self, rx, gap=3): + # return QA_fetch_stock_day_adv(rx.code.values[0], QA_util_date_gap(rx.date.values[0], gap, methods='lt'), QA_util_date_gap(rx.sell_date.values[0][-1], gap, methods='gt')) + + # def get_trade_before_and_after_pnl(self, rx, N=3, M=10): + # data = self.get_trade_marketdata(rx, M) + + +def _mean(list_): + if len(list_) > 0: + return mean(list_) + else: + return 'No Data' +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QABacktest/QAAnalysis.html b/_build/html/_modules/QUANTAXIS/QABacktest/QAAnalysis.html new file mode 100644 index 000000000..0cabb8f2a --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QABacktest/QAAnalysis.html @@ -0,0 +1,340 @@ + + + + + + + + QUANTAXIS.QABacktest.QAAnalysis — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QABacktest.QAAnalysis

+# Encoding:UTF-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+
+"""
+Analysis Center for Backtest
+we will give some function
+"""
+import math
+import sys
+
+import numpy
+import pandas as pd
+
+from QUANTAXIS.QAFetch.QAQuery import QA_fetch_stock_day
+from QUANTAXIS.QAUtil import QA_util_log_info, trade_date_sse
+
+
+
[docs]def QA_backtest_analysis_backtest(client, code_list, assets_d, account_days, message, total_date, benchmark_data): + + # 主要要从message_history分析 + # 1.收益率 + # 2.胜率 + # 3.回撤 + """ + Annualized Returns: 策略年化收益率。表示投资期限为一年的预期收益率。 + 具体计算方式为 (策略最终价值 / 策略初始价值)^(250 / 回测交易日数量) - 1 + + Alpha:阿尔法 + 具体计算方式为 (策略年化收益 - 无风险收益) - beta × (参考标准年化收益 - 无风险收益),这里的无风险收益指的是中国固定利率国债收益率曲线上10年期国债的年化到期收益率。 + + Beta:贝塔 + 具体计算方法为 策略每日收益与参考标准每日收益的协方差 / 参考标准每日收益的方差 。 + + Sharpe Ratio:夏普比率。表示每承受一单位总风险,会产生多少的超额报酬。 + 具体计算方法为 (策略年化收益率 - 回测起始交易日的无风险利率) / 策略收益波动率 。 + + Volatility:策略收益波动率。用来测量资产的风险性。 + 具体计算方法为 策略每日收益的年化标准差 。 + + Information Ratio:信息比率。衡量超额风险带来的超额收益。 + 具体计算方法为 (策略每日收益 - 参考标准每日收益)的年化均值 / 年化标准差 。 + + Max Drawdown:最大回撤。描述策略可能出现的最糟糕的情况。 + 具体计算方法为 max(1 - 策略当日价值 / 当日之前虚拟账户最高价值) + + + 单次交易收益 + 收益/次数的频次直方图 + 单日最大持仓 + """ + # 数据检查 + if (len(benchmark_data)) < 1: + QA_util_log_info('Wrong with benchmark data ! ') + sys.exit() + + # 计算一个benchmark + # 这个benchmark 是在开始的那天 市价买入和策略所选标的一致的所有股票,然后一直持仓 + data = pd.concat([pd.DataFrame(message['body']['account']['history'], + columns=['time', 'code', 'price', 'towards', 'amount', 'order_id', 'trade_id', 'commission']), + pd.DataFrame(message['body']['account']['assets'], columns=['assets'])], axis=1) + data['time'] = pd.to_datetime(data['time']) + data.set_index('time', drop=False, inplace=True) + + trade_history = message['body']['account']['history'] + cash = message['body']['account']['cash'] + assets = message['body']['account']['assets'] + + #assets_= data.resample('D').last().dropna() + # 计算交易日 + trade_date = account_days + # benchmark资产 + benchmark_assets = QA_backtest_calc_benchmark( + benchmark_data, assets[0]) + # d2=pd.concat([data.resample('D').last(),pd.DataFrame(benchmark_assets,columns=['benchmark'])]) + # benchmark年化收益 + benchmark_annualized_returns = QA_backtest_calc_profit_per_year( + benchmark_assets, len(total_date)) + # 计算账户的收益 + + # days=len(assest_history)-1 + # 策略年化收益 + annualized_returns = QA_backtest_calc_profit_per_year( + assets_d, len(total_date)) + + # 收益矩阵 + assest_profit = QA_backtest_calc_profit_matrix(assets) + benchmark_profit = QA_backtest_calc_profit_matrix(benchmark_assets) + + # 策略日收益 + profit_day = QA_backtest_calc_profit_matrix(assets_d) + # 胜率 + win_rate = QA_backtest_calc_win_rate(assest_profit) + # 日胜率 + win_rate_day = QA_backtest_calc_win_rate(profit_day) + # 年化波动率 + volatility_year = QA_backtest_calc_volatility(profit_day) + benchmark_volatility_year = QA_backtest_calc_volatility(benchmark_profit) + # 夏普比率 + sharpe = QA_backtest_calc_sharpe( + annualized_returns, 0.05, volatility_year) + + # 最大回撤 + max_drop = QA_backtest_calc_dropback_max(assets_d) + + # 计算beta + beta = QA_backtest_calc_beta(profit_day, benchmark_profit) + # 计算Alpha + alpha = QA_backtest_calc_alpha( + annualized_returns, benchmark_annualized_returns, beta, 0.05) + message = { + 'code': code_list, + 'annualized_returns': annualized_returns, + 'benchmark_annualized_returns': benchmark_annualized_returns, + 'assets': assets_d[1:], + 'benchmark_assets': benchmark_assets[1:], + 'vol': volatility_year, + 'benchmark_vol': benchmark_volatility_year, + 'sharpe': sharpe, + 'alpha': alpha, + 'beta': beta, + 'total_date': total_date, + 'trade_date': trade_date, + 'max_drop': max_drop, + 'win_rate': win_rate} + return message
+ + +
[docs]def QA_backtest_calc_assets(trade_history, assets): + assets_d = [] + trade_date = [] + for i in range(0, len(trade_history), 1): + if trade_history[i][0] not in trade_date: + trade_date.append(trade_history[i][0]) + assets_d.append(assets[i]) + else: + assets_d.pop(-1) + assets_d.append(assets[i]) + + return assets_d
+ + +
[docs]def QA_backtest_calc_benchmark(benchmark_data, init_assets): + + return list(benchmark_data['close'] / float(benchmark_data['open'][0]) * float(init_assets))
+ + +
[docs]def QA_backtest_calc_alpha(annualized_returns, benchmark_annualized_returns, beta, r): + + alpha = (annualized_returns - r) - (beta) * \ + (benchmark_annualized_returns - r) + return alpha
+ + +
[docs]def QA_backtest_calc_beta(assest_profit, benchmark_profit): + if len(assest_profit) < len(benchmark_profit): + for i in range(0, len(benchmark_profit) - len(assest_profit), 1): + assest_profit.append(0) + elif len(assest_profit) > len(benchmark_profit): + for i in range(0, len(assest_profit) - len(benchmark_profit), 1): + benchmark_profit.append(0) + calc_cov = numpy.cov(assest_profit, benchmark_profit) + beta = calc_cov[0, 1] / calc_cov[1, 1] + return beta
+ + +
[docs]def QA_backtest_calc_profit(assest_history): + return (assest_history[-1] / assest_history[1]) - 1
+ + +
[docs]def QA_backtest_calc_profit_per_year(assest_history, days): + return math.pow(float(assest_history[-1]) / float(assest_history[0]), 250.0 / float(days)) - 1.0
+ + +
[docs]def QA_backtest_calc_profit_matrix(assest_history): + assest_profit = [] + if len(assest_history) > 1: + assest_profit = [assest_history[i + 1] / assest_history[i] - + 1.0 for i in range(len(assest_history) - 1)] + return assest_profit
+ + +
[docs]def QA_backtest_calc_volatility(assest_profit_matrix): + # 策略每日收益的年化标准差 + assest_profit = assest_profit_matrix + + volatility_day = numpy.std(assest_profit) + volatility_year = volatility_day * math.sqrt(250) + return volatility_year
+ + +
[docs]def QA_backtest_calc_dropback_max(history): + drops = [] + for i in range(1, len(history), 1): + maxs = max(history[:i]) + cur = history[i - 1] + drop = 1 - cur / maxs + drops.append(drop) + max_drop = max(drops) + return max_drop
+ + +
[docs]def QA_backtest_calc_sharpe(annualized_returns, r, volatility_year): + '计算夏普比率' + return (annualized_returns - r) / volatility_year
+ + +
[docs]def QA_backtest_calc_trade_date(history): + '计算交易日期' + trade_date = [] + + # trade_date_sse.index(history[-1][0])-trade_date_sse.index(history[0][0]) + for i in range(0, len(history), 1): + if history[i][0] not in trade_date: + trade_date.append(history[i][0]) + return trade_date
+ + +
[docs]def calc_trade_time(history): + return len(history)
+ + +
[docs]def calc_every_pnl(detail): + pass
+ + +
[docs]def QA_backtest_calc_win_rate(profit_day): + # 大于0的次数 + abovez = 0 + belowz = 0 + for i in range(0, len(profit_day) - 1, 1): + if profit_day[i] > 0: + abovez = abovez + 1 + elif profit_day[i] < 0: + belowz = belowz + 1 + if belowz == 0: + belowz = 1 + if abovez == 0: + abovez = 1 + win_rate = abovez / (abovez + belowz) + return win_rate
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QABacktest/QABacktest.html b/_build/html/_modules/QUANTAXIS/QABacktest/QABacktest.html new file mode 100644 index 000000000..d84bdccff --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QABacktest/QABacktest.html @@ -0,0 +1,243 @@ + + + + + + + + QUANTAXIS.QABacktest.QABacktest — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QABacktest.QABacktest

+# coding=utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+
+import time
+from functools import lru_cache
+
+from QUANTAXIS.QAARP.QAPortfolio import QA_Portfolio
+from QUANTAXIS.QAARP.QAUser import QA_User
+from QUANTAXIS.QAEngine.QAEvent import QA_Event
+from QUANTAXIS.QAFetch.QAQuery_Advance import QA_fetch_stock_day_adv, QA_fetch_stock_min_adv
+from QUANTAXIS.QAMarket.QABacktestBroker import QA_BacktestBroker
+from QUANTAXIS.QAMarket.QAMarket import QA_Market
+from QUANTAXIS.QAUtil.QAParameter import (AMOUNT_MODEL, BROKER_EVENT,
+                                          BROKER_TYPE, ENGINE_EVENT, FREQUENCE,
+                                          MARKET_TYPE, ORDER_DIRECTION,
+                                          ORDER_MODEL)
+
+
+
+
[docs]class QA_Backtest(): + """BACKTEST + + BACKTEST的主要目的: + + - 引入时间轴环境,获取全部的数据,然后按生成器将数据迭代插入回测的BROKER + (这一个过程是模拟在真实情况中市场的时间变化和价格变化) + + - BROKER有了新数据以后 会通知MARKET交易前置,MARKET告知已经注册的所有的ACCOUNT 有新的市场数据 + + - ACCOUNT 获取了新的市场函数,并将其插入他已有的数据中(update) + + - ACCOUNT 底下注册的策略STRATEGY根据新的市场函数,产生新的买卖判断,综合生成信号 + + - 买卖判断通过交易前置发送给对应的BROKER,进行交易 + + - BROKER发送SETTLE指令 结束这一个bar的所有交易,进行清算 + + - 账户也进行清算,更新持仓,可卖,可用现金等 + + - 迭代循环直至结束回测 + + - 回测去计算这段时间的各个账户收益,并给出综合的最终结果 + + """ + + def __init__(self, market_type, frequence, start, end, code_list, commission_fee,): + self.user = QA_User() + self.if_settled = False + self.account = None + self.portfolio = None + + self.market = QA_Market() + self.market_type = market_type + self.frequence = frequence + self.broker = QA_BacktestBroker(commission_fee) + self.broker_name = 'backtest_broker' + + self.start = start + self.end = end + self.code_list = code_list + + if self.market_type is MARKET_TYPE.STOCK_CN and self.frequence is FREQUENCE.DAY: + self.ingest_data = QA_fetch_stock_day_adv( + self.code_list, self.start, self.end).to_qfq().panel_gen + elif self.market_type is MARKET_TYPE.STOCK_CN and self.frequence[-3:] == 'min': + self.ingest_data = QA_fetch_stock_min_adv( + self.code_list, self.start, self.end, self.frequence).to_qfq().panel_gen + + def _generate_account(self): + """generate a simple account + """ + + self.account, self.portfolio = self.user.generate_simpleaccount() + +
[docs] def start_market(self): + """start the market thread and register backtest broker thread + """ + + self.market.start() + self.market.register(self.broker_name, self.broker) + self.market.login(self.broker_name, self.account.account_cookie, + self.account)
+ +
[docs] def run(self): + """generator driven data flow + """ + # 如果出现了日期的改变 才会进行结算的事件 + + _date = None + for data in self.ingest_data:#对于在ingest_data中的数据 + date = data.date[0]# + if self.market_type is MARKET_TYPE.STOCK_CN: #如果是股票市场 + if _date != date:# 如果新的date + self.market._settle(self.broker_name) + elif self.market_type in [MARKET_TYPE.FUND_CN, MARKET_TYPE.INDEX_CN, MARKET_TYPE.FUTURE_CN]: + self.market._settle(self.broker_name) + self.broker.run(QA_Event( + event_type=ENGINE_EVENT.UPCOMING_DATA, + market_data=data)) + self.market.upcoming_data( + self.broker_name, data) + self.market.trade_engine.join() + + _date = date + + self.after_success()
+ +
[docs] def after_success(self): + """called when all trading fininshed, for performance analysis + """ + + for po in self.user.portfolio_list.keys(): + for ac in self.user.get_portfolio(po).accounts.keys(): + accounts = self.user.get_portfolio(po).get_account(ac) + print(accounts.hold) + + print(accounts.history_table) + + self.stop()
+ +
[docs] def stop(self): + """stop all the market trade enging threads and all subthreads + """ + + self.market.trade_engine.stop_all() + self.market.trade_engine.stop()
+ + +
[docs]class BACKTEST_FRAMEWORK(): + pass
+ +if __name__ == '__main__': + backtest = QA_Backtest(market_type=MARKET_TYPE.STOCK_CN, + frequence=FREQUENCE.DAY, + start='2017-01-01', + end='2017-01-31', + code_list=['000001', '600010'], + commission_fee=0.00015) + backtest._generate_account() + backtest.start_market() + backtest.run() + + # backtest.run() +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QABacktest/QAResult.html b/_build/html/_modules/QUANTAXIS/QABacktest/QAResult.html new file mode 100644 index 000000000..40b3d2e1a --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QABacktest/QAResult.html @@ -0,0 +1,185 @@ + + + + + + + + QUANTAXIS.QABacktest.QAResult — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QABacktest.QAResult

+# coding=utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+
+from statistics import mean
+
+import pandas as pd
+
+from QUANTAXIS.QAFetch.QAQuery import (QA_fetch_backtest_history,
+                                       QA_fetch_backtest_info)
+from QUANTAXIS.QAFetch.QAQuery_Advance import QA_fetch_stock_day_adv
+from QUANTAXIS.QAUtil.QADate_trade import QA_util_date_gap
+
+
+
[docs]class backtest_result_analyzer(): + def __init__(self, cookie_id, *args, **kwargs): + self.cookie = cookie_id + self.backtest_history = QA_fetch_backtest_history(cookie=self.cookie) + self.backtest_info = QA_fetch_backtest_info(account_cookie=self.cookie) + + @property + def history(self): + data = pd.DataFrame(self.backtest_history[0]['history'], columns=[ + 'datetime', 'code', 'price', 'towards', 'amounts', 'o_id', 'd_id', 'commission']) + return data.drop(['o_id', 'd_id'], axis=1) + + @property + def detail(self): + detail = pd.DataFrame(self.backtest_history[0]['detail'], columns=['date', 'code', 'price', 'amounts', 'order_id', + 'trade_id', 'sell_price', 'sell_order_id', + 'sell_trade_id', 'sell_date', 'left_amount', + 'commission']) + + detail['sell_average'] = detail['sell_price'].apply(lambda x: _mean(x)) + + try: + detail['pnl_price'] = detail['sell_average'] - \ + detail['price'] + + detail['pnl'] = detail['pnl_price'] * ( + detail['amounts'] - detail['left_amount']) - detail['commission'] + + detail['pnl_precentage'] = detail['pnl_price'] / detail['price'] + except: + pass + + return detail.drop( + ['order_id', 'trade_id', 'sell_order_id', 'sell_trade_id'], axis=1) + + @property + def codes(self): + return self.history.code.unique().tolist() + +
[docs] def get_stock_tradehistory(self, code): + return self.history.query('code=="{}"'.format(code))
+
[docs] def get_stock_tradedetail(self, code): + return self.detail.query('code=="{}"'.format(code))
+ +
[docs] def get_loss_trade(self, num=5): + return self.detail[self.detail.pnl_precentage <= 0].sort_values(by=['pnl_precentage'], ascending=True).head(num)
+ +
[docs] def get_profit_trade(self, num=5): + return self.detail[self.detail.pnl_precentage >= 0].sort_values(by=['pnl_precentage'], ascending=False).head(num)
+ +
[docs] def get_trade_marketdata(self, rx, gap=3): + return QA_fetch_stock_day_adv(rx.code.values[0], QA_util_date_gap(rx.date.values[0], gap, methods='lt'), QA_util_date_gap(rx.sell_date.values[0][-1], gap, methods='gt'))
+ +
[docs] def get_trade_before_and_after_pnl(self, rx, N=3, M=10): + data = self.get_trade_marketdata(rx, M)
+ + +def _mean(list_): + if len(list_) > 0: + return mean(list_) + else: + return 'No Data' + + +if __name__ == '__main__': + ana = backtest_result_analyzer(cookie_id='0.0792467630583924') + print(ana.detail) + code = ana.codes + print(ana.get_stock_tradehistory(code[1])) + print(ana.get_stock_tradedetail(code[1])) + print(ana.get_loss_trade()) + print(ana.get_profit_trade()) +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QABacktest/backtest_setting.html b/_build/html/_modules/QUANTAXIS/QABacktest/backtest_setting.html new file mode 100644 index 000000000..cb2a5c44d --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QABacktest/backtest_setting.html @@ -0,0 +1,126 @@ + + + + + + + + QUANTAXIS.QABacktest.backtest_setting — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QABacktest.backtest_setting

+# coding=utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+import os
+import sys
+
+
+
[docs]class backtest_setting(): + def __init__(self, topic, version, backtest_name, sql_setting): + self.topic = topic + self.version = version + self.backtest_name = backtest_name + + self.sql_setting = sql_setting + + @property + def absoult_path(self): + return sys.path[0] + + @property + def dirs(self): + return '{}{}QUANTAXIS_RESULT{}{}{}{}{}'.format( + self.absoult_path, os.sep, os.sep, self.topic, os.sep, self.version, os.sep) + + @property + def database_uri(self): + return self.sql_setting.client.quantaxis
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QACmd.html b/_build/html/_modules/QUANTAXIS/QACmd.html new file mode 100644 index 000000000..02d57c89d --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QACmd.html @@ -0,0 +1,327 @@ + + + + + + + + QUANTAXIS.QACmd — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QACmd

+# encoding: UTF-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+import cmd
+import csv
+import os
+import shutil
+import string
+import sys
+import platform
+import subprocess
+import requests
+
+from QUANTAXIS.QABacktest.QAAnalysis import QA_backtest_analysis_backtest
+from QUANTAXIS.QAUtil import QA_util_log_info, QA_Setting, QA_util_mongo_initial
+from QUANTAXIS import (QA_SU_save_stock_list, QA_SU_save_stock_min, QA_SU_save_stock_xdxr,
+                       QA_SU_save_stock_block, QA_SU_save_stock_info,
+                       QA_SU_save_stock_day, QA_SU_save_index_day, QA_SU_save_index_min,
+                       QA_SU_save_etf_day, QA_SU_save_etf_min)
+
+from QUANTAXIS import __version__
+
+
+
[docs]class CLI(cmd.Cmd): + + def __init__(self): + cmd.Cmd.__init__(self) + self.prompt = 'QUANTAXIS> ' # 定义命令行提示符 + +
[docs] def do_shell(self, arg): + "run a shell commad" + print(">", arg) + sub_cmd = subprocess.Popen(arg, shell=True, stdout=subprocess.PIPE) + print(sub_cmd.communicate()[0])
+ +
[docs] def do_version(self, arg): + QA_util_log_info(__version__)
+ +
[docs] def help_version(self): + print("syntax: version [message]",) + print("-- prints a version message")
+ + #@click.command() + #@click.option('--e', default=1, help='Number of greetings.') +
[docs] def do_examples(self, arg): + QA_util_log_info('QUANTAXIS example') + now_path = os.getcwd() + #project_dir = os.path.dirname(os.path.abspath(__file__)) + + data=requests.get('https://codeload.github.com/yutiansut/QADemo/zip/master') + with open("{}{}QADEMO.zip".format(now_path,os.sep), "wb") as code: + code.write(data.content) + + QA_util_log_info( + 'Successfully generate QADEMO in : {}, for more examples, please visit https://github.com/yutiansut/qademo'.format(now_path))
+ +
[docs] def help_examples(self): + print('make a sample backtest framework')
+ +
[docs] def do_drop_database(self, arg): + QA_util_mongo_initial()
+ +
[docs] def help_drop_database(self): + print('drop quantaxis\'s databases')
+ +
[docs] def do_quit(self, arg): # 定义quit命令所执行的操作 + sys.exit(1)
+ +
[docs] def help_quit(self): # 定义quit命令的帮助输出 + print("syntax: quit",) + print("-- terminates the application")
+ +
[docs] def do_clean(self, arg): + try: + if platform.system() == 'Windows': + os.popen('del back*csv') + os.popen('del *log') + else: + os.popen('rm -rf back*csv') + os.popen('rm -rf *log') + + except: + pass
+ +
[docs] def help_clean(self): + QA_util_log_info('Clean the old backtest reports and logs')
+ +
[docs] def do_exit(self, arg): # 定义quit命令所执行的操作 + sys.exit(1)
+ +
[docs] def help_exit(self): + print('syntax: exit') + print("-- terminates the application")
+ +
[docs] def do_save(self, arg): + # 仅仅是为了初始化才在这里插入用户,如果想要注册用户,要到webkit底下注册 + if arg == '': + print( + "Usage: \n\ + save all : save stock_day/xdxr/ index_day/ stock_list \n\ + save X|x : save stock_day/xdxr/min index_day/min etf_day/min stock_list/block \n\ + save day : save stock_day/xdxr index_day etf_day stock_list \n\ + save min : save stock_min/xdxr index_min etf_min stock_list \n\ + ------------------------------------------------------------ \n\ + save stock_day : save stock_day \n\ + save stock_xdxr : save stock_xdxr \n\ + save stock_min : save stock_min \n\ + save index_day : save index_day \n\ + save index_min : save index_min \n\ + save etf_day : save etf_day \n\ + save etf_min : save etf_min \n\ + save stock_list : save stock_list \n\ + save stock_block: save stock_block \n\ + save stock_info : save stock_info \n\ + ----------------------------------------------------------\n\ + if you just want to save daily data just\n\ + save all+ save stock_block+save stock_info, it about 1G data \n\ + if you want to save save the fully data including min level \n\ + save x + save stock_info \n \n\ + @yutiansut\n\ + @QUANTAXIS\n\ + ") + else: + arg = arg.split(' ') + if len(arg) == 1 and arg[0] == 'all': + if QA_Setting().client.quantaxis.user_list.find({'username': 'admin'}).count() == 0: + QA_Setting().client.quantaxis.user_list.insert( + {'username': 'admin', 'password': 'admin'}) + QA_SU_save_stock_day('tdx') + QA_SU_save_stock_xdxr('tdx') + # QA_SU_save_stock_min('tdx') + QA_SU_save_index_day('tdx') + # QA_SU_save_index_min('tdx') + # QA_SU_save_etf_day('tdx') + # QA_SU_save_etf_min('tdx') + QA_SU_save_stock_list('tdx') + # QA_SU_save_stock_block('tdx') + # QA_SU_save_stock_info('tdx') + elif len(arg) == 1 and arg[0] == 'day': + if QA_Setting().client.quantaxis.user_list.find({'username': 'admin'}).count() == 0: + QA_Setting().client.quantaxis.user_list.insert( + {'username': 'admin', 'password': 'admin'}) + QA_SU_save_stock_day('tdx') + QA_SU_save_stock_xdxr('tdx') + # QA_SU_save_stock_min('tdx') + QA_SU_save_index_day('tdx') + # QA_SU_save_index_min('tdx') + QA_SU_save_etf_day('tdx') + # QA_SU_save_etf_min('tdx') + QA_SU_save_stock_list('tdx') + QA_SU_save_stock_block('tdx') + elif len(arg) == 1 and arg[0] == 'min': + if QA_Setting().client.quantaxis.user_list.find({'username': 'admin'}).count() == 0: + QA_Setting().client.quantaxis.user_list.insert( + {'username': 'admin', 'password': 'admin'}) + # QA_SU_save_stock_day('tdx') + QA_SU_save_stock_xdxr('tdx') + QA_SU_save_stock_min('tdx') + # QA_SU_save_index_day('tdx') + QA_SU_save_index_min('tdx') + # QA_SU_save_etf_day('tdx') + QA_SU_save_etf_min('tdx') + QA_SU_save_stock_list('tdx') + # QA_SU_save_stock_block('tdx') + elif len(arg) == 1 and arg[0] in ['X', 'x']: + if QA_Setting().client.quantaxis.user_list.find({'username': 'admin'}).count() == 0: + QA_Setting().client.quantaxis.user_list.insert( + {'username': 'admin', 'password': 'admin'}) + QA_SU_save_stock_day('tdx') + QA_SU_save_stock_xdxr('tdx') + QA_SU_save_stock_min('tdx') + QA_SU_save_index_day('tdx') + QA_SU_save_index_min('tdx') + QA_SU_save_etf_day('tdx') + QA_SU_save_etf_min('tdx') + QA_SU_save_stock_list('tdx') + QA_SU_save_stock_block('tdx') + # QA_SU_save_stock_info('tdx') + else: + for i in arg: + if i == 'insert_user': + if QA_Setting().client.quantaxis.user_list.find({'username': 'admin'}).count() == 0: + QA_Setting().client.quantaxis.user_list.insert( + {'username': 'admin', 'password': 'admin'}) + else: + eval("QA_SU_save_%s('tdx')" % (i))
+ +
[docs] def help_save(self): + QA_util_log_info('Save all the stock data from pytdx')
+ +
[docs] def do_fn(self, arg): + try: + QA_util_log_info(eval(arg)) + except: + print(Exception)
+ +
[docs] def do_help(self, arg): + QA_util_log_info('MORE EXAMPLE on https://github.com/yutiansut/QADemo')
+ +
[docs] def help(self): + QA_util_log_info('fn+methods name')
+ + +
[docs]def sourcecpy(src, des): + src = os.path.normpath(src) + des = os.path.normpath(des) + if not os.path.exists(src) or not os.path.exists(src): + print("folder is not exist") + sys.exit(1) + # 获得原始目录中所有的文件,并拼接每个文件的绝对路径 + os.chdir(src) + src_file = [os.path.join(src, file) for file in os.listdir()] + for source in src_file: + # 若是文件 + if os.path.isfile(source): + shutil.copy(source, des) # 第一个参数是文件,第二个参数目录 + # 若是目录 + if os.path.isdir(source): + p, src_name = os.path.split(source) + des = os.path.join(des, src_name) + shutil.copytree(source, des) # 第一个参数是目录,第二个参数也是目录
+ +# 创建CLI实例并运行 + + +
[docs]def QA_cmd(): + cli = CLI() + cli.cmdloop()
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAData/QADataStruct.html b/_build/html/_modules/QUANTAXIS/QAData/QADataStruct.html new file mode 100644 index 000000000..2b2fad4f6 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAData/QADataStruct.html @@ -0,0 +1,941 @@ + + + + + + + + QUANTAXIS.QAData.QADataStruct — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAData.QADataStruct

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+"""
+定义一些可以扩展的数据结构
+
+方便序列化/相互转换
+
+"""
+
+import datetime
+import itertools
+import os
+import platform
+import statistics
+import sys
+import time
+import webbrowser
+from copy import copy
+from functools import lru_cache, partial, reduce
+
+import numpy as np
+import pandas as pd
+from pyecharts import Kline
+
+from QUANTAXIS.QAData.base_datastruct import _quotation_base
+from QUANTAXIS.QAData.data_fq import QA_data_stock_to_fq
+from QUANTAXIS.QAData.data_resample import QA_data_tick_resample
+from QUANTAXIS.QAData.proto import stock_day_pb2  # protobuf import
+from QUANTAXIS.QAData.proto import stock_min_pb2
+from QUANTAXIS.QAFetch.QATdx import QA_fetch_get_stock_realtime
+from QUANTAXIS.QAIndicator import EMA, HHV, LLV, SMA
+from QUANTAXIS.QAUtil import (DATABASE, QA_util_log_info,
+                              QA_util_random_with_topic,
+                              QA_util_to_json_from_pandas,
+                              QA_util_to_pandas_from_json, trade_date_sse)
+from QUANTAXIS.QAUtil.QADate import QA_util_to_datetime
+from QUANTAXIS.QAUtil.QAParameter import FREQUENCE, MARKET_TYPE
+
+
+
[docs]class QA_DataStruct_Stock_day(_quotation_base): + """ + this is a datastruct for stock_day + """ + + def __init__(self, DataFrame, dtype='stock_day', if_fq='bfq'): + super().__init__(DataFrame, dtype, if_fq) + if 'high_limit' not in self.data.columns: + self.data['high_limit'] = round( + (self.data.close.shift(1) + 0.0002) * 1.1, 2) + if 'low_limit' not in self.data.columns: + self.data['low_limit'] = round( + (self.data.close.shift(1) + 0.0002) * 0.9, 2) + if 'next_day_high_limit' not in self.data.columns: + self.data['next_day_high_limit'] = round( + (self.data.close + 0.0002) * 1.1, 2) + if 'next_day_low_limit' not in self.data.columns: + self.data['next_day_low_limit'] = round( + (self.data.close + 0.0002) * 0.9, 2) + + def __repr__(self): + return '< QA_DataStruct_Stock_day with {} securities >'.format(len(self.code)) + __str__ = __repr__ + +
[docs] def to_qfq(self): + if self.if_fq is 'bfq': + if len(self.code) < 1: + self.if_fq = 'qfq' + return self + elif len(self.code) < 20: + return self.new(pd.concat(list(map( + lambda x: QA_data_stock_to_fq(self.data[self.data['code'] == x]), self.code))), self.type, 'qfq') + else: + return self.new( + self.data.groupby('code').apply(QA_data_stock_to_fq), self.type, 'qfq') + else: + QA_util_log_info( + 'none support type for qfq Current type is: %s' % self.if_fq) + return self
+ +
[docs] def to_hfq(self): + if self.if_fq is 'bfq': + if len(self.code) < 1: + self.if_fq = 'hfq' + return self + else: + return self.new(pd.concat(list(map(lambda x: QA_data_stock_to_fq( + self.data[self.data['code'] == x], 'hfq'), self.code))), self.type, 'hfq') + else: + QA_util_log_info( + 'none support type for qfq Current type is: %s' % self.if_fq) + return self
+ + @property + def high_limit(self): + '涨停价' + return self.data.high_limit + + @property + def low_limit(self): + '跌停价' + return self.data.low_limit + + @property + def next_day_low_limit(self): + "明日跌停价" + return self.data.next_day_low_limit + + @property + def next_day_high_limit(self): + "明日涨停价" + return self.data.next_day_high_limit + + @property + def preclose(self): + try: + return self.data.preclose + except: + return None + + @property + def price_chg(self): + try: + return (self.close-self.preclose)/self.preclose + except: + return None
+ + +
[docs]class QA_DataStruct_Stock_min(_quotation_base): + def __init__(self, DataFrame, dtype='stock_min', if_fq='bfq'): + super().__init__(DataFrame, dtype, if_fq) + try: + self.data = DataFrame.ix[:, [ + 'code', 'open', 'high', 'low', 'close', 'volume', 'preclose', 'datetime', 'date']] + except: + self.data = DataFrame.ix[:, [ + 'code', 'open', 'high', 'low', 'close', 'volume', 'datetime', 'date']] + if 'high_limit' not in self.data.columns: + self.data['high_limit'] = round( + (self.data.close.shift(1) + 0.0002) * 1.1, 2) + if 'low_limit' not in self.data.columns: + self.data['low_limit'] = round( + (self.data.close.shift(1) + 0.0002) * 0.9, 2) + self.type = dtype + self.if_fq = if_fq + self.mongo_coll = DATABASE.stock_min + + def __repr__(self): + return '< QA_DataStruct_Stock_Min with {} securities >'.format(len(self.code)) + __str__ = __repr__ + +
[docs] def to_qfq(self): + if self.if_fq is 'bfq': + if len(self.code) < 1: + self.if_fq = 'qfq' + return self + elif len(self.code) < 20: + data = QA_DataStruct_Stock_min(pd.concat(list(map(lambda x: QA_data_stock_to_fq( + self.data[self.data['code'] == x]), self.code))).set_index(['datetime', 'code'], drop=False)) + data.if_fq = 'qfq' + return data + else: + data = QA_DataStruct_Stock_min( + self.data.groupby('code').apply(QA_data_stock_to_fq)) + return data + else: + QA_util_log_info( + 'none support type for qfq Current type is:%s' % self.if_fq) + return self
+ +
[docs] def to_hfq(self): + if self.if_fq is 'bfq': + if len(self.code) < 1: + self.if_fq = 'hfq' + return self + else: + data = QA_DataStruct_Stock_min(pd.concat(list(map(lambda x: QA_data_stock_to_fq( + self.data[self.data['code'] == x], 'hfq'), self.code))).set_index(['datetime', 'code'], drop=False)) + data.if_fq = 'hfq' + return data + else: + QA_util_log_info( + 'none support type for qfq Current type is:%s' % self.if_fq) + return self
+ + @property + def high_limit(self): + '涨停价' + return self.data.high_limit + + @property + def low_limit(self): + '跌停价' + return self.data.low_limit
+ + +
[docs]class QA_DataStruct_Future_day(_quotation_base): + def __init__(self, DataFrame, dtype='future_day', if_fq=''): + self.type = 'future_day' + self.data = DataFrame.ix[:, [ + 'code', 'open', 'high', 'low', 'close', 'trade', 'position', 'datetime', 'date']] + self.mongo_coll = DATABASE.future_day + + def __repr__(self): + return '< QA_DataStruct_Future_day with {} securities >'.format(len(self.code)) + __str__ = __repr__
+ + +
[docs]class QA_DataStruct_Future_min(_quotation_base): + """ + struct for future + """ + + def __init__(self, DataFrame, dtype='future_min', if_fq=''): + self.type = 'future_day' + self.data = DataFrame.ix[:, [ + 'code', 'open', 'high', 'low', 'close', 'trade', 'position', 'datetime', 'date']] + self.mongo_coll = DATABASE.future_min + + def __repr__(self): + return '< QA_DataStruct_Future_min with {} securities >'.format(len(self.code)) + __str__ = __repr__
+ + +
[docs]class QA_DataStruct_Index_day(_quotation_base): + '自定义的日线数据结构' + + def __init__(self, DataFrame, dtype='index_day', if_fq=''): + self.data = DataFrame + self.type = dtype + self.if_fq = if_fq + self.mongo_coll = eval( + 'DATABASE.{}'.format(self.type)) + """ + def __add__(self,DataStruct): + 'add func with merge list and reindex' + assert isinstance(DataStruct,QA_DataStruct_Index_day) + if self.if_fq==DataStruct.if_fq: + self.sync_status(pd.concat()) + """ + + def __repr__(self): + return '< QA_DataStruct_Index_day with {} securities >'.format(len(self.code)) + __str__ = __repr__
+ + +
[docs]class QA_DataStruct_Index_min(_quotation_base): + '自定义的分钟线数据结构' + + def __init__(self, DataFrame, dtype='index_min', if_fq=''): + self.type = dtype + self.if_fq = if_fq + self.data = DataFrame.ix[:, [ + 'code', 'open', 'high', 'low', 'close', 'volume', 'datetime', 'date']] + self.mongo_coll = DATABASE.index_min + + def __repr__(self): + return '< QA_DataStruct_Index_Min with %s securities >' % len(self.code) + + __str__ = __repr__
+ + +
[docs]class QA_DataStruct_Stock_block(): + def __init__(self, DataFrame): + self.data = DataFrame + + def __repr__(self): + return '< QA_DataStruct_Stock_Block >' + + def __call__(self): + return self.data + + @property + def len(self): + """返回DataStruct的长度 + + Returns: + [type] -- [description] + """ + + return len(self.data) + + @property + def block_name(self): + """返回所有的板块名 + + Returns: + [type] -- [description] + """ + + return self.data.groupby('blockname').sum().index.unique().tolist() + + @property + def code(self): + """返回唯一的证券代码 + + Returns: + [type] -- [description] + """ + + return self.data.code.unique().tolist() + +
[docs] def show(self): + """展示DataStruct + + Returns: + dataframe -- [description] + """ + + return self.data
+ +
[docs] def get_code(self, code): + """getcode 获取某一只股票的板块 + + Arguments: + code {str} -- 股票代码 + + Returns: + DataStruct -- [description] + """ + + return QA_DataStruct_Stock_block(self.data[self.data['code'] == code])
+ +
[docs] def get_block(self, _block_name): + """getblock 获取板块 + + Arguments: + _block_name {[type]} -- [description] + + Returns: + [type] -- [description] + """ + + return QA_DataStruct_Stock_block(self.data[self.data['blockname'] == _block_name])
+ +
[docs] def getdtype(self, dtype): + """getdtype + + Arguments: + dtype {str} -- gn-概念/dy-地域/fg-风格/zs-指数 + + Returns: + [type] -- [description] + """ + + return QA_DataStruct_Stock_block(self.data[self.data['type'] == dtype])
+ +
[docs] def get_price(self, _block_name=None): + """get_price + + Keyword Arguments: + _block_name {[type]} -- [description] (default: {None}) + + Returns: + [type] -- [description] + """ + + if _block_name is not None: + try: + code = self.data[self.data['blockname'] + == _block_name].code.unique().tolist() + # try to get a datastruct package of lastest price + return QA_fetch_get_stock_realtime(code) + + except: + return "Wrong Block Name! Please Check" + else: + code = self.data.code.unique().tolist() + return QA_fetch_get_stock_realtime(code)
+ + +
[docs]class QA_DataStruct_Stock_transaction(): + def __init__(self, DataFrame): + """Stock Transaction + + Arguments: + DataFrame {pd.Dataframe} -- [input is one/multi day transaction] + """ + + self.type = 'stock_transaction' + + self.data = DataFrame + if 'amount' not in DataFrame.columns: + if 'vol' in DataFrame.columns: + self.data['amount'] = self.data.vol * self.data.price * 100 + elif 'volume' in DataFrame.columns: + self.data['amount'] = self.data.volume * self.data.price * 100 + self.mongo_coll = DATABASE.stock_transaction + + @property + @lru_cache() + def buyorsell(self): + """return the buy or sell towards 0--buy 1--sell 2--none + + Decorators: + lru_cache + + Returns: + [pd.Series] -- [description] + """ + + return self.data.buyorsell + + @property + @lru_cache() + def price(self): + """return the deal price of tick transaction + + Decorators: + lru_cache + + Returns: + [type] -- [description] + """ + + return self.data.price + + @property + @lru_cache() + def vol(self): + """return the deal volume of tick + + Decorators: + lru_cache + + Returns: + pd.Series -- volume of transaction + """ + + try: + return self.data.volume + except: + return self.data.vol + + volume = vol + + @property + @lru_cache() + def date(self): + """return the date of transaction + + Decorators: + lru_cache + + Returns: + pd.Series -- date of transaction + """ + + return self.data.date + + @property + @lru_cache() + def time(self): + """return the exact time of transaction(to minute level) + + Decorators: + lru_cache + + Returns: + pd.Series -- till minute level + """ + + return self.data.time + + @property + @lru_cache() + def datetime(self): + """return the datetime of transaction + + Decorators: + lru_cache + + Returns: + pd.Series -- [description] + """ + + return self.data.datetime + + @property + @lru_cache() + def order(self): + """return the order num of transaction/ for everyday change + + Decorators: + lru_cache + + Returns: + pd.series -- [description] + """ + + return self.data.order + + @property + @lru_cache() + def index(self): + """return the transaction index + + Decorators: + lru_cache + + Returns: + [type] -- [description] + """ + + return self.data.index + + @property + @lru_cache() + def amount(self): + """return current tick trading amount + + Decorators: + lru_cache + + Returns: + [type] -- [description] + """ + + return self.data.amount + """ + 最新:IF(ISNULL(NEW),PRE,NEW); + IF (ISNULL(RANGE_AVG_PRICE) OR RANGE_AVG_PRICE <= 0) + { + IF (MARKETTYPE == 232 OR MARKETTYPE == 56 OR MARKETTYPE==64 OR MARKETTYPE==128 OR MARKETTYPE==168 OR MARKETTYPE==184 OR MARKETTYPE == 200 OR MARKETTYPE == 80 OR (VOL > 1 AND VOL<100)) + { + b=SUBSAMEDAY(&VOL) ; + m=SUM(b*最新,0); + 均价:IF(m>0,m/VOL,PRE); + } + ELSE IF(CODETYPE!=0 AND MONEY>0) + { + IF(ISNULL(MONEY) OR ISNULL(VOL) OR VOL==0 OR MONEY==0) + 均价:PRE; + ELSE IF(VOL==VOL[1] OR MONEY==MONEY[1]) + 均价:均价[1]; + ELSE + 均价:MONEY/VOL; + } + ELSE IF (MARKETTYPE == 176) + { + b=SUBSAMEDAY(&MONEY); + m=SUM(b*最新,0); + IF(m>0) + 均价:m/MONEY; + } + } + ELSE + { + 均价:RANGE_AVG_PRICE; + } + DRAWGBK(MARKETTYPE==32 AND FORMATTIME(1)<10 AND TRADETIME>242),RGB(0,0,128); + RETURN; + + + hx_star; + hx_star_p; + """ + + def __repr__(self): + return '< QA_DataStruct_Stock_Transaction >' + + def __call__(self): + return self.data + +
[docs] def resample(self, type_='1min'): + """resample methods + + Returns: + [type] -- [description] + """ + + return QA_DataStruct_Stock_min(QA_data_tick_resample(self.data, type_))
+ +
[docs] def get_big_orders(self, bigamount=1000000): + """return big order + + Keyword Arguments: + bigamount {[type]} -- [description] (default: {1000000}) + + Returns: + [type] -- [description] + """ + + return self.data.query('amount>={}'.format(bigamount))
+ +
[docs] def get_medium_order(self, lower=200000, higher=1000000): + """return medium + + Keyword Arguments: + lower {[type]} -- [description] (default: {200000}) + higher {[type]} -- [description] (default: {1000000}) + + Returns: + [type] -- [description] + """ + + return self.data.query('amount>={}'.format(lower)).query('amount<={}'.format(higher))
+ +
[docs] def get_small_order(self, smallamount=200000): + """return small level order + + Keyword Arguments: + smallamount {[type]} -- [description] (default: {200000}) + + Returns: + [type] -- [description] + """ + + return self.data.query('amount<={}'.format(smallamount))
+ +
[docs] def get_time(self, start, end=None): + if end is None: + return self.data.loc[start] + else: + return self.data.loc[start:end]
+ + +class _realtime_base(): + """ + realtime 基类 + + 主要字段有: + code/name + time + open/high/low + + 买卖报价队列:(不同的可能不一样 只提供list) + ask_list[ask1_price/ask1_volume|ask2_price/ask2_volume|ask3_price/ask3_volume....] + bid_list[bid1_price/bid1_volume|bid2_price/bid2_volume|bid3_price/bid3_volume....] + """ + + def __init__(self, market_data): + """转化成dict模式 + + Arguments: + market_data {[type]} -- [description] + """ + + if isinstance(market_data, dict): + self.market_data = market_data + elif isinstance(market_data, pd.DataFrame): + self.market_data = QA_util_to_json_from_pandas(market_data) + + @property + def open(self): + return self.market_data.get('open', None) + + @property + def price(self): + return self.market_data.get('price', None) + + @property + def datetime(self): + return self.market_data.get('datetime', None) + + @property + def high(self): + return self.market_data.get('high', None) + + @property + def low(self): + return self.market_data.get('low', None) + + @property + def code(self): + return self.market_data.get('code', None) + + @property + def last_close(self): + return self.market_data.get('last_close', None) + + @property + def cur_vol(self): + return self.market_data.get('cur_vol', None) + + @property + def bid1(self): + return self.market_data.get('bid1', None) + + @property + def bid_vol1(self): + return self.market_data.get('bid_vol1', None) + + @property + def bid2(self): + return self.market_data.get('bid2', None) + + @property + def bid_vol2(self): + return self.market_data.get('bid_vol2', None) + + @property + def bid3(self): + return self.market_data.get('bid3', None) + + @property + def bid_vol3(self): + return self.market_data.get('bid_vol3', None) + + @property + def bid4(self): + return self.market_data.get('bid4', None) + + @property + def bid_vol4(self): + return self.market_data.get('bid_vol4', None) + + @property + def bid5(self): + return self.market_data.get('bid5', None) + + @property + def bid_vol5(self): + return self.market_data.get('bid_vol5', None) + + @property + def ask1(self): + return self.market_data.get('ask1', None) + + @property + def ask_vol1(self): + return self.market_data.get('ask_vol1', None) + + @property + def ask2(self): + return self.market_data.get('ask2', None) + + @property + def ask_vol2(self): + return self.market_data.get('ask_vol2', None) + + @property + def ask3(self): + return self.market_data.get('ask3', None) + + @property + def ask_vol3(self): + return self.market_data.get('ask_vol3', None) + + @property + def ask4(self): + return self.market_data.get('ask4', None) + + @property + def ask_vol4(self): + return self.market_data.get('ask_vol4', None) + + @property + def ask5(self): + return self.market_data.get('ask5', None) + + @property + def ask_vol5(self): + return self.market_data.get('ask_vol5', None) + + +
[docs]class QA_DataStruct_Stock_realtime(_realtime_base): + def __init__(self, market_data): + if isinstance(market_data, dict): + self.market_data = market_data + elif isinstance(market_data, pd.DataFrame): + self.market_data = QA_util_to_json_from_pandas(market_data) + + def __repr__(self): + return '< QA_REALTIME_STRUCT {}{} >'.format(self.code, self.datetime) + + # @property + # def ask_list(self): + # return self.market_data.ix[:, ['ask1', 'ask_vol1', 'bid1', 'bid_vol1', 'ask2', 'ask_vol2', + # 'bid2', 'bid_vol2', 'ask3', 'ask_vol3', 'bid3', 'bid_vol3', 'ask4', + # 'ask_vol4', 'bid4', 'bid_vol4', 'ask5', 'ask_vol5', 'bid5', 'bid_vol5']] + + # @property + # def bid_list(self): + # return self.market_data.ix[:, ['bid1', 'bid_vol1', 'bid2', 'bid_vol2', 'bid3', 'bid_vol3', 'bid4', 'bid_vol4', 'bid5', 'bid_vol5']] + + @property + def _data(self): + """ + return a dataframe-type result + """ + return pd.DataFrame(self.market_data) + + @property + def ab_board(self): + """ask_bid board + bid3 bid_vol3 + bid2 bid_vol2 + bid1 bid_vol1 + =============== + price /cur_vol + =============== + ask1 ask_vol1 + ask2 ask_vol2 + ask3 ask_vol3 + """ + return 'BID5 {} {} \nBID4 {} {} \nBID3 {} {} \nBID2 {} {} \nBID1 {} {} \n============\nCURRENT {} {} \n============\ + \nASK1 {} {} \nASK2 {} {} \nASK3 {} {} \nASK4 {} {} \nASK5 {} {} \nTIME {} CODE {} '.format( + self.bid5, self.bid_vol5, self.bid4, self.bid_vol4, self.bid3, self.bid_vol3, self.bid2, self.bid_vol2, self.bid1, self.bid_vol1, + self.price, self.cur_vol, + self.ask1, self.ask_vol1, self.ask2, self.ask_vol2, self.ask3, self.ask_vol3, self.ask4, self.ask_vol4, self.ask5, self.ask_vol5, + self.datetime, self.code + ) + +
[docs] def serialize(self): + """to_protobuf + """ + pass
+ + +
[docs]class QA_DataStruct_Stock_realtime_series(): + def __init__(self, sr_series): + + if isinstance(sr_series[0], QA_DataStruct_Stock_realtime): + self.sr_series = sr_series + elif isinstance(sr_series[0], dict): + self.sr_series = [ + QA_DataStruct_Stock_realtime(sr) for sr in sr_series] + self.table = pd.concat([sr._data for sr in self.sr_series])
+ + +
[docs]class QA_DataStruct_Security_list(): + def __init__(self, DataFrame): + self.data = DataFrame.loc[:, ['sse', 'code', 'name']].set_index( + 'code', drop=False) + + @property + def code(self): + return self.data.code + + @property + def name(self): + return self.data.name + +
[docs] def get_stock(self, ST_option): + return self.data
+ +
[docs] def get_index(self): + return self.data
+ +
[docs] def get_etf(self): + return self.data
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAData/data_fq.html b/_build/html/_modules/QUANTAXIS/QAData/data_fq.html new file mode 100644 index 000000000..afa0a678a --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAData/data_fq.html @@ -0,0 +1,209 @@ + + + + + + + + QUANTAXIS.QAData.data_fq — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAData.data_fq

+
+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+
+import datetime
+
+import pandas as pd
+
+from QUANTAXIS.QAFetch import QA_fetch_get_stock_day, QA_fetch_get_stock_xdxr
+from QUANTAXIS.QAUtil import QA_util_log_info, DATABASE
+
+
+
[docs]def QA_data_get_qfq(code, start, end): + '使用网络数据进行复权/需要联网' + xdxr_data = QA_fetch_get_stock_xdxr('tdx', code) + bfq_data = QA_fetch_get_stock_day( + 'tdx', code, '1990-01-01', str(datetime.date.today())).dropna(axis=0) + return QA_data_make_qfq(bfq_data[start:end], xdxr_data)
+ + +
[docs]def QA_data_get_hfq(code, start, end): + '使用网络数据进行复权/需要联网' + xdxr_data = QA_fetch_get_stock_xdxr('tdx', code) + bfq_data = QA_fetch_get_stock_day( + 'tdx', code, '1990-01-01', str(datetime.date.today())).dropna(axis=0) + return QA_data_make_hfq(bfq_data[start:end], xdxr_data)
+ + +
[docs]def QA_data_make_qfq(bfq_data, xdxr_data): + '使用数据库数据进行复权' + info = xdxr_data[xdxr_data['category'] == 1] + bfq_data = bfq_data.assign(if_trade=1) + data = pd.concat([bfq_data, info[['category']] + [bfq_data.index[0]:bfq_data.index[-1]]], axis=1) + data['if_trade'].fillna(value=0, inplace=True) + data = data.fillna(method='ffill') + data = pd.concat([data, info[['fenhong', 'peigu', 'peigujia', + 'songzhuangu']][bfq_data.index[0]:bfq_data.index[-1]]], axis=1) + data = data.fillna(0) + data['preclose'] = (data['close'].shift(1) * 10 - data['fenhong'] + data['peigu'] + * data['peigujia']) / (10 + data['peigu'] + data['songzhuangu']) + data['adj'] = (data['preclose'].shift(-1) / + data['close']).fillna(1)[::-1].cumprod() + data['open'] = data['open'] * data['adj'] + data['high'] = data['high'] * data['adj'] + data['low'] = data['low'] * data['adj'] + data['close'] = data['close'] * data['adj'] + data['preclose'] = data['preclose'] * data['adj'] + try: + data['high_limit'] = data['high_limit'] * data['adj'] + data['low_limit'] = data['high_limit'] * data['adj'] + except: + pass + return data.query('if_trade==1').drop(['fenhong', 'peigu', 'peigujia', 'songzhuangu', + 'if_trade', 'category'], axis=1).query("open != 0")
+ + +
[docs]def QA_data_make_hfq(bfq_data, xdxr_data): + '使用数据库数据进行复权' + info = xdxr_data[xdxr_data['category'] == 1] + bfq_data = bfq_data.assign(if_trade=1) + data = pd.concat([bfq_data, info[['category']] + [bfq_data.index[0]:bfq_data.index[-1]]], axis=1) + + data['if_trade'].fillna(value=0, inplace=True) + data = data.fillna(method='ffill') + + data = pd.concat([data, info[['fenhong', 'peigu', 'peigujia', + 'songzhuangu']][bfq_data.index[0]:bfq_data.index[-1]]], axis=1) + + data = data.fillna(0) + data['preclose'] = (data['close'].shift(1) * 10 - data['fenhong'] + data['peigu'] + * data['peigujia']) / (10 + data['peigu'] + data['songzhuangu']) + data['adj'] = (data['close'] / data['preclose'].shift(-1) + ).cumprod().shift(1).fillna(1) + data['open'] = data['open'] * data['adj'] + data['high'] = data['high'] * data['adj'] + data['low'] = data['low'] * data['adj'] + data['close'] = data['close'] * data['adj'] + data['preclose'] = data['preclose'] * data['adj'] + try: + data['high_limit'] = data['high_limit'] * data['adj'] + data['low_limit'] = data['high_limit'] * data['adj'] + except: + pass + return data.query('if_trade==1').drop(['fenhong', 'peigu', 'peigujia', 'songzhuangu'], axis=1).query("open != 0")
+ + +
[docs]def QA_data_stock_to_fq(__data, type_='01'): + + def __QA_fetch_stock_xdxr(code, format_='pd', collections=DATABASE.stock_xdxr): + '获取股票除权信息/数据库' + try: + data = pd.DataFrame([item for item in collections.find( + {'code': code})]).drop(['_id'], axis=1) + data['date'] = pd.to_datetime(data['date']) + return data.set_index(['date', 'code'], drop=False) + except: + return pd.DataFrame(data=[],columns=['category', 'category_meaning', 'code', 'date', 'fenhong', + 'fenshu', 'liquidity_after', 'liquidity_before', 'name', 'peigu', 'peigujia', + 'shares_after', 'shares_before', 'songzhuangu', 'suogu', 'xingquanjia']) + '股票 日线/分钟线 动态复权接口' + if type_ in ['01', 'qfq']: + return QA_data_make_qfq(__data, __QA_fetch_stock_xdxr(__data['code'][0])) + elif type_ in ['02', 'hfq']: + return QA_data_make_hfq(__data, __QA_fetch_stock_xdxr(__data['code'][0])) + else: + QA_util_log_info('wrong fq type! Using qfq') + return QA_data_make_qfq(__data, __QA_fetch_stock_xdxr(__data['code'][0]))
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAData/data_resample.html b/_build/html/_modules/QUANTAXIS/QAData/data_resample.html new file mode 100644 index 000000000..b9c105c0c --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAData/data_resample.html @@ -0,0 +1,144 @@ + + + + + + + + QUANTAXIS.QAData.data_resample — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAData.data_resample

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+from datetime import time
+
+import pandas as pd
+
+from QUANTAXIS.QAFetch import QA_fetch_get_stock_transaction
+
+
+
[docs]def QA_data_tick_resample(tick, type_='1min'): + """tick采样成任意级别分钟线 + + Arguments: + tick {[type]} -- transaction + + Returns: + [type] -- [description] + """ + + data = tick['price'].resample( + type_, label='right', closed='left').ohlc() + + data['volume'] = tick['vol'].resample( + type_, label='right', closed='left').sum() + data['code'] = tick['code'][0] + + #data = pd.DataFrame() + _temp = tick.drop_duplicates('date')['date'] + for item in _temp: + _data = data[item] + _data = _data[time(9, 31):time(11, 30)].append( + _data[time(13, 1):time(15, 0)]) + data = data.append(_data) + + data['datetime'] = data.index + data['date'] = data['datetime'].apply(lambda x: str(x)[0:10]) + + return data.fillna(method='ffill').set_index(['datetime', 'code'], drop=False)
+ + +if __name__ == '__main__': + tickz = QA_fetch_get_stock_transaction( + 'tdx', '000001', '2017-01-03', '2017-01-05') + print(QA_data_tick_resample(tickz)) +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAData/dsmethods.html b/_build/html/_modules/QUANTAXIS/QAData/dsmethods.html new file mode 100644 index 000000000..b19217356 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAData/dsmethods.html @@ -0,0 +1,140 @@ + + + + + + + + QUANTAXIS.QAData.dsmethods — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAData.dsmethods

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+
+"""DataStruct的方法
+"""
+import pandas as pd
+from QUANTAXIS.QAData.QADataStruct import QA_DataStruct_Stock_day, QA_DataStruct_Stock_min
+
+
+
[docs]def concat(lists): + """类似于pd.concat 用于合并一个list里面的多个DataStruct,会自动去重 + + + + Arguments: + lists {[type]} -- [DataStruct1,DataStruct2,....,DataStructN] + + Returns: + [type] -- new DataStruct + """ + + return lists[0].new(pd.concat([lists.data for lists in lists]).drop_duplicates())
+ + +
[docs]def from_tushare(dataframe, dtype='day'): + """dataframe from tushare + + Arguments: + dataframe {[type]} -- [description] + + Returns: + [type] -- [description] + """ + + if dtype in ['day']: + return QA_DataStruct_Stock_day(dataframe.set_index(['date', 'code'], drop=False), dtype='stock_day') + elif dtype in ['min']: + return QA_DataStruct_Stock_min(dataframe.set_index(['datetime', 'code'], drop=False), dtype='stock_min')
+ + +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAData/schema.html b/_build/html/_modules/QUANTAXIS/QAData/schema.html new file mode 100644 index 000000000..071d2590f --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAData/schema.html @@ -0,0 +1,179 @@ + + + + + + + + QUANTAXIS.QAData.schema — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAData.schema

+import sqlalchemy as sa
+from sqlalchemy import Column, Integer, String, Float, Date
+from sqlalchemy.ext.declarative import declarative_base
+
+Base = declarative_base()
+
+
+
[docs]class full(Base): + __tablename__ = 'full' + + code = Column(String, primary_key=True) + report_date = Column(Date) + trade_date = Column(Date, primary_key=True) + quarter = Column(Integer) + name = Column(String) + eps = Column(Float) + eps_yoy = Column(Float) + bvps = Column(Float) + roe = Column(Float) + epcf = Column(Float) + net_profits = Column(Float) + profits_yoy = Column(Float) + distrib = Column(Float) + net_profit_ratio = Column(Float) + gross_profit_rate = Column(Float) + business_income = Column(Float) + bips = Column(Float) + arturnover = Column(Float) + arturndays = Column(Float) + inventory_turnover = Column(Float) + inventory_days = Column(Float) + currentasset_turnover = Column(Float) + currentasset_days = Column(Float) + mbrg = Column(Float) + nprg = Column(Float) + nav = Column(Float) + targ = Column(Float) + epsg = Column(Float) + seg = Column(Float) + currentratio = Column(Float) + quickratio = Column(Float) + cashratio = Column(Float) + icratio = Column(Float) + sheqratio = Column(Float) + adratio = Column(Float) + cf_sales = Column(Float) + rateofreturn = Column(Float) + cf_nm = Column(Float) + cf_liabilities = Column(Float) + cashflowratio = Column(Float)
+ + +
[docs]class Shares(Base): + __tablename__ = 'shares' + sid = Column(Integer, primary_key=True) + effective_date = Column(Integer, primary_key=True) + shares = Column(Float) + circulation = Column(Float)
+ +
[docs]class fundamental(Base): + __tablename__ = 'fundamental' + + code = Column(String, primary_key=True) + report_date = Column(Date, primary_key=True) + quarter = Column(Integer, primary_key=True) + name = Column(String) + eps = Column(Float) + eps_yoy = Column(Float) + bvps = Column(Float) + roe = Column(Float) + epcf = Column(Float) + net_profits = Column(Float) + profits_yoy = Column(Float) + distrib = Column(Float) + net_profit_ratio = Column(Float) + gross_profit_rate = Column(Float) + business_income = Column(Float) + bips = Column(Float) + arturnover = Column(Float) + arturndays = Column(Float) + inventory_turnover = Column(Float) + inventory_days = Column(Float) + currentasset_turnover = Column(Float) + currentasset_days = Column(Float) + mbrg = Column(Float) + nprg = Column(Float) + nav = Column(Float) + targ = Column(Float) + epsg = Column(Float) + seg = Column(Float) + currentratio = Column(Float) + quickratio = Column(Float) + cashratio = Column(Float) + icratio = Column(Float) + sheqratio = Column(Float) + adratio = Column(Float) + cf_sales = Column(Float) + rateofreturn = Column(Float) + cf_nm = Column(Float) + cf_liabilities = Column(Float) + cashflowratio = Column(Float)
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAEngine/QAEvent.html b/_build/html/_modules/QUANTAXIS/QAEngine/QAEvent.html new file mode 100644 index 000000000..291bfa518 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAEngine/QAEvent.html @@ -0,0 +1,132 @@ + + + + + + + + QUANTAXIS.QAEngine.QAEvent — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAEngine.QAEvent

+# encoding: UTF-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+
+from abc import abstractmethod
+"""QUANTAXIS EVENT
+EVENT 是会被推送进QUEUE的任务class
+通过EVENT_QUEUE.get()拿到标准的event,然后执行"""
+
+
+
[docs]class QA_Worker(object): + """JOB是worker 需要接受QA_EVENT 需要完善RUN方法""" + + def __init__(self): + self.type = None + + def __repr__(self): + return '< QA_Worker {} >'.format(self.type) + +
[docs] @abstractmethod + def run(self, event): + raise NotImplementedError
+ + +
[docs]class QA_Event(object): + def __init__(self, event_type=None, func=None, message=None, callback=False, *args, **kwargs): + self.event_type = event_type + self.func = func + self.message = message + self.callback = callback + + for item in kwargs.keys(): + exec('self.{}=kwargs[item]'.format(item))
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAEngine/QATask.html b/_build/html/_modules/QUANTAXIS/QAEngine/QATask.html new file mode 100644 index 000000000..c736aebfe --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAEngine/QATask.html @@ -0,0 +1,138 @@ + + + + + + + + QUANTAXIS.QAEngine.QATask — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAEngine.QATask

+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+
+from QUANTAXIS.QAUtil.QARandom import QA_util_random_with_topic
+
+
+"""标准的QUANTAXIS事件方法,具有QA_Thread,QA_Event等特性,以及一些日志和外部接口"""
+
+
+
[docs]class QA_Task(): + def __init__(self, worker, event, engine=None, callback=False): + self.worker = worker + self.event = event + self.res = None + self.callback = callback + self.task_id = QA_util_random_with_topic('Task') + self.engine = engine + +
[docs] def do(self): + self.res = self.worker.run(self.event) + if self.callback: + self.callback(self.res)
+ + @property + def result(self): + # return { + # 'task_id': self.task_id, + # 'result': self.res, + # 'worker': self.worker, + # 'event': self.event + # } + return { + 'task_id': self.task_id, + 'result': self.res + }
+ + +if __name__ == '__main__': + pass +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAEngine/QAThreadEngine.html b/_build/html/_modules/QUANTAXIS/QAEngine/QAThreadEngine.html new file mode 100644 index 000000000..3f548979f --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAEngine/QAThreadEngine.html @@ -0,0 +1,282 @@ + + + + + + + + QUANTAXIS.QAEngine.QAThreadEngine — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAEngine.QAThreadEngine

+# coding:utf-8
+
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+import datetime
+import threading
+import time
+from queue import Queue
+
+from QUANTAXIS.QAEngine.QATask import QA_Task
+from QUANTAXIS.QAUtil import QA_util_log_info, QA_util_random_with_topic
+
+
+"""标准化的QUANATAXIS事件分发,可以快速引入和复用
+每个事件需要携带一个方法,并且是需要立即被执行的时间才能使用这个事件方法"""
+
+
+
[docs]class QA_Thread(threading.Thread): + '这是一个随意新建线程的生产者消费者模型' + + def __init__(self, queue=None, name=None): + threading.Thread.__init__(self) + self.queue = Queue() if queue is None else queue + self.thread_stop = False + self.__flag = threading.Event() # 用于暂停线程的标识 + self.__flag.set() # 设置为True + self.__running = threading.Event() # 用于停止线程的标识 + self.__running.set() # 将running设置为True + self.name = QA_util_random_with_topic( + topic='QAWorker', lens=3) if name is None else name + self.idle = False + + def __repr__(self): + return '< QA_Thread {} >'.format(self.name) + +
[docs] def run(self): + while self.__running.isSet(): + self.__flag.wait() + while not self.thread_stop: + '这是一个阻塞的队列,避免出现消息的遗漏' + + try: + if self.queue.empty() is False: + _task = self.queue.get() # 接收消息 + assert isinstance(_task, QA_Task) + if _task.worker != None: + + _task.do() + + self.queue.task_done() # 完成一个任务 + else: + pass + else: + self.idle = True + except Exception as e: + pass
+ +
[docs] def pause(self): + self.__flag.clear()
+ +
[docs] def resume(self): + self.__flag.set() # 设置为True, 让线程停止阻塞
+ +
[docs] def stop(self): + # self.__flag.set() # 将线程从暂停状态恢复, 如何已经暂停的话 + self.__running.clear() + self.thread_stop = True # 设置为False
+ + def __start(self): + self.queue.start() + +
[docs] def put(self, task): + self.queue.put(task)
+ +
[docs] def put_nowait(self, task): + self.queue.put_nowait(task)
+ +
[docs] def get(self, task): + return self.get(task)
+ +
[docs] def get_nowait(self, task): + return self.get_nowait(task)
+ +
[docs] def qsize(self): + return self.queue.qsize()
+ + +
[docs]class QA_Engine(QA_Thread): + def __init__(self, queue=None, *args, **kwargs): + super().__init__(queue=queue, name='QAENGINE') + self.kernals = {} + self.__flag = threading.Event() # 用于暂停线程的标识 + self.__flag.set() # 设置为True + self.__running = threading.Event() # 用于停止线程的标识 + self.__running.set() # 将running设置为True + + def __repr__(self): + return ' <QA_ENGINE with {} kernals>'.format(list(self.kernals.keys())) + + @property + def kernel_num(self): + return len(self.kernals.keys()) + +
[docs] def create_kernal(self, name): + # ENGINE线程创建一个事件线程 + self.kernals[name] = QA_Thread(name=name)
+ +
[docs] def register_kernal(self, name, kernal): + if name not in self.kernals.keys(): + self.kernals[name] = kernal
+ +
[docs] def start_kernal(self, name): + self.kernals[name].start()
+ +
[docs] def stop_kernal(self, name): + self.kernals[name].stop() + del self.kernals[name]
+ +
[docs] def run_job(self, task): + self.kernals[task.engine].put(task)
+ +
[docs] def stop_all(self): + for item in self.kernals.values(): + item.stop() + self.kernals = {}
+ +
[docs] def stop(self): + # self.__flag.set() # 将线程从暂停状态恢复, 如何已经暂停的话 + self.__running.clear() + self.thread_stop = True
+ +
[docs] def pause(self): + self.__flag.clear()
+ +
[docs] def resume(self): + self.__flag.set() # 设置为True, 让线程停止阻塞
+ +
[docs] def run(self): + while self.__running.isSet(): + self.__flag.wait() + while not self.thread_stop: + '这是一个阻塞的队列,避免出现消息的遗漏' + + try: + if self.queue.empty() is False: + _task = self.queue.get() # 接收消息 + assert isinstance(_task, QA_Task) + if _task.engine is None: + # 如果不指定线程 就在ENGINE线程中运行 + _task.do() + self.queue.task_done() + else: + # + self.run_job(_task) + self.queue.task_done() + else: + self.idle = True + except Exception as e: + raise e
+ # self.run() + +
[docs] def clear(self): + res = True + for item in self.kernals.values(): + if not item.queue.empty(): + res = False + if not item.idle: + res = False + + item.queue.join() + if not self.queue.empty(): + res = False + + return res
+ +
[docs] def join(self): + for item in self.kernals.values(): + item.queue.join() + self.queue.join()
+ + +if __name__ == '__main__': + import queue + q = queue.Queue() +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAFetch.html b/_build/html/_modules/QUANTAXIS/QAFetch.html new file mode 100644 index 000000000..4ef60df51 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAFetch.html @@ -0,0 +1,256 @@ + + + + + + + + QUANTAXIS.QAFetch — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAFetch

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+"""
+QA fetch module
+
+@yutiansut
+
+QAFetch is Under [QAStandard#0.0.2@10x] Protocol
+
+
+"""
+from QUANTAXIS.QAFetch import QAWind as QAWind
+from QUANTAXIS.QAFetch import QATushare as QATushare
+from QUANTAXIS.QAFetch import QATdx as QATdx
+from QUANTAXIS.QAFetch import QAThs as QAThs
+from QUANTAXIS.QAFetch import QACrawler as QACL
+from QUANTAXIS.QAFetch import QAEastMoney as QAEM
+
+
[docs]def use(package): + if package in ['wind']: + from WindPy import w + # w.start() + return QAWind + elif package in ['tushare', 'ts']: + return QATushare + elif package in ['tdx', 'pytdx']: + return QATdx + elif package in ['ths', 'THS']: + return QAThs
+ + +
[docs]def QA_fetch_get_stock_day(package, code, start, end, if_fq='01', level='day', type_='json'): + Engine = use(package) + if package in ['ths', 'THS', 'wind']: + return Engine.QA_fetch_get_stock_day(code, start, end, if_fq) + elif package in ['ts', 'tushare']: + return Engine.QA_fetch_get_stock_day(code, start, end, if_fq, type_) + elif package in ['tdx', 'pytdx']: + return Engine.QA_fetch_get_stock_day(code, start, end, if_fq, level) + else: + return Engine.QA_fetch_get_stock_day(code, start, end)
+ + +
[docs]def QA_fetch_get_stock_realtime(package, code): + Engine = use(package) + return Engine.QA_fetch_get_stock_realtime(code)
+ + +
[docs]def QA_fetch_get_stock_indicator(package, code, start, end): + Engine = use(package) + return Engine.QA_fetch_get_stock_indicator(code, start, end)
+ + +
[docs]def QA_fetch_get_trade_date(package, end, exchange): + Engine = use(package) + return Engine.QA_fetch_get_trade_date(end, exchange)
+ + +
[docs]def QA_fetch_get_stock_min(package, code, start, end, level='1min'): + Engine = use(package) + if package in ['tdx', 'pytdx']: + return Engine.QA_fetch_get_stock_min(code, start, end, level) + else: + return 'Unsupport packages'
+ + +
[docs]def QA_fetch_get_stock_list(package, type_='stock'): + Engine = use(package) + if package in ['tdx', 'pytdx']: + return Engine.QA_fetch_get_stock_list(type_) + else: + return 'Unsupport packages'
+ + +
[docs]def QA_fetch_get_stock_transaction(package, code, start, end, retry=2): + Engine = use(package) + if package in ['tdx', 'pytdx']: + return Engine.QA_fetch_get_stock_transaction(code, start, end, retry) + else: + return 'Unsupport packages'
+ + +
[docs]def QA_fetch_get_stock_transaction_realtime(package, code): + Engine = use(package) + if package in ['tdx', 'pytdx']: + return Engine.QA_fetch_get_stock_transaction_realtime(code) + else: + return 'Unsupport packages'
+ + +
[docs]def QA_fetch_get_stock_xdxr(package, code): + Engine = use(package) + if package in ['tdx', 'pytdx']: + return Engine.QA_fetch_get_stock_xdxr(code) + else: + return 'Unsupport packages'
+ + +
[docs]def QA_fetch_get_index_day(package, code, start, end, level='day'): + Engine = use(package) + if package in ['tdx', 'pytdx']: + return Engine.QA_fetch_get_index_day(code, start, end, level) + else: + return 'Unsupport packages'
+ + +
[docs]def QA_fetch_get_index_min(package, code, start, end, level='1min'): + Engine = use(package) + if package in ['tdx', 'pytdx']: + return Engine.QA_fetch_get_index_min(code, start, end, level) + else: + return 'Unsupport packages'
+ + +
[docs]def QA_fetch_get_stock_block(package): + Engine = use(package) + if package in ['tdx', 'pytdx', 'ths']: + return Engine.QA_fetch_get_stock_block() + else: + return 'Unsupport packages'
+ + +
[docs]def QA_fetch_get_stock_info(package, code): + Engine = use(package) + if package in ['tdx', 'pytdx']: + return Engine.QA_fetch_get_stock_info(code) + else: + return 'Unsupport packages'
+ + +
[docs]def QA_fetch_get_future_list(package,): + Engine = use(package) + if package in ['tdx', 'pytdx']: + return Engine.QA_fetch_get_future_list() + else: + return 'Unsupport packages'
+ + +
[docs]def QA_fetch_get_future_day(package, code, start, end, frequence='day'): + Engine = use(package) + if package in ['tdx', 'pytdx']: + return Engine.QA_fetch_get_future_day(code, start, end, frequence=frequence) + else: + return 'Unsupport packages'
+ + +
[docs]def QA_fetch_get_future_min(package, code, start, end, frequence='1min'): + Engine = use(package) + if package in ['tdx', 'pytdx']: + return Engine.QA_fetch_get_future_min(code, start, end, frequence=frequence) + else: + return 'Unsupport packages'
+ + +
[docs]def QA_fetch_get_security_bars(code, _type, lens): + return QATdx.QA_fetch_get_security_bars(code, _type, lens)
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAFetch/Fetcher.html b/_build/html/_modules/QUANTAXIS/QAFetch/Fetcher.html new file mode 100644 index 000000000..a5d1d54a7 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAFetch/Fetcher.html @@ -0,0 +1,200 @@ + + + + + + + + QUANTAXIS.QAFetch.Fetcher — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAFetch.Fetcher

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+"""
+QA fetch module
+
+@yutiansut
+
+QAFetch is Under [QAStandard#0.0.2@10x] Protocol
+
+
+"""
+from QUANTAXIS.QAFetch import QAWind as QAWind
+from QUANTAXIS.QAFetch import QATushare as QATushare
+from QUANTAXIS.QAFetch import QATdx as QATdx
+from QUANTAXIS.QAFetch import QAThs as QAThs
+from QUANTAXIS.QAFetch import QAQuery
+from QUANTAXIS.QAFetch import QAQuery_Advance as QAQueryAdv
+from QUANTAXIS.QAFetch import QAEastMoney as QAEM
+from QUANTAXIS.QAUtil.QAParameter import FREQUENCE, MARKET_TYPE, DATASOURCE, OUTPUT_FORMAT, DATABASE_TABLE
+from QUANTAXIS.QAUtil.QASql import QA_util_sql_mongo_setting
+
+
+
[docs]class QA_Fetcher(): + def __init__(self, ip='127.0.0.1', port=27017, username='',password='',): + """ + 初始化的时候 会初始化 + """ + self.ip = ip + self.port = port + self.database = QA_util_sql_mongo_setting(ip, port).quantaxis + self.history = {} + + self.best_ip=QATdx.best_ip + + +
[docs] def change_ip(self, ip, port): + self.database = QA_util_sql_mongo_setting(ip, port).quantaxis + return self
+ +
[docs] def get_quotation(self, code=None, start=None, end=None, frequence=None, market=None, source=None, output=None): + """ + Arguments: + code {str/list} -- 证券/股票的代码 + start {str} -- 开始日期 + end {str} -- 结束日期 + frequence {enum} -- 频率 QA.FREQUENCE + market {enum} -- 市场 QA.MARKET_TYPE + source {enum} -- 来源 QA.DATASOURCE + output {enum} -- 输出类型 QA.OUTPUT_FORMAT + """ + pass
+ +
[docs] def get_info(self,code,frequence,market,source,output): + if source is DATASOURCE.TDX: + res=QATdx.QA_fetch_get_stock_info(code,self.best_ip) + return res + elif source is DATASOURCE.MONGO: + res=QAQuery.QA_fetch_stock_info(code,format=output,collections=self.database.stock_info) + return res
+ +
[docs]def QA_quotation(code, start, end, frequence, market, source, output): + """一个统一的fetch + + Arguments: + code {str/list} -- 证券/股票的代码 + start {str} -- 开始日期 + end {str} -- 结束日期 + frequence {enum} -- 频率 QA.FREQUENCE + market {enum} -- 市场 QA.MARKET_TYPE + source {enum} -- 来源 QA.DATASOURCE + output {enum} -- 输出类型 QA.OUTPUT_FORMAT + + """ + if market is MARKET_TYPE.STOCK_CN: + if frequence is FREQUENCE.DAY: + if source is DATASOURCE.MONGO: + res = QAQueryAdv.QA_fetch_stock_day_adv(code, start, end) + elif source is DATASOURCE.TDX: + res = QATdx.QA_fetch_get_stock_day(code, start, end, '00') + elif source is DATASOURCE.TUSHARE: + res = QATushare.QA_fetch_get_stock_day(code, start, end, '00') + elif frequence in [FREQUENCE.ONE_MIN, FREQUENCE.FIVE_MIN, FREQUENCE.FIFTEEN_MIN, FREQUENCE.THIRTY_MIN, FREQUENCE.SIXTY_MIN]: + if source is DATASOURCE.MONGO: + res = QAQueryAdv.QA_fetch_stock_min_adv( + code, start, end, frequence=frequence) + elif source is DATASOURCE.TDX: + res = QATdx.QA_fetch_get_stock_min( + code, start, end, frequence=frequence) + elif frequence is FREQUENCE.TICK: + if source is DATASOURCE.TDX: + res = QATdx.QA_fetch_get_stock_transaction(code, start, end) + print(type(res)) + return res
+ + +if __name__ == '__main__': + print(QA_quotation('000001', '2017-01-01', '2017-01-31', frequence=FREQUENCE.DAY, + market=MARKET_TYPE.STOCK_CN, source=DATASOURCE.TDX, output=OUTPUT_FORMAT.DATAFRAME)) +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAFetch/QACrawler.html b/_build/html/_modules/QUANTAXIS/QAFetch/QACrawler.html new file mode 100644 index 000000000..17334757e --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAFetch/QACrawler.html @@ -0,0 +1,148 @@ + + + + + + + + QUANTAXIS.QAFetch.QACrawler — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAFetch.QACrawler

+# coding: utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+
+import pandas as pd
+from QUANTAXIS.QAUtil.QADate_trade import trade_date_sse
+from QUANTAXIS.QAUtil.QADate import QA_util_date_str2int
+
+_sh_url = 'http://www.sse.com.cn/market/dealingdata/overview/margin/a/rzrqjygk{}.xls'
+_sz_url = 'http://www.szse.cn/szseWeb/ShowReport.szse?SHOWTYPE=xlsx&CATALOGID=1837_xxpl&txtDate={}&tab2PAGENO=1&ENCODE=1&TABKEY=tab2'
+
+
+
[docs]def QA_fetch_get_sh_margin(date): + """return shanghai margin data + + Arguments: + date {str YYYY-MM-DD} -- date format + + Returns: + pandas.DataFrame -- res for margin data + """ + if date in trade_date_sse: + data= pd.read_excel(_sh_url.format(QA_util_date_str2int + (date)), 1).assign(date=date).assign(sse='sh') + data.columns=['code','name','leveraged_balance','leveraged_buyout','leveraged_payoff','margin_left','margin_sell','margin_repay','date','sse'] + return data + else: + pass
+ + +
[docs]def QA_fetch_get_sz_margin(date): + """return shenzhen margin data + + Arguments: + date {str YYYY-MM-DD} -- date format + + Returns: + pandas.DataFrame -- res for margin data + """ + + if date in trade_date_sse: + return pd.read_excel(_sz_url.format(date)).assign(date=date).assign(sse='sz')
+ + +if __name__ == "__main__": + print(QA_fetch_get_sz_margin('2018-01-25')) + print(QA_fetch_get_sh_margin('2018-01-25')) +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAFetch/QAEastMoney.html b/_build/html/_modules/QUANTAXIS/QAFetch/QAEastMoney.html new file mode 100644 index 000000000..f15530a4a --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAFetch/QAEastMoney.html @@ -0,0 +1,157 @@ + + + + + + + + QUANTAXIS.QAFetch.QAEastMoney — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAFetch.QAEastMoney

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+import requests
+import pandas as pd
+from QUANTAXIS.QAFetch.base import headers, _select_market_code
+
+BusinessAnalysis_url = 'http://emweb.securities.eastmoney.com/PC_HSF10/BusinessAnalysis/BusinessAnalysisAjax?code={}{}'
+headers_em = headers
+headers_em['Host'] = 'emweb.securities.eastmoney.com'
+
+
+
[docs]def QA_fetch_get_stock_analysis(code): + """ + 'zyfw', 主营范围 'jyps'#经营评述 'zygcfx' 主营构成分析 + + date 主营构成 主营收入(元) 收入比例cbbl 主营成本(元) 成本比例 主营利润(元) 利润比例 毛利率(%) + 行业 /产品/ 区域 hq cp qy + """ + market = 'sh' if _select_market_code(code) == 1 else 'sz' + null = 'none' + data = eval(requests.get(BusinessAnalysis_url.format( + market, code), headers=headers_em).text) + zyfw = pd.DataFrame(data.get('zyfw', None)) + jyps = pd.DataFrame(data.get('jyps', None)) + zygcfx = data.get('zygcfx', []) + temp = [] + for item in zygcfx: + try: + data_ = pd.concat([pd.DataFrame(item['hy']).assign(date=item['rq']).assign(classify='hy'), + pd.DataFrame(item['cp']).assign( + date=item['rq']).assign(classify='cp'), + pd.DataFrame(item['qy']).assign(date=item['rq']).assign(classify='qy')]) + + temp.append(data_) + except: + pass + try: + res_zyfcfx = pd.concat(temp).set_index( + ['date', 'classify'], drop=False) + except: + res_zyfcfx = None + + return zyfw, jyps, res_zyfcfx
+ + + +cpbidu = 'http://emweb.securities.eastmoney.com/PC_HSF10/OperationsRequired/OperationsRequiredAjax?times=1&code=sz300059' + +headers_em_OperationsRequired = headers +headers_em_OperationsRequired['Accept'] = '*/*' +headers_em_OperationsRequired['Referer'] = 'http://emweb.securities.eastmoney.com/PC_HSF10/OperationsRequired/Index?type=soft&code=sz300059' + +headers_em_OperationsRequired['X-Requested-With'] = 'XMLHttpRequest' + +research_report = 'http://emweb.securities.eastmoney.com/PC_HSF10/ResearchReport/ResearchReportAjax?code=sz300059&icode=447' +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAFetch/QAQuery.html b/_build/html/_modules/QUANTAXIS/QAFetch/QAQuery.html new file mode 100644 index 000000000..4809e2682 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAFetch/QAQuery.html @@ -0,0 +1,434 @@ + + + + + + + + QUANTAXIS.QAFetch.QAQuery — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAFetch.QAQuery

+# coding: utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+
+import datetime
+
+import numpy
+import pandas as pd
+from pandas import DataFrame
+
+from QUANTAXIS.QAUtil import (DATABASE, QA_Setting, QA_util_date_stamp,
+                              QA_util_date_valid, QA_util_dict_remove_key,
+                              QA_util_log_info, QA_util_code_tolist,
+                              QA_util_sql_mongo_sort_DESCENDING,
+                              QA_util_time_stamp, QA_util_to_json_from_pandas,
+                              trade_date_sse)
+
+
+"""
+按要求从数据库取数据,并转换成numpy结构
+
+"""
+
+
+
[docs]def QA_fetch_stock_day(code, start, end, format='numpy', frequence='day', collections=DATABASE.stock_day): + '获取股票日线' + start = str(start)[0:10] + end = str(end)[0:10] + #code= [code] if isinstance(code,str) else code + + # code checking + code = QA_util_code_tolist(code) + + + if QA_util_date_valid(end) == True: + + __data = [] + cursor = collections.find({ + 'code': {'$in':code}, "date_stamp": { + "$lte": QA_util_date_stamp(end), + "$gte": QA_util_date_stamp(start)}}) + #res=[QA_util_dict_remove_key(data, '_id') for data in cursor] + + res=pd.DataFrame([item for item in cursor]) + try: + res=res.drop('_id',axis=1).assign(volume=res.vol).assign(date=pd.to_datetime(res.date)).drop_duplicates((['date','code'])).set_index('date', drop=False) + #return res + except: + res=None + if format in ['P', 'p', 'pandas', 'pd']: + return res + elif format in ['json', 'dict']: + return QA_util_to_json_from_pandas(res) + # 多种数据格式 + elif format in ['n', 'N', 'numpy']: + return numpy.asarray(res) + elif format in ['list', 'l', 'L']: + return numpy.asarray(res).tolist() + else: + return None + else: + QA_util_log_info('something wrong with date')
+ + +
[docs]def QA_fetch_stock_min(code, start, end, format='numpy', frequence='1min', collections=DATABASE.stock_min): + '获取股票分钟线' + if frequence in ['1min', '1m']: + frequence = '1min' + elif frequence in ['5min', '5m']: + frequence = '5min' + elif frequence in ['15min', '15m']: + frequence = '15min' + elif frequence in ['30min', '30m']: + frequence = '30min' + elif frequence in ['60min', '60m']: + frequence = '60min' + __data = [] + # code checking + code = QA_util_code_tolist(code) + + cursor = collections.find({ + 'code': {'$in': code}, "time_stamp": { + "$gte": QA_util_time_stamp(start), + "$lte": QA_util_time_stamp(end) + }, 'type': frequence + }) + + res=pd.DataFrame([item for item in cursor]) + try: + res=res.drop('_id',axis=1).assign(volume=res.vol).assign(datetime=pd.to_datetime(res.datetime)).drop_duplicates(['datetime','code']).set_index('datetime', drop=False) + #return res + except: + res=None + if format in ['P', 'p', 'pandas', 'pd']: + return res + elif format in ['json', 'dict']: + return QA_util_to_json_from_pandas(res) + # 多种数据格式 + elif format in ['n', 'N', 'numpy']: + return numpy.asarray(res) + elif format in ['list', 'l', 'L']: + return numpy.asarray(res).tolist() + else: + return None
+ + + +
[docs]def QA_fetch_trade_date(): + '获取交易日期' + return trade_date_sse
+ + +
[docs]def QA_fetch_stock_list(collections=DATABASE.stock_list): + '获取股票列表' + return [item for item in collections.find()]
+ + +
[docs]def QA_fetch_stock_full(date, format='numpy', collections=DATABASE.stock_day): + '获取全市场的某一日的数据' + Date = str(date)[0:10] + if QA_util_date_valid(Date) is True: + + __data = [] + for item in collections.find({ + "date_stamp": { + "$lte": QA_util_date_stamp(Date), + "$gte": QA_util_date_stamp(Date)}}): + __data.append([str(item['code']), float(item['open']), float(item['high']), float( + item['low']), float(item['close']), float(item['vol']), item['date']]) + # 多种数据格式 + if format in ['n', 'N', 'numpy']: + __data = numpy.asarray(__data) + elif format in ['list', 'l', 'L']: + __data = __data + elif format in ['P', 'p', 'pandas', 'pd']: + __data = DataFrame(__data, columns=[ + 'code', 'open', 'high', 'low', 'close', 'volume', 'date']) + __data['date'] = pd.to_datetime(__data['date']) + __data = __data.set_index('date', drop=False) + return __data + else: + QA_util_log_info('something wrong with date')
+ + + +
[docs]def QA_fetch_index_day(code, start, end, format='numpy', collections=DATABASE.index_day): + '获取指数日线' + start = str(start)[0:10] + end = str(end)[0:10] + + if QA_util_date_valid(end) == True: + + __data = [] + cursor = collections.find({ + 'code': str(code)[0:6], "date_stamp": { + "$lte": QA_util_date_stamp(end), + "$gte": QA_util_date_stamp(start)}}) + if format in ['dict', 'json']: + return [data for data in cursor] + for item in cursor: + + __data.append([str(item['code']), float(item['open']), float(item['high']), float( + item['low']), float(item['close']), float(item['vol']), item['date']]) + + # 多种数据格式 + if format in ['n', 'N', 'numpy']: + __data = numpy.asarray(__data) + elif format in ['list', 'l', 'L']: + __data = __data + elif format in ['P', 'p', 'pandas', 'pd']: + + __data = DataFrame(__data, columns=[ + 'code', 'open', 'high', 'low', 'close', 'volume', 'date']) + + __data['date'] = pd.to_datetime(__data['date']) + __data = __data.set_index('date', drop=False) + return __data + else: + QA_util_log_info('something wrong with date')
+ + +
[docs]def QA_fetch_indexlist_day(stock_list, date_range, collections=DATABASE.index_day): + '获取多个股票的日线' + __data = [] + for item in stock_list: + __data.append(QA_fetch_index_day( + item, date_range[0], date_range[-1], 'pd', collections)) + return __data
+ + +
[docs]def QA_fetch_index_min( + code, + start, end, + format='numpy', + frequence='1min', + collections=DATABASE.index_min): + '获取股票分钟线' + if frequence in ['1min', '1m']: + frequence = '1min' + elif frequence in ['5min', '5m']: + frequence = '5min' + elif frequence in ['15min', '15m']: + frequence = '15min' + elif frequence in ['30min', '30m']: + frequence = '30min' + elif frequence in ['60min', '60m']: + frequence = '60min' + __data = [] + + cursor = collections.find({ + 'code': str(code), "time_stamp": { + "$gte": QA_util_time_stamp(start), + "$lte": QA_util_time_stamp(end) + }, 'type': frequence + }) + if format in ['dict', 'json']: + return [data for data in cursor] + for item in cursor: + + __data.append([str(item['code']), float(item['open']), float(item['high']), float( + item['low']), float(item['close']), float(item['vol']), item['datetime'], item['time_stamp'], item['date']]) + + __data = DataFrame(__data, columns=[ + 'code', 'open', 'high', 'low', 'close', 'volume', 'datetime', 'time_stamp', 'date']) + + __data['datetime'] = pd.to_datetime(__data['datetime']) + __data = __data.set_index('datetime', drop=False) + if format in ['numpy', 'np', 'n']: + return numpy.asarray(__data) + elif format in ['list', 'l', 'L']: + return numpy.asarray(__data).tolist() + elif format in ['P', 'p', 'pandas', 'pd']: + return __data
+ + +
[docs]def QA_fetch_future_day(): + pass
+ + +
[docs]def QA_fetch_future_min(): + pass
+ + +
[docs]def QA_fetch_future_tick(): + pass
+ + +
[docs]def QA_fetch_stock_xdxr(code, format='pd', collections=DATABASE.stock_xdxr): + '获取股票除权信息/数据库' + data = pd.DataFrame([item for item in collections.find( + {'code': code})]).drop(['_id'], axis=1) + data['date'] = pd.to_datetime(data['date']) + return data.set_index('date', drop=False)
+ + +
[docs]def QA_fetch_backtest_info(user=None, account_cookie=None, strategy=None, stock_list=None, collections=DATABASE.backtest_info): + + return QA_util_to_json_from_pandas(pd.DataFrame([item for item in collections.find(QA_util_to_json_from_pandas(pd.DataFrame([user, account_cookie, strategy, stock_list], index=['user', 'account_cookie', 'strategy', 'stock_list']).dropna().T)[0])]).drop(['_id'], axis=1))
+ + +
[docs]def QA_fetch_backtest_history(cookie=None, collections=DATABASE.backtest_history): + return QA_util_to_json_from_pandas(pd.DataFrame([item for item in collections.find(QA_util_to_json_from_pandas(pd.DataFrame([cookie], index=['cookie']).dropna().T)[0])]).drop(['_id'], axis=1))
+ + +
[docs]def QA_fetch_stock_block(code=None, format='pd', collections=DATABASE.stock_block): + if code is not None: + data = pd.DataFrame([item for item in collections.find( + {'code': code})]).drop(['_id'], axis=1) + return data.set_index('code', drop=False) + else: + data = pd.DataFrame( + [item for item in collections.find()]).drop(['_id'], axis=1) + return data.set_index('code', drop=False)
+ + +
[docs]def QA_fetch_stock_info(code, format='pd', collections=DATABASE.stock_info): + try: + data = pd.DataFrame([item for item in collections.find( + {'code': code})]).drop(['_id'], axis=1) + #data['date'] = pd.to_datetime(data['date']) + return data.set_index('code', drop=False) + except Exception as e: + QA_util_log_info(e) + return None
+ + +
[docs]def QA_fetch_stock_name(code, collections=DATABASE.stock_list): + try: + return collections.find_one({'code': code})['name'] + except Exception as e: + QA_util_log_info(e)
+ + +
[docs]def QA_fetch_quotation(code, date=datetime.date.today(), db=DATABASE): + '获取某一只实时5档行情的存储结果' + try: + collections = db.get_collection( + 'realtime_{}'.format(date)) + return pd.DataFrame([item for item in collections.find( + {'code': code})]).drop(['_id'], axis=1).set_index('datetime', drop=False).sort_index() + except Exception as e: + raise e
+ + +
[docs]def QA_fetch_quotations(date=datetime.date.today(), db=DATABASE): + '获取全部实时5档行情的存储结果' + try: + collections = db.get_collection( + 'realtime_{}'.format(date)) + return pd.DataFrame([item for item in collections.find( + {})]).drop(['_id'], axis=1).set_index('datetime', drop=False).sort_index() + except Exception as e: + raise e
+ + +
[docs]def QA_fetch_account(message={}, db=DATABASE): + """get the account + + Arguments: + query_mes {[type]} -- [description] + + Keyword Arguments: + collection {[type]} -- [description] (default: {DATABASE}) + + Returns: + [type] -- [description] + """ + collection = DATABASE.account + return [QA_util_dict_remove_key(res, '_id') for res in collection.find(message)]
+ + +if __name__ == '__main__': + print(QA_fetch_quotations('000001')) +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAFetch/QAQuery_Advance.html b/_build/html/_modules/QUANTAXIS/QAFetch/QAQuery_Advance.html new file mode 100644 index 000000000..9a42b2726 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAFetch/QAQuery_Advance.html @@ -0,0 +1,323 @@ + + + + + + + + QUANTAXIS.QAFetch.QAQuery_Advance — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAFetch.QAQuery_Advance

+# coding: utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+import datetime
+import re
+import pymongo
+import pandas as pd
+from pandas import DataFrame
+
+from QUANTAXIS.QAData import (QA_DataStruct_Index_day, QA_DataStruct_Index_min,
+                              QA_DataStruct_Stock_block,
+                              QA_DataStruct_Stock_day, QA_DataStruct_Stock_min,
+                              QA_DataStruct_Stock_transaction)
+from QUANTAXIS.QAFetch.QAQuery import (QA_fetch_indexlist_day,
+                                       QA_fetch_stock_day,
+                                       QA_fetch_stock_full,
+                                       QA_fetch_stock_min)
+from QUANTAXIS.QAUtil import (DATABASE, QA_Setting, QA_util_date_stamp,
+                              QA_util_date_valid, QA_util_log_info,
+                              QA_util_time_stamp)
+
+"""
+按要求从数据库取数据,并转换成numpy结构
+
+"""
+# start='1990-01-01',end=str(datetime.date.today())
+
+
+
[docs]def QA_fetch_stock_day_adv( + code, + start='all', end=None, + if_drop_index=False, + collections=DATABASE.stock_day): + '获取股票日线' + end = start if end is None else end + start = str(start)[0:10] + end = str(end)[0:10] + + if start == 'all': + start = '1990-01-01' + end = str(datetime.date.today()) + + return QA_DataStruct_Stock_day(QA_fetch_stock_day(code, start, end, format='pd').query('volume>1').set_index(['date', 'code'], drop=if_drop_index))
+ + +
[docs]def QA_fetch_stock_min_adv( + code, + start, end=None, + frequence='1min', + if_drop_index=False, + collections=DATABASE.stock_min): + '获取股票分钟线' + if frequence in ['1min', '1m']: + frequence = '1min' + elif frequence in ['5min', '5m']: + frequence = '5min' + elif frequence in ['15min', '15m']: + frequence = '15min' + elif frequence in ['30min', '30m']: + frequence = '30min' + elif frequence in ['60min', '60m']: + frequence = '60min' + __data = [] + + end = start if end is None else end + if len(start) == 10: + start = '{} 09:30:00'.format(start) + if len(end) == 10: + end = '{} 15:00:00'.format(end) + + return QA_DataStruct_Stock_min(QA_fetch_stock_min(code, start, end, format='pd', frequence=frequence).query('volume>1').set_index(['datetime', 'code'], drop=if_drop_index))
+ + +
[docs]def QA_fetch_stock_day_full_adv(date): + '返回全市场某一天的数据' + return QA_DataStruct_Stock_day(QA_fetch_stock_full(date, 'pd').set_index(['date', 'code'], drop=False))
+ + +
[docs]def QA_fetch_index_day_adv( + code, + start, end=None, + if_drop_index=False, + collections=DATABASE.index_day): + '获取指数日线' + end = start if end is None else end + start = str(start)[0:10] + end = str(end)[0:10] + if isinstance(code, str): + if QA_util_date_valid(end) == True: + __data = [] + for item in collections.find({ + 'code': str(code)[0:6], "date_stamp": { + "$lte": QA_util_date_stamp(end), + "$gte": QA_util_date_stamp(start)}}): + __data.append([str(item['code']), float(item['open']), float(item['high']), float( + item['low']), float(item['close']), float(item['vol']), item['date']]) + __data = DataFrame(__data, columns=[ + 'code', 'open', 'high', 'low', 'close', 'volume', 'date']) + __data['date'] = pd.to_datetime(__data['date']) + return QA_DataStruct_Index_day(__data.query('volume>1').set_index(['date', 'code'], drop=if_drop_index)) + else: + QA_util_log_info('something wrong with date') + + elif isinstance(code, list): + return QA_DataStruct_Index_day(pd.concat(QA_fetch_indexlist_day(code, [start, end])).query('volume>1').set_index(['date', 'code'], drop=if_drop_index))
+ + +
[docs]def QA_fetch_index_min_adv( + code, + start, end=None, + frequence='1min', + if_drop_index=False, + collections=DATABASE.index_min): + '获取股票分钟线' + if frequence in ['1min', '1m']: + frequence = '1min' + elif frequence in ['5min', '5m']: + frequence = '5min' + elif frequence in ['15min', '15m']: + frequence = '15min' + elif frequence in ['30min', '30m']: + frequence = '30min' + elif frequence in ['60min', '60m']: + frequence = '60min' + __data = [] + end = start if end is None else end + if len(start) == 10: + start = '{} 09:30:00'.format(start) + if len(end) == 10: + end = '{} 15:00:00'.format(end) + if isinstance(code, str): + for item in collections.find({ + 'code': str(code), "time_stamp": { + "$gte": QA_util_time_stamp(start), + "$lte": QA_util_time_stamp(end) + }, 'type': frequence + }): + + __data.append([str(item['code']), float(item['open']), float(item['high']), float( + item['low']), float(item['close']), float(item['vol']), item['datetime'], item['time_stamp'], item['date']]) + + __data = DataFrame(__data, columns=[ + 'code', 'open', 'high', 'low', 'close', 'volume', 'datetime', 'time_stamp', 'date']) + + __data['datetime'] = pd.to_datetime(__data['datetime']) + return QA_DataStruct_Index_min(__data.query('volume>1').set_index(['datetime', 'code'], drop=if_drop_index)) + + elif isinstance(code, list): + return QA_DataStruct_Index_min(pd.concat([QA_fetch_index_min_adv(code_, start, end, frequence, if_drop_index).data for code_ in code]).set_index(['datetime', 'code'], drop=if_drop_index))
+ + +
[docs]def QA_fetch_stock_transaction_adv( + code, + start, end=None, + if_drop_index=False, + collections=DATABASE.stock_transaction): + end = start if end is None else end + data = DataFrame([item for item in collections.find({ + 'code': str(code), "date": { + "$gte": start, + "$lte": end + }})]) + + data['datetime'] = pd.to_datetime(data['datetime']) + return QA_DataStruct_Stock_transaction(data.set_index('datetime', drop=if_drop_index))
+ + +
[docs]def QA_fetch_security_list_adv(collections=DATABASE.stock_list): + '获取股票列表' + return pd.DataFrame([item for item in collections.find()]).drop('_id', axis=1, inplace=False)
+ + +
[docs]def QA_fetch_stock_list_adv(collections=DATABASE.stock_list): + '获取股票列表' + return pd.DataFrame([item for item in collections.find()]).drop('_id', axis=1, inplace=False)
+ + +
[docs]def QA_fetch_stock_block_adv(code=None, blockname=None, collections=DATABASE.stock_block): + """返回板块 + + Keyword Arguments: + code {[type]} -- [description] (default: {None}) + blockname {[type]} -- [descrioption] (default : {None}) + collections {[type]} -- [description] (default: {DATABASE}) + + Returns: + [type] -- [description] + """ + + if code is not None and blockname is None: + data = pd.DataFrame([item for item in collections.find( + {'code': code})]).drop(['_id'], axis=1) + return QA_DataStruct_Stock_block(data.set_index('code', drop=False).drop_duplicates()) + elif blockname is not None and code is None: + + data = pd.DataFrame([item for item in collections.find( + {'blockname': re.compile(blockname)})]).drop(['_id'], axis=1) + else: + data = pd.DataFrame( + [item for item in collections.find()]).drop(['_id'], axis=1) + return QA_DataStruct_Stock_block(data.set_index('code', drop=False).drop_duplicates())
+ + +
[docs]def QA_fetch_stock_realtime_adv(code=None, num=1, collections=DATABASE.get_collection('realtime_{}'.format(datetime.date.today()))): + """ + 返回当日的上下五档, code可以是股票可以是list, num是每个股票获取的数量 + """ + if code is not None: + if isinstance(code, str): + code = list(code) + + elif isinstance(code, list): + pass + data = pd.DataFrame([item for item in collections.find( + {'code': {'$in': code}}, limit=num*len(code), sort=[('datetime', pymongo.DESCENDING)])]).set_index(['datetime', 'code'], drop=False).drop(['_id'], axis=1) + return data + else: + pass
+ + +if __name__ == '__main__': + QA_fetch_stock_realtime_adv(['000001', '000002'], num=10) +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAFetch/QATdx.html b/_build/html/_modules/QUANTAXIS/QAFetch/QATdx.html new file mode 100644 index 000000000..4d9e244c7 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAFetch/QATdx.html @@ -0,0 +1,974 @@ + + + + + + + + QUANTAXIS.QAFetch.QATdx — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAFetch.QATdx

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+import datetime
+
+import numpy as np
+import pandas as pd
+from pytdx.exhq import TdxExHq_API
+from pytdx.hq import TdxHq_API
+
+from QUANTAXIS.QAUtil import (QA_util_date_stamp, QA_util_date_str2int,
+                              QA_util_date_valid, QA_util_get_real_date,
+                              QA_util_get_real_datelist, QA_util_get_trade_gap,
+                              QA_util_log_info, QA_util_time_stamp,
+                              QA_util_web_ping, future_ip_list, stock_ip_list,
+                              trade_date_sse)
+
+from QUANTAXIS.QAFetch.base import _select_market_code, _select_type
+
+# 基于Pytdx的数据接口,好处是可以在linux/mac上联入通达信行情
+# 具体参见rainx的pytdx(https://github.com/rainx/pytdx)
+#
+
+
+
[docs]def ping(ip, port=7709, type_='stock'): + api = TdxHq_API() + apix = TdxExHq_API() + __time1 = datetime.datetime.now() + try: + if type_ in ['stock']: + with api.connect(ip, port, time_out=0.7): + if len(api.get_security_list(0, 1)) > 800: + return datetime.datetime.now() - __time1 + else: + print('Bad STOCKIP REPSONSE %s' % ip) + return datetime.timedelta(9, 9, 0) + elif type_ in ['future']: + with apix.connect(ip, port, time_out=0.7): + if apix.get_instrument_count() > 10000: + return datetime.datetime.now() - __time1 + else: + print('Bad FUTUREIP REPSONSE %s' % ip) + return datetime.timedelta(9, 9, 0) + except: + print('Bad REPSONSE %s' % ip) + return datetime.timedelta(9, 9, 0)
+ + +
[docs]def select_best_ip(): + QA_util_log_info('Selecting the Best Server IP of TDX') + + data_stock = [ping(x['ip'], x['port'], 'stock') for x in stock_ip_list] + data_future = [ping(x['ip'], x['port'], 'future') for x in future_ip_list] + + best_stock_ip = stock_ip_list[data_stock.index(min(data_stock))] + best_future_ip = future_ip_list[data_future.index(min(data_future))] + + QA_util_log_info('=== The BEST SERVER ===\n stock_ip {} future_ip {}'.format( + best_stock_ip['ip'], best_future_ip['ip'])) + return {'stock': best_stock_ip, 'future': best_future_ip}
+ + +best_ip = select_best_ip() + +# return 1 if sh, 0 if sz + + +
[docs]def QA_fetch_get_security_bars(code, _type, lens, ip=best_ip['stock']['ip'], port=best_ip['stock']['port']): + """按bar长度推算数据 + + Arguments: + code {[type]} -- [description] + _type {[type]} -- [description] + lens {[type]} -- [description] + + Keyword Arguments: + ip {[type]} -- [description] (default: {best_ip}) + port {[type]} -- [description] (default: {7709}) + + Returns: + [type] -- [description] + """ + + api = TdxHq_API() + with api.connect(ip, port): + data = pd.concat([api.to_df(api.get_security_bars(_select_type(_type), _select_market_code( + code), code, (i - 1) * 800, 800)) for i in range(1, int(lens / 800) + 2)], axis=0) + data = data\ + .assign(datetime=pd.to_datetime(data['datetime']), code=str(code))\ + .drop(['year', 'month', 'day', 'hour', 'minute'], axis=1, inplace=False)\ + .assign(date=data['datetime'].apply(lambda x: str(x)[0:10]))\ + .assign(date_stamp=data['datetime'].apply(lambda x: QA_util_date_stamp(x)))\ + .assign(time_stamp=data['datetime'].apply(lambda x: QA_util_time_stamp(x)))\ + .assign(type=_type).set_index('datetime', drop=False, inplace=False).tail(lens) + if data is not None: + return data + else: + return None
+ + +
[docs]def QA_fetch_get_stock_day(code, start_date, end_date, if_fq='00', frequence='day', ip=best_ip['stock']['ip'], port=best_ip['stock']['port']): + """获取日线及以上级别的数据 + + + Arguments: + code {str:6} -- code 是一个单独的code 6位长度的str + start_date {str:10} -- 10位长度的日期 比如'2017-01-01' + end_date {str:10} -- 10位长度的日期 比如'2018-01-01' + + Keyword Arguments: + if_fq {str} -- '00'/'bfq' -- 不复权 '01'/'qfq' -- 前复权 '02'/'hfq' -- 后复权 '03'/'ddqfq' -- 定点前复权 '04'/'ddhfq' --定点后复权 + frequency {str} -- day/week/month/quarter/year 也可以是简写 D/W/M/Q/Y + ip {str} -- [description] (default: best_ip['stock']['ip']) ip可以通过select_best_ip()函数重新获取 + port {int} -- [description] (default: {7709}) + + + Returns: + pd.DataFrame/None -- 返回的是dataframe,如果出错比如只获取了一天,而当天停牌,返回None + + Exception: + 如果出现网络问题/服务器拒绝, 会出现socket:time out 尝试再次获取/更换ip即可, 本函数不做处理 + """ + + api = TdxHq_API() + with api.connect(ip, port, time_out=0.7): + + if frequence in ['day', 'd', 'D', 'DAY', 'Day']: + frequence = 9 + elif frequence in ['w', 'W', 'Week', 'week']: + frequence = 5 + elif frequence in ['month', 'M', 'm', 'Month']: + frequence = 6 + elif frequence in ['quarter', 'Q', 'Quarter', 'q']: + frequence = 10 + elif frequence in ['y', 'Y', 'year', 'Year']: + frequence = 11 + start_date = str(start_date)[0:10] + today_ = datetime.date.today() + lens = QA_util_get_trade_gap(start_date, today_) + + data = pd.concat([api.to_df(api.get_security_bars(frequence, _select_market_code( + code), code, (int(lens / 800) - i) * 800, 800)) for i in range(int(lens / 800) + 1)], axis=0) + + # 这里的问题是: 如果只取了一天的股票,而当天停牌, 那么就直接返回None了 + if len(data) < 1: + return None + data = data[data['open'] != 0] + + if if_fq in ['00', 'bfq']: + data = data.assign(date=data['datetime'].apply(lambda x: str(x[0:10]))).assign(code=str(code))\ + .assign(date_stamp=data['datetime'].apply(lambda x: QA_util_date_stamp(str(x)[0:10]))).set_index('date', drop=False, inplace=False) + + return data.drop(['year', 'month', 'day', 'hour', 'minute', 'datetime'], axis=1)[start_date:end_date].assign(date=data['date'].apply(lambda x: str(x)[0:10])) + + elif if_fq in ['01', 'qfq']: + + xdxr_data = QA_fetch_get_stock_xdxr(code) + bfq_data = data.assign(date=pd.to_datetime(data['datetime'].apply(lambda x: str(x[0:10])))).assign(code=str(code))\ + .assign(date_stamp=data['datetime'].apply(lambda x: QA_util_date_stamp(str(x)[0:10]))).set_index('date', drop=False, inplace=False) + bfq_data = bfq_data.drop( + ['year', 'month', 'day', 'hour', 'minute', 'datetime'], axis=1) + # + if xdxr_data is not None: + info = xdxr_data[xdxr_data['category'] == 1] + bfq_data['if_trade'] = True + data = pd.concat([bfq_data, info[['category']] + [bfq_data.index[0]:]], axis=1) + + data['date'] = data.index + data['if_trade'].fillna(value=False, inplace=True) + data = data.fillna(method='ffill') + data = pd.concat([data, info[['fenhong', 'peigu', 'peigujia', + 'songzhuangu']][bfq_data.index[0]:]], axis=1) + data = data.fillna(0) + + data['preclose'] = (data['close'].shift(1) * 10 - data['fenhong'] + data['peigu'] + * data['peigujia']) / (10 + data['peigu'] + data['songzhuangu']) + data['adj'] = (data['preclose'].shift(-1) / + data['close']).fillna(1)[::-1].cumprod() + data['open'] = data['open'] * data['adj'] + data['high'] = data['high'] * data['adj'] + data['low'] = data['low'] * data['adj'] + data['close'] = data['close'] * data['adj'] + data['preclose'] = data['preclose'] * data['adj'] + + data = data[data['if_trade']] + return data.drop(['fenhong', 'peigu', 'peigujia', 'songzhuangu', 'if_trade', 'category'], axis=1)[data['open'] != 0].assign(date=data['date'].apply(lambda x: str(x)[0:10]))[start_date:end_date] + else: + + bfq_data['preclose'] = bfq_data['close'].shift(1) + bfq_data['adj'] = 1 + return bfq_data[start_date:end_date] + elif if_fq in ['03', 'ddqfq']: + xdxr_data = QA_fetch_get_stock_xdxr(code) + + info = xdxr_data[xdxr_data['category'] == 1] + + bfq_data = data\ + .assign(date=pd.to_datetime(data['datetime'].apply(lambda x: x[0:10])))\ + .assign(code=str(code))\ + .assign(date_stamp=data['datetime'].apply(lambda x: QA_util_date_stamp(str(x)[0:10])))\ + .set_index('date', drop=False, inplace=False)\ + .drop(['year', 'month', 'day', 'hour', + 'minute', 'datetime'], axis=1) + + bfq_data['if_trade'] = True + data = pd.concat([bfq_data, info[['category']] + [bfq_data.index[0]:end_date]], axis=1) + + data['date'] = data.index + data['if_trade'].fillna(value=False, inplace=True) + data = data.fillna(method='ffill') + data = pd.concat([data, info[['fenhong', 'peigu', 'peigujia', + 'songzhuangu']][bfq_data.index[0]:end_date]], axis=1) + data = data.fillna(0) + + data['preclose'] = (data['close'].shift(1) * 10 - data['fenhong'] + data['peigu'] + * data['peigujia']) / (10 + data['peigu'] + data['songzhuangu']) + data['adj'] = (data['preclose'].shift(-1) / + data['close']).fillna(1)[::-1].cumprod() + data['open'] = data['open'] * data['adj'] + data['high'] = data['high'] * data['adj'] + data['low'] = data['low'] * data['adj'] + data['close'] = data['close'] * data['adj'] + data['preclose'] = data['preclose'] * data['adj'] + + data = data[data['if_trade']] + return data.drop(['fenhong', 'peigu', 'peigujia', 'songzhuangu', 'if_trade', 'category'], axis=1)[data['open'] != 0].assign(date=data['date'].apply(lambda x: str(x)[0:10]))[start_date:end_date] + + elif if_fq in ['02', 'hfq']: + xdxr_data = QA_fetch_get_stock_xdxr(code) + + info = xdxr_data[xdxr_data['category'] == 1] + + bfq_data = data\ + .assign(date=pd.to_datetime(data['datetime'].apply(lambda x: x[0:10])))\ + .assign(code=str(code))\ + .assign(date_stamp=data['datetime'].apply(lambda x: QA_util_date_stamp(str(x)[0:10])))\ + .set_index('date', drop=False, inplace=False)\ + .drop(['year', 'month', 'day', 'hour', + 'minute', 'datetime'], axis=1) + + bfq_data['if_trade'] = True + data = pd.concat([bfq_data, info[['category']] + [bfq_data.index[0]:]], axis=1) + + data['date'] = data.index + data['if_trade'].fillna(value=False, inplace=True) + data = data.fillna(method='ffill') + data = pd.concat([data, info[['fenhong', 'peigu', 'peigujia', + 'songzhuangu']][bfq_data.index[0]:]], axis=1) + data = data.fillna(0) + + data['preclose'] = (data['close'].shift(1) * 10 - data['fenhong'] + data['peigu'] + * data['peigujia']) / (10 + data['peigu'] + data['songzhuangu']) + data['adj'] = (data['preclose'].shift(-1) / + data['close']).fillna(1).cumprod() + data['open'] = data['open'] / data['adj'] + data['high'] = data['high'] / data['adj'] + data['low'] = data['low'] / data['adj'] + data['close'] = data['close'] / data['adj'] + data['preclose'] = data['preclose'] / data['adj'] + data = data[data['if_trade']] + return data.drop(['fenhong', 'peigu', 'peigujia', 'songzhuangu', 'if_trade', 'category'], axis=1)[data['open'] != 0].assign(date=data['date'].apply(lambda x: str(x)[0:10]))[start_date:end_date] + + elif if_fq in ['04', 'ddhfq']: + xdxr_data = QA_fetch_get_stock_xdxr(code) + + info = xdxr_data[xdxr_data['category'] == 1] + + bfq_data = data\ + .assign(date=pd.to_datetime(data['datetime'].apply(lambda x: x[0:10])))\ + .assign(code=str(code))\ + .assign(date_stamp=data['datetime'].apply(lambda x: QA_util_date_stamp(str(x)[0:10])))\ + .set_index('date', drop=False, inplace=False)\ + .drop(['year', 'month', 'day', 'hour', + 'minute', 'datetime'], axis=1) + + bfq_data['if_trade'] = True + data = pd.concat([bfq_data, info[['category']] + [bfq_data.index[0]:end_date]], axis=1) + + data['date'] = data.index + data['if_trade'].fillna(value=False, inplace=True) + data = data.fillna(method='ffill') + data = pd.concat([data, info[['fenhong', 'peigu', 'peigujia', + 'songzhuangu']][bfq_data.index[0]:end_date]], axis=1) + data = data.fillna(0) + + data['preclose'] = (data['close'].shift(1) * 10 - data['fenhong'] + data['peigu'] + * data['peigujia']) / (10 + data['peigu'] + data['songzhuangu']) + data['adj'] = (data['preclose'].shift(-1) / + data['close']).fillna(1).cumprod() + data['open'] = data['open'] / data['adj'] + data['high'] = data['high'] / data['adj'] + data['low'] = data['low'] / data['adj'] + data['close'] = data['close'] / data['adj'] + data['preclose'] = data['preclose'] / data['adj'] + data = data[data['if_trade']] + return data.drop(['fenhong', 'peigu', 'peigujia', 'songzhuangu', 'if_trade', 'category'], axis=1)[data['open'] != 0].assign(date=data['date'].apply(lambda x: str(x)[0:10]))[start_date:end_date]
+ + +
[docs]def QA_fetch_get_stock_min(code, start, end, frequence='1min', ip=best_ip['stock']['ip'], port=best_ip['stock']['port']): + api = TdxHq_API() + type_ = '' + start_date = str(start)[0:10] + today_ = datetime.date.today() + lens = QA_util_get_trade_gap(start_date, today_) + if str(frequence) in ['5', '5m', '5min', 'five']: + frequence, type_ = 0, '5min' + lens = 48 * lens + elif str(frequence) in ['1', '1m', '1min', 'one']: + frequence, type_ = 8, '1min' + lens = 240 * lens + elif str(frequence) in ['15', '15m', '15min', 'fifteen']: + frequence, type_ = 1, '15min' + lens = 16 * lens + elif str(frequence) in ['30', '30m', '30min', 'half']: + frequence, type_ = 2, '30min' + lens = 8 * lens + elif str(frequence) in ['60', '60m', '60min', '1h']: + frequence, type_ = 3, '60min' + lens = 4 * lens + if lens > 20800: + lens = 20800 + with api.connect(ip, port): + + data = pd.concat([api.to_df(api.get_security_bars(frequence, _select_market_code( + str(code)), str(code), (int(lens / 800) - i) * 800, 800)) for i in range(int(lens / 800) + 1)], axis=0) + data = data\ + .assign(datetime=pd.to_datetime(data['datetime']), code=str(code))\ + .drop(['year', 'month', 'day', 'hour', 'minute'], axis=1, inplace=False)\ + .assign(date=data['datetime'].apply(lambda x: str(x)[0:10]))\ + .assign(date_stamp=data['datetime'].apply(lambda x: QA_util_date_stamp(x)))\ + .assign(time_stamp=data['datetime'].apply(lambda x: QA_util_time_stamp(x)))\ + .assign(type=type_).set_index('datetime', drop=False, inplace=False)[start:end] + return data.assign(datetime=data['datetime'].apply(lambda x: str(x)))
+ + +
[docs]def QA_fetch_get_stock_latest(code, ip=best_ip['stock']['ip'], port=best_ip['stock']['port']): + code = [code] if isinstance(code, str) else code + api = TdxHq_API(multithread=True) + with api.connect(ip, port): + data = pd.concat([api.to_df(api.get_security_bars( + 9, _select_market_code(item), item, 0, 1)).assign(code=item) for item in code], axis=0) + return data\ + .assign(date=pd.to_datetime(data['datetime'] + .apply(lambda x: x[0:10])), date_stamp=data['datetime'] + .apply(lambda x: QA_util_date_stamp(str(x[0:10]))))\ + .set_index('date', drop=False)\ + .drop(['year', 'month', 'day', 'hour', 'minute', 'datetime'], axis=1)
+ + +
[docs]def QA_fetch_get_stock_realtime(code=['000001', '000002'], ip=best_ip['stock']['ip'], port=best_ip['stock']['port']): + api = TdxHq_API() + __data = pd.DataFrame() + with api.connect(ip, port): + code = [code] if type(code) is str else code + for id_ in range(int(len(code) / 80) + 1): + __data = __data.append(api.to_df(api.get_security_quotes( + [(_select_market_code(x), x) for x in code[80 * id_:80 * (id_ + 1)]]))) + __data['datetime'] = datetime.datetime.now() + data = __data[['datetime', 'active1', 'active2', 'last_close', 'code', 'open', 'high', 'low', 'price', 'cur_vol', + 's_vol', 'b_vol', 'vol', 'ask1', 'ask_vol1', 'bid1', 'bid_vol1', 'ask2', 'ask_vol2', + 'bid2', 'bid_vol2', 'ask3', 'ask_vol3', 'bid3', 'bid_vol3', 'ask4', + 'ask_vol4', 'bid4', 'bid_vol4', 'ask5', 'ask_vol5', 'bid5', 'bid_vol5']] + return data.set_index('code', drop=False, inplace=False)
+ + +
[docs]def QA_fetch_depth_market_data(code=['000001', '000002'], ip=best_ip['stock']['ip'], port=best_ip['stock']['port']): + api = TdxHq_API() + __data = pd.DataFrame() + with api.connect(ip, port): + code = [code] if type(code) is str else code + for id_ in range(int(len(code) / 80) + 1): + __data = __data.append(api.to_df(api.get_security_quotes( + [(_select_market_code(x), x) for x in code[80 * id_:80 * (id_ + 1)]]))) + __data['datetime'] = datetime.datetime.now() + data = __data[['datetime', 'active1', 'active2', 'last_close', 'code', 'open', 'high', 'low', 'price', 'cur_vol', + 's_vol', 'b_vol', 'vol', 'ask1', 'ask_vol1', 'bid1', 'bid_vol1', 'ask2', 'ask_vol2', + 'bid2', 'bid_vol2', 'ask3', 'ask_vol3', 'bid3', 'bid_vol3', 'ask4', + 'ask_vol4', 'bid4', 'bid_vol4', 'ask5', 'ask_vol5', 'bid5', 'bid_vol5']] + return data.set_index(['datetime', 'code'], drop=False, inplace=False)
+ + +''' +沪市 +001×××国债现货; +110×××120×××企业债券; +129×××100×××可转换债券; +201×××国债回购; +310×××国债期货; +500×××550×××基金; + + +600×××A股; + +700×××配股; +710×××转配股; +701×××转配股再配股; +711×××转配股再转配股; +720×××红利; +730×××新股申购; +735×××新基金申购; +737×××新股配售; +900×××B股。 + +深市 +深市A股票买卖的代码是以000打头,如:顺鑫农业:股票代码是000860。 +B股买卖的代码是以200打头,如:深中冠B股,代码是200018。 +中小板股票代码以002打头,如:东华合创股票代码是002065。 +创业板股票代码以300打头,如:探路者股票代码是:300005 + + +更多参见 issue https://github.com/QUANTAXIS/QUANTAXIS/issues/158 +@yutiansut +''' + + +
[docs]def for_sz(code): + if str(code)[0:2] in ['00', '30', '02']: + return 'stock_cn' + elif str(code)[0:2] in ['39']: + return 'index_cn' + elif str(code)[0:2] in ['15']: + return 'etf_cn' + else: + return 'undefined'
+ + +
[docs]def for_sh(code): + if str(code)[0] == '6': + return 'stock_cn' + elif str(code)[0] == '0': + return 'index_cn' + elif str(code)[0:2] == '51': + return 'etf_cn' + else: + return 'undefined'
+ + +
[docs]def QA_fetch_get_stock_list(type_='stock', ip=best_ip['stock']['ip'], port=best_ip['stock']['port']): + + api = TdxHq_API() + with api.connect(ip, port): + data = pd.concat([pd.concat([api.to_df(api.get_security_list(j, i * 1000)).assign(sse='sz' if j == 0 else 'sh').set_index( + ['code', 'sse'], drop=False) for i in range(int(api.get_security_count(j) / 1000) + 1)], axis=0) for j in range(2)], axis=0) + #data.code = data.code.apply(int) + sz = data.query('sse=="sz"') + sh = data.query('sse=="sh"') + + sz = sz.assign(sec=sz.code.apply(for_sz)) + sh = sh.assign(sec=sh.code.apply(for_sh)) + + if type_ in ['stock', 'gp']: + + return pd.concat([sz, sh]).query('sec=="stock_cn"').sort_index().assign(name=data['name'].apply(lambda x: str(x)[0:6])) + + elif type_ in ['index', 'zs']: + + return pd.concat([sz, sh]).query('sec=="index_cn"').sort_index().assign(name=data['name'].apply(lambda x: str(x)[0:6])) + #.assign(szm=data['name'].apply(lambda x: ''.join([y[0] for y in lazy_pinyin(x)])))\ + #.assign(quanpin=data['name'].apply(lambda x: ''.join(lazy_pinyin(x)))) + elif type_ in ['etf', 'ETF']: + return pd.concat([sz, sh]).query('sec=="etf_cn"').sort_index().assign(name=data['name'].apply(lambda x: str(x)[0:6])) + + else: + return data.assign(code=data['code'].apply(lambda x: str(x))).assign(name=data['name'].apply(lambda x: str(x)[0:6]))
+ #.assign(szm=data['name'].apply(lambda x: ''.join([y[0] for y in lazy_pinyin(x)])))\ + # .assign(quanpin=data['name'].apply(lambda x: ''.join(lazy_pinyin(x)))) + + +
[docs]def QA_fetch_get_index_day(code, start_date, end_date, frequence='day', ip=best_ip['stock']['ip'], port=best_ip['stock']['port']): + '指数日线' + api = TdxHq_API() + if frequence in ['day', 'd', 'D', 'DAY', 'Day']: + frequence = 9 + elif frequence in ['w', 'W', 'Week', 'week']: + frequence = 5 + elif frequence in ['month', 'M', 'm', 'Month']: + frequence = 6 + elif frequence in ['Q', 'Quarter', 'q']: + frequence = 10 + elif frequence in ['y', 'Y', 'year', 'Year']: + frequence = 11 + + with api.connect(ip, port): + + start_date = str(start_date)[0:10] + today_ = datetime.date.today() + lens = QA_util_get_trade_gap(start_date, today_) + + if str(code)[0] in ['5', '1']: # ETF + data = pd.concat([api.to_df(api.get_security_bars( + frequence, 1 if str(code)[0] in ['0', '8', '9', '5'] else 0, code, (int(lens / 800) - i) * 800, 800)) for i in range(int(lens / 800) + 1)], axis=0) + else: + data = pd.concat([api.to_df(api.get_index_bars( + frequence, 1 if str(code)[0] in ['0', '8', '9', '5'] else 0, code, (int(lens / 800) - i) * 800, 800)) for i in range(int(lens / 800) + 1)], axis=0) + data = data.assign(date=data['datetime'].apply(lambda x: str(x[0:10]))).assign(code=str(code))\ + .assign(date_stamp=data['datetime'].apply(lambda x: QA_util_date_stamp(str(x)[0:10])))\ + .set_index('date', drop=False, inplace=False)\ + .assign(code=code)\ + .drop(['year', 'month', 'day', 'hour', + 'minute', 'datetime'], axis=1)[start_date:end_date] + return data.assign(date=data['date'].apply(lambda x: str(x)[0:10]))
+ + +
[docs]def QA_fetch_get_index_min(code, start, end, frequence='1min', ip=best_ip['stock']['ip'], port=best_ip['stock']['port']): + '指数分钟线' + api = TdxHq_API() + type_ = '' + + start_date = str(start)[0:10] + today_ = datetime.date.today() + lens = QA_util_get_trade_gap(start_date, today_) + if str(frequence) in ['5', '5m', '5min', 'five']: + frequence, type_ = 0, '5min' + lens = 48 * lens + elif str(frequence) in ['1', '1m', '1min', 'one']: + frequence, type_ = 8, '1min' + lens = 240 * lens + elif str(frequence) in ['15', '15m', '15min', 'fifteen']: + frequence, type_ = 1, '15min' + lens = 16 * lens + elif str(frequence) in ['30', '30m', '30min', 'half']: + frequence, type_ = 2, '30min' + lens = 8 * lens + elif str(frequence) in ['60', '60m', '60min', '1h']: + frequence, type_ = 3, '60min' + lens = 4 * lens + + if lens > 20800: + lens = 20800 + with api.connect(ip, port): + + if str(code)[0] in ['5', '1']: # ETF + data = pd.concat([api.to_df(api.get_security_bars( + frequence, 1 if str(code)[0] in ['0', '8', '9', '5'] else 0, code, (int(lens / 800) - i) * 800, 800)) for i in range(int(lens / 800) + 1)], axis=0) + else: + data = pd.concat([api.to_df(api.get_index_bars( + frequence, 1 if str(code)[0] in ['0', '8', '9', '5'] else 0, code, (int(lens / 800) - i) * 800, 800)) for i in range(int(lens / 800) + 1)], axis=0) + data = data\ + .assign(datetime=pd.to_datetime(data['datetime']), code=str(code))\ + .drop(['year', 'month', 'day', 'hour', 'minute'], axis=1, inplace=False)\ + .assign(code=code)\ + .assign(date=data['datetime'].apply(lambda x: str(x)[0:10]))\ + .assign(date_stamp=data['datetime'].apply(lambda x: QA_util_date_stamp(x)))\ + .assign(time_stamp=data['datetime'].apply(lambda x: QA_util_time_stamp(x)))\ + .assign(type=type_).set_index('datetime', drop=False, inplace=False)[start:end] + # data + return data.assign(datetime=data['datetime'].apply(lambda x: str(x)))
+ + +def __QA_fetch_get_stock_transaction(code, day, retry, api): + batch_size = 2000 # 800 or 2000 ? 2000 maybe also works + data_arr = [] + max_offset = 21 + cur_offset = 0 + while cur_offset <= max_offset: + one_chunk = api.get_history_transaction_data( + _select_market_code(str(code)), str(code), cur_offset * batch_size, batch_size, QA_util_date_str2int(day)) + if one_chunk is None or one_chunk == []: + break + data_arr = one_chunk + data_arr + cur_offset += 1 + data_ = api.to_df(data_arr) + + for _ in range(retry): + if len(data_) < 2: + return __QA_fetch_get_stock_transaction(code, day, 0, api) + else: + return data_.assign(date=day).assign(datetime=pd.to_datetime(data_['time'].apply(lambda x: str(day) + ' ' + x)))\ + .assign(code=str(code)).assign(order=range(len(data_.index))).set_index('datetime', drop=False, inplace=False) + + +
[docs]def QA_fetch_get_stock_transaction(code, start, end, retry=2, ip=best_ip['stock']['ip'], port=best_ip['stock']['port']): + '历史逐笔成交 buyorsell 1--sell 0--buy 2--盘前' + api = TdxHq_API() + + real_start, real_end = QA_util_get_real_datelist(start, end) + if real_start is None: + return None + real_id_range = [] + with api.connect(ip, port): + data = pd.DataFrame() + for index_ in range(trade_date_sse.index(real_start), trade_date_sse.index(real_end) + 1): + + try: + data_ = __QA_fetch_get_stock_transaction( + code, trade_date_sse[index_], retry, api) + if len(data_) < 1: + return None + except: + QA_util_log_info('Wrong in Getting %s history transaction data in day %s' % ( + code, trade_date_sse[index_])) + else: + QA_util_log_info('Successfully Getting %s history transaction data in day %s' % ( + code, trade_date_sse[index_])) + data = data.append(data_) + if len(data) > 0: + + return data.assign(datetime=data['datetime'].apply(lambda x: str(x)[0:19])) + else: + return None
+ + +
[docs]def QA_fetch_get_stock_transaction_realtime(code, ip=best_ip['stock']['ip'], port=best_ip['stock']['port']): + '实时逐笔成交 包含集合竞价 buyorsell 1--sell 0--buy 2--盘前' + api = TdxHq_API() + try: + with api.connect(ip, port): + data = pd.DataFrame() + data = pd.concat([api.to_df(api.get_transaction_data( + _select_market_code(str(code)), code, (2 - i) * 2000, 2000)) for i in range(3)], axis=0) + if 'value' in data.columns: + data = data.drop(['value'], axis=1) + data = data.dropna() + day = datetime.date.today() + return data.assign(date=str(day)).assign(datetime=pd.to_datetime(data['time'].apply(lambda x: str(day) + ' ' + str(x))))\ + .assign(code=str(code)).assign(order=range(len(data.index))).set_index('datetime', drop=False, inplace=False) + except: + return None
+ + +
[docs]def QA_fetch_get_stock_xdxr(code, ip=best_ip['stock']['ip'], port=best_ip['stock']['port']): + '除权除息' + api = TdxHq_API() + market_code = _select_market_code(code) + with api.connect(ip, port): + category = { + '1': '除权除息', '2': '送配股上市', '3': '非流通股上市', '4': '未知股本变动', '5': '股本变化', + '6': '增发新股', '7': '股份回购', '8': '增发新股上市', '9': '转配股上市', '10': '可转债上市', + '11': '扩缩股', '12': '非流通股缩股', '13': '送认购权证', '14': '送认沽权证'} + data = api.to_df(api.get_xdxr_info(market_code, code)) + if len(data) >= 1: + data = data\ + .assign(date=pd.to_datetime(data[['year', 'month', 'day']]))\ + .drop(['year', 'month', 'day'], axis=1)\ + .assign(category_meaning=data['category'].apply(lambda x: category[str(x)]))\ + .assign(code=str(code))\ + .rename(index=str, columns={'panhouliutong': 'liquidity_after', + 'panqianliutong': 'liquidity_before', 'houzongguben': 'shares_after', + 'qianzongguben': 'shares_before'})\ + .set_index('date', drop=False, inplace=False) + return data.assign(date=data['date'].apply(lambda x: str(x)[0:10])) + else: + return None
+ + +
[docs]def QA_fetch_get_stock_info(code, ip=best_ip['stock']['ip'], port=best_ip['stock']['port']): + '股票基本信息' + api = TdxHq_API() + market_code = _select_market_code(code) + with api.connect(ip, port): + return api.to_df(api.get_finance_info(market_code, code))
+ + +
[docs]def QA_fetch_get_stock_block(ip=best_ip['stock']['ip'], port=best_ip['stock']['port']): + '板块数据' + api = TdxHq_API() + with api.connect(ip, port): + + data = pd.concat([api.to_df(api.get_and_parse_block_info("block_gn.dat")).assign(type='gn'), + api.to_df(api.get_and_parse_block_info( + "block.dat")).assign(type='yb'), + api.to_df(api.get_and_parse_block_info( + "block_zs.dat")).assign(type='zs'), + api.to_df(api.get_and_parse_block_info("block_fg.dat")).assign(type='fg')]) + + if len(data) > 10: + return data.assign(source='tdx').drop(['block_type', 'code_index'], axis=1).set_index('code', drop=False, inplace=False).drop_duplicates() + else: + QA_util_log_info('Wrong with fetch block ')
+ + +""" +期货数据接口 + +1: 获取市场代码 +可以获取该api服务器可以使用的市场列表,类别等信息 +api.get_markets() +返回结果 api.to_df(api.get_markets()) 一般某个服务器返回的类型比较固定,该结果可以缓存到本地或者内存中。 +2017-07-31 21:22:06,067 - PYTDX - INFO - 获取市场代码 + market category name short_name +0 1 1 临时股 TP +1 4 12 郑州商品期权 OZ +2 5 12 大连商品期权 OD +3 6 12 上海商品期权 OS +4 8 12 上海个股期权 QQ +5 27 5 香港指数 FH +6 28 3 郑州商品 QZ +7 29 3 大连商品 QD +8 30 3 上海期货 QS +9 31 2 香港主板 KH +10 32 2 香港权证 KR +11 33 8 开放式基金 FU +12 34 9 货币型基金 FB +13 35 8 招商理财产品 LC +14 36 9 招商货币产品 LB +15 37 11 国际指数 FW +16 38 10 国内宏观指标 HG +17 40 11 中国概念股 CH +18 41 11 美股知名公司 MG +19 43 1 B股转H股 HB +20 44 1 股份转让 SB +21 47 3 股指期货 CZ +22 48 2 香港创业板 KG +23 49 2 香港信托基金 KT +24 54 6 国债预发行 GY +25 60 3 主力期货合约 MA +26 62 5 中证指数 ZZ +27 71 2 港股通 GH +2: 查询代码列表 +参数, 起始位置, 获取数量 +api.get_instrument_info(0, 100) +Demo: get_list_demo +3: 查询市场中商品数量 +api.get_instrument_count() +4: 查询五档行情 +参数 市场ID,证券代码 +市场ID可以通过 get_markets 获得 +api.get_instrument_quote(47, "IF1709") +5: 查询分时行情 +参数 市场ID,证券代码 +市场ID可以通过 get_markets 获得 +api.get_minute_time_data(47, "IF1709") +6: 查询历史分时行情 +参数 市场ID,证券代码,日期 +市场ID可以通过 get_markets 获得 +日期格式 YYYYMMDD 如 20170811 +api.get_history_minute_time_data(31, "00020", 20170811) +7: 查询k线数据 +参数: K线周期, 市场ID, 证券代码,起始位置, 数量 +K线周期参考 TDXParams +市场ID可以通过 get_markets 获得 +api.get_instrument_bars(TDXParams.KLINE_TYPE_DAILY, 8, "10000843", 0, 100) +8: 查询分笔成交 +参数:市场ID,证券代码 +市场ID可以通过 get_markets 获得 +api.get_transaction_data(31, "00020") +注意,这个接口最多返回1800条记录, 如果有超过1800条记录的请求,我们有一个start 参数作为便宜量,可以取出超过1800条记录 +如期货的数据:这个接口可以取出1800条之前的记录,数量也是1800条 +api.get_history_transaction_data(47, "IFL0", 20170810, start=1800) +9: 查询历史分笔成交 +参数:市场ID,证券代码, 日期 +市场ID可以通过 get_markets 获得 +日期格式 YYYYMMDD 如 20170810 +api.get_history_transaction_data(31, "00020", 20170810) + +""" +""" +期货及扩展行情 + +首先会初始化/存储一个代码对应表 extension_market_info + +""" + + +
[docs]def QA_fetch_get_future_list(ip=best_ip['future']['ip'], port=best_ip['future']['port']): + '期货代码list' + apix = TdxExHq_API() + with apix.connect(ip, port): + market_info = apix.get_markets() + num = apix.get_instrument_count() + return pd.concat([apix.to_df( + apix.get_instrument_info((int(num / 500) - i) * 500, 500)) + for i in range(int(num / 500) + 1)], axis=0).set_index('code', drop=False)
+ + +global extension_market_info +extension_market_info = None + + +
[docs]def QA_fetch_get_future_day(code, start_date, end_date, frequence='day', ip=best_ip['future']['ip'], port=best_ip['future']['port']): + '期货数据 日线' + + apix = TdxExHq_API() + start_date = str(start_date)[0:10] + today_ = datetime.date.today() + lens = QA_util_get_trade_gap(start_date, today_) + global extension_market_info + extension_market_info = QA_fetch_get_future_list( + ) if extension_market_info is None else extension_market_info + + with apix.connect(ip, port): + code_market = extension_market_info.query('code=="{}"'.format(code)) + + data = pd.concat([apix.to_df(apix.get_instrument_bars(_select_type( + frequence), int(code_market.market), str(code), (int(lens / 700) - i) * 700, 700))for i in range(int(lens / 700) + 1)], axis=0) + data = data.assign(date=data['datetime'].apply(lambda x: str(x[0:10]))).assign(code=str(code))\ + .assign(date_stamp=data['datetime'].apply(lambda x: QA_util_date_stamp(str(x)[0:10]))).set_index('date', drop=False, inplace=False) + + return data.drop(['year', 'month', 'day', 'hour', 'minute', 'datetime'], axis=1)[start_date:end_date].assign(date=data['date'].apply(lambda x: str(x)[0:10]))
+ + +
[docs]def QA_fetch_get_future_min(code, start, end, frequence='1min', ip=best_ip['future']['ip'], port=best_ip['future']['port']): + '期货数据 分钟线' + apix = TdxExHq_API() + type_ = '' + start_date = str(start)[0:10] + today_ = datetime.date.today() + lens = QA_util_get_trade_gap(start_date, today_) + global extension_market_info + extension_market_info = QA_fetch_get_future_list( + ) if extension_market_info is None else extension_market_info + + if str(frequence) in ['5', '5m', '5min', 'five']: + frequence, type_ = 0, '5min' + lens = 48 * lens + elif str(frequence) in ['1', '1m', '1min', 'one']: + frequence, type_ = 8, '1min' + lens = 240 * lens + elif str(frequence) in ['15', '15m', '15min', 'fifteen']: + frequence, type_ = 1, '15min' + lens = 16 * lens + elif str(frequence) in ['30', '30m', '30min', 'half']: + frequence, type_ = 2, '30min' + lens = 8 * lens + elif str(frequence) in ['60', '60m', '60min', '1h']: + frequence, type_ = 3, '60min' + lens = 4 * lens + if lens > 20800: + lens = 20800 + with apix.connect(ip, port): + code_market = extension_market_info.query('code=="{}"'.format(code)) + data = pd.concat([apix.to_df(apix.get_instrument_bars(frequence, int(code_market.market), str( + code), (int(lens / 700) - i) * 700, 700)) for i in range(int(lens / 700) + 1)], axis=0) + + data = data\ + .assign(datetime=pd.to_datetime(data['datetime']), code=str(code))\ + .drop(['year', 'month', 'day', 'hour', 'minute'], axis=1, inplace=False)\ + .assign(date=data['datetime'].apply(lambda x: str(x)[0:10]))\ + .assign(date_stamp=data['datetime'].apply(lambda x: QA_util_date_stamp(x)))\ + .assign(time_stamp=data['datetime'].apply(lambda x: QA_util_time_stamp(x)))\ + .assign(type=type_).set_index('datetime', drop=False, inplace=False)[start:end] + return data.assign(datetime=data['datetime'].apply(lambda x: str(x)))
+ + +
[docs]def QA_fetch_get_future_transaction(ip=best_ip['future']['ip'], port=best_ip['future']['port']): + '期货历史成交分笔' + apix = TdxExHq_API() + with apix.connect(ip, port): + pass
+ + +
[docs]def QA_fetch_get_future_transaction_realtime(ip=best_ip['future']['ip'], port=best_ip['future']['port']): + '期货历史成交分笔' + apix = TdxExHq_API() + with apix.connect(ip, port): + pass
+ + +
[docs]def QA_fetch_get_future_realtime(code, ip=best_ip['future']['ip'], port=best_ip['future']['port']): + '期货实时价格' + pass
+ + +
[docs]def QA_fetch_get_wholemarket_list(): + hq_codelist = QA_fetch_get_stock_list( + type_='all').loc[:, ['code', 'name']].set_index(['code', 'name'], drop=False) + kz_codelist = QA_fetch_get_future_list().loc[:, ['code', 'name']].set_index([ + 'code', 'name'], drop=False) + + return pd.concat([hq_codelist, kz_codelist]).sort_index()
+ + +if __name__ == '__main__': + # print(QA_fetch_get_stock_day('000001','2017-07-03','2017-07-10')) + # print(QA_fetch_get_stock_day('000001', '2013-07-01', '2013-07-09')) + print(QA_fetch_get_stock_realtime('000001')) + #print(QA_fetch_get_index_day('000001', '2017-01-01', '2017-07-01')) + # print(QA_fetch_get_stock_transaction('000001', '2017-07-03', '2017-07-10')) + + print(QA_fetch_get_stock_info('600116')) +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAFetch/QATdx_adv.html b/_build/html/_modules/QUANTAXIS/QAFetch/QATdx_adv.html new file mode 100644 index 000000000..520ad078e --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAFetch/QATdx_adv.html @@ -0,0 +1,420 @@ + + + + + + + + QUANTAXIS.QAFetch.QATdx_adv — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAFetch.QATdx_adv

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+
+import datetime
+import queue
+import time
+from concurrent.futures import ThreadPoolExecutor
+from threading import Thread, Timer
+
+import pandas as pd
+from pytdx.hq import TdxHq_API
+
+from QUANTAXIS.QAUtil.QADate_trade import QA_util_if_tradetime
+from QUANTAXIS.QAUtil.QASetting import DATABASE, stock_ip_list
+from QUANTAXIS.QAUtil.QASql import QA_util_sql_mongo_sort_ASCENDING
+from QUANTAXIS.QAUtil.QATransform import QA_util_to_json_from_pandas
+
+
+"""
+准备做一个多连接的连接池执行器Executor
+当持续获取数据/批量数据的时候,可以减小服务器的压力,并且可以更快的进行并行处理
+"""
+
+
+
[docs]class QA_Tdx_Executor(): + def __init__(self, thread_num=2, *args, **kwargs): + self.thread_num = thread_num + self._queue = queue.Queue(maxsize=200) + self.api_no_connection = TdxHq_API() + self._api_worker = Thread( + target=self.api_worker, args=(), name='API Worker') + self._api_worker.start() + + self.executor = ThreadPoolExecutor(self.thread_num) + + def __getattr__(self, item): + try: + api = self.get_available() + func = api.__getattribute__(item) + + def wrapper(*args, **kwargs): + res = self.executor.submit(func, *args, **kwargs) + self._queue.put(api) + return res + return wrapper + except: + return self.__getattr__(item) + + def _queue_clean(self): + self._queue = queue.Queue(maxsize=200) + + def _test_speed(self, ip, port=7709): + + api = TdxHq_API(raise_exception=True, auto_retry=False) + _time = datetime.datetime.now() + try: + with api.connect(ip, port, time_out=0.05): + if len(api.get_security_list(0, 1)) > 800: + return (datetime.datetime.now() - _time).total_seconds() + else: + return datetime.timedelta(9, 9, 0).total_seconds() + except Exception as e: + return datetime.timedelta(9, 9, 0).total_seconds() + +
[docs] def get_market(self, code): + code = str(code) + if code[0] in ['5', '6', '9'] or code[:3] in ["009", "126", "110", "201", "202", "203", "204"]: + return 1 + return 0
+ +
[docs] def get_frequence(self, frequence): + if frequence in ['day', 'd', 'D', 'DAY', 'Day']: + frequence = 9 + elif frequence in ['w', 'W', 'Week', 'week']: + frequence = 5 + elif frequence in ['month', 'M', 'm', 'Month']: + frequence = 6 + elif frequence in ['Q', 'Quarter', 'q']: + frequence = 10 + elif frequence in ['y', 'Y', 'year', 'Year']: + frequence = 11 + elif str(frequence) in ['5', '5m', '5min', 'five']: + frequence = 0 + elif str(frequence) in ['1', '1m', '1min', 'one']: + frequence = 8 + elif str(frequence) in ['15', '15m', '15min', 'fifteen']: + frequence = 1 + elif str(frequence) in ['30', '30m', '30min', 'half']: + frequence = 2 + elif str(frequence) in ['60', '60m', '60min', '1h']: + frequence = 3 + + return frequence
+ + @property + def ipsize(self): + return len(self._queue.qsize()) + + @property + def api(self): + return self.get_available() + +
[docs] def get_available(self): + + if self._queue.empty() is False: + return self._queue.get_nowait() + else: + Timer(0, self.api_worker).start() + return self._queue.get()
+ +
[docs] def api_worker(self): + data = [] + if self._queue.qsize() < 80: + for item in stock_ip_list: + _sec = self._test_speed(ip=item['ip'], port=item['port']) + if _sec < 0.1: + try: + self._queue.put(TdxHq_API(heartbeat=False).connect( + ip=item['ip'], port=item['port'], time_out=0.05)) + except: + pass + else: + self._queue_clean() + Timer(0, self.api_worker).start() + Timer(300, self.api_worker).start()
+ + def _singal_job(self, context, id_, time_out=0.5): + try: + _api = self.get_available() + + __data = context.append(self.api_no_connection.to_df(_api.get_security_quotes( + [(self._select_market_code(x), x) for x in code[80 * id_:80 * (id_ + 1)]]))) + __data['datetime'] = datetime.datetime.now() + self._queue.put(_api) # 加入注销 + return __data + except: + return self.singal_job(context, id_) + +
[docs] def get_realtime(self, code): + context = pd.DataFrame() + + code = [code] if type(code) is str else code + try: + for id_ in range(int(len(code) / 80) + 1): + context = self._singal_job(context, id_) + + data = context[['datetime', 'last_close', 'code', 'open', 'high', 'low', 'price', 'cur_vol', + 's_vol', 'b_vol', 'vol', 'ask1', 'ask_vol1', 'bid1', 'bid_vol1', 'ask2', 'ask_vol2', + 'bid2', 'bid_vol2', 'ask3', 'ask_vol3', 'bid3', 'bid_vol3', 'ask4', + 'ask_vol4', 'bid4', 'bid_vol4', 'ask5', 'ask_vol5', 'bid5', 'bid_vol5']] + data['datetime'] = data['datetime'].apply(lambda x: str(x)) + return data.set_index('code', drop=False, inplace=False) + except: + return None
+ +
[docs] def get_realtime_concurrent(self, code): + code = [code] if type(code) is str else code + + try: + data = {self.get_security_quotes([(self.get_market( + x), x) for x in code[80 * pos:80 * (pos + 1)]]) for pos in range(int(len(code) / 80) + 1)} + return (pd.concat([self.api_no_connection.to_df(i.result()) for i in data]), datetime.datetime.now()) + except: + pass
+ +
[docs] def get_security_bar_concurrent(self, code, _type, lens): + try: + + data = {self.get_security_bars(self.get_frequence(_type), self.get_market( + str(code)), str(code), 0, lens) for code in code} + + return [i.result() for i in data] + + except: + raise Exception
+ + def _get_security_bars(self, context, code, _type, lens): + try: + _api = self.get_available() + for i in range(1, int(lens / 800) + 2): + context.extend(_api.get_security_bars(self.get_frequence( + _type), self.get_market(str(code)), str(code), (i - 1) * 800, 800)) + print(context) + self._queue.put(_api) + return context + except Exception as e: + return self._get_security_bars(context, code, _type, lens) + +
[docs] def get_security_bar(self, code, _type, lens): + code = [code] if type(code) is str else code + context = [] + try: + for item in code: + context = self._get_security_bars(context, item, _type, lens) + return context + except Exception as e: + raise e
+ +
[docs] def save_mongo(self, data, client=DATABASE): + database = DATABASE.get_collection( + 'realtime_{}'.format(datetime.date.today())) + + database.insert_many(QA_util_to_json_from_pandas(data))
+ + +
[docs]def get_bar(): + + _time1 = datetime.datetime.now() + from QUANTAXIS.QAFetch.QAQuery_Advance import QA_fetch_stock_block_adv + code = QA_fetch_stock_block_adv().code + print(len(code)) + x = QA_Tdx_Executor() + print(x._queue.qsize()) + print(x.get_available()) + + while True: + _time = datetime.datetime.now() + if QA_util_if_tradetime(_time): # 如果在交易时间 + data = x.get_security_bar_concurrent(code, 'day', 1) + + print('Time {}'.format( + (datetime.datetime.now() - _time).total_seconds())) + time.sleep(1) + print('Connection Pool NOW LEFT {} Available IP'.format( + x._queue.qsize())) + print('Program Last Time {}'.format( + (datetime.datetime.now() - _time1).total_seconds())) + + return data + else: + print('Not Trading time {}'.format(_time)) + time.sleep(1)
+ + +
[docs]def get_day_once(): + + _time1 = datetime.datetime.now() + from QUANTAXIS.QAFetch.QAQuery_Advance import QA_fetch_stock_block_adv + code = QA_fetch_stock_block_adv().code + x = QA_Tdx_Executor() + return x.get_security_bar_concurrent(code, 'day', 1)
+ + +
[docs]def bat(): + + _time1 = datetime.datetime.now() + from QUANTAXIS.QAFetch.QAQuery_Advance import QA_fetch_stock_block_adv + code = QA_fetch_stock_block_adv().code + print(len(code)) + x = QA_Tdx_Executor() + print(x._queue.qsize()) + print(x.get_available()) + + database = DATABASE.get_collection( + 'realtime_{}'.format(datetime.date.today())) + + print(database) + database.create_index([('code', QA_util_sql_mongo_sort_ASCENDING), + ('datetime', QA_util_sql_mongo_sort_ASCENDING)]) + + for i in range(100000): + _time = datetime.datetime.now() + if QA_util_if_tradetime(_time): # 如果在交易时间 + data = x.get_realtime_concurrent(code) + + data[0]['datetime'] = data[1] + x.save_mongo(data[0]) + + print('Time {}'.format( + (datetime.datetime.now() - _time).total_seconds())) + time.sleep(1) + print('Connection Pool NOW LEFT {} Available IP'.format( + x._queue.qsize())) + print('Program Last Time {}'.format( + (datetime.datetime.now() - _time1).total_seconds())) + else: + print('Not Trading time {}'.format(_time)) + time.sleep(1)
+ + +if __name__ == '__main__': + import time + _time1 = datetime.datetime.now() + from QUANTAXIS.QAFetch.QAQuery_Advance import QA_fetch_stock_block_adv + code = QA_fetch_stock_block_adv().code + + DATABASE.realtime.create_index([('code', QA_util_sql_mongo_sort_ASCENDING), + ('datetime', QA_util_sql_mongo_sort_ASCENDING)]) + + # print(len(code)) + # x = QA_Tdx_Executor() + # print(x._queue.qsize()) + # print(x.get_available()) + # #data = x.get_security_bars(code[0], '15min', 20) + # # print(data) + # # for i in range(5): + # # print(x.get_realtime_concurrent(code)) + + # for i in range(100000): + # _time = datetime.datetime.now() + # if QA_util_if_tradetime(_time): # 如果在交易时间 + # #data = x.get_realtime(code) + # data = x.get_realtime_concurrent(code) + + # data[0]['datetime'] = data[1] + # x.save_mongo(data[0]) + # # print(code[0]) + # #data = x.get_security_bars(code, '15min', 20) + # # if data is not None: + # print(len(data[0])) + # # print(data) + # print('Time {}'.format((datetime.datetime.now() - _time).total_seconds())) + # time.sleep(1) + # print('Connection Pool NOW LEFT {} Available IP'.format(x._queue.qsize())) + # print('Program Last Time {}'.format( + # (datetime.datetime.now() - _time1).total_seconds())) + # # print(threading.enumerate()) + # # +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAFetch/QAThs.html b/_build/html/_modules/QUANTAXIS/QAFetch/QAThs.html new file mode 100644 index 000000000..0f879df52 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAFetch/QAThs.html @@ -0,0 +1,185 @@ + + + + + + + + QUANTAXIS.QAFetch.QAThs — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAFetch.QAThs

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+import numpy as np
+import pandas as pd
+import requests
+from lxml import etree
+from QUANTAXIS.QAFetch.base import headers
+
+
+headers_ths = headers
+headers_ths['Referer'] = 'http://www.10jqka.com.cn/'
+headers_ths['Host'] = 'q.10jqka.com.cn'
+headers_data = headers_ths
+headers_data['X-Requested-With'] = 'XMLHttpRequest'
+
+
+
[docs]def QA_fetch_get_stock_day_in_year(code, year, if_fq='00'): + data_ = [] + url = 'http://d.10jqka.com.cn/v2/line/hs_%s/%s/%s.js' % ( + str(code), str(if_fq), str(year)) + try: + for item in requests.get(url).text.split('\"')[3].split(';'): + data_.append(item.split(',')) + + data = pd.DataFrame(data_, index=list(np.asarray(data_).T[0]), columns=[ + 'date', 'open', 'high', 'low', 'close', 'volume', 'amount', 'factor']) + data['date'] = pd.to_datetime(data['date']) + data = data.set_index('date') + return data + except: + pass
+ + +
[docs]def QA_fetch_get_stock_day(code, start, end, if_fq='00'): + start_year = int(str(start)[0:4]) + end_year = int(str(end)[0:4]) + data = QA_fetch_get_stock_day_in_year(code, start_year, if_fq) + if start_year < end_year: + for i2 in range(start_year + 1, end_year + 1): + data = pd.concat( + [data, QA_fetch_get_stock_day_in_year(code, i2, if_fq)], axis=0) + else: + pass + if data is None: + return pd.DataFrame() + else: + return data[start:end]
+ + +
[docs]def QA_fetch_get_stock_block(): + pass
+ # url_list = ['gn', 'dy', 'thshy', 'zjhhy'] # 概念/地域/同花顺板块/证监会板块 + # data = [] + # cookie=input('cookie') + # for item in url_list: + # tree = etree.HTML(requests.get( + # 'http://q.10jqka.com.cn/{}/'.format(item), headers=headers_ths).text) + # gn = tree.xpath('/html/body/div/div/div/div/div/a/text()') + # gpath = tree.xpath('/html/body/div/div/div/div/div/a/@href') + # headers_data['cookie']=cookie + # for r in range(len(gn)): + # headers_data['Referer'] = 'http://q.10jqka.com.cn/{}/detail/code/{}'.format( + # item, gpath[r].split('/')[-2]) + + # for i in range(1, 15): + + # _data = etree.HTML(requests.get( + # 'http://q.10jqka.com.cn/{}/detail/order/desc/page/{}/ajax/1/code/{}'.format(item, i, gpath[r].split('/')[-2]), headers=headers_data).text) + # name = _data.xpath('/html/body/table/tbody/tr/td[3]/a/text()') + # code = _data.xpath('/html/body/table/tbody/tr/td[3]/a/@href') + + # for i2 in range(len(name)): + # print( + # 'Now Crawling-{}-{}-{}-{}'.format(gn[r], code[i2].split('/')[-1], item, 'ths')) + # data.append([gn[r], code[i2].split('/')[-1], item, 'ths']) + + # return pd.DataFrame(data, columns=['blockname', 'code', 'type', 'source']).set_index('code', drop=False) + + +if __name__ == '__main__': + # print(get_k_data_year('000001','2016','01')) + # print(get_k_data_year(600010,2016,'01')) + print(QA_fetch_get_stock_day('000001', '2016-05-01', '2017-07-01', '01')) +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAFetch/QATushare.html b/_build/html/_modules/QUANTAXIS/QAFetch/QATushare.html new file mode 100644 index 000000000..8ddf1e1a4 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAFetch/QATushare.html @@ -0,0 +1,191 @@ + + + + + + + + QUANTAXIS.QAFetch.QATushare — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAFetch.QATushare

+# coding: utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+import json
+
+import pandas as pd
+import tushare as QATs
+
+from QUANTAXIS.QAUtil import (QA_util_date_int2str, QA_util_date_stamp,
+                              QA_util_log_info, QA_util_to_json_from_pandas)
+
+
+
[docs]def QA_fetch_get_stock_day(name, start='', end='', if_fq='01', type_='json'): + if (len(name) != 6): + name = str(name)[0:6] + + if str(if_fq) in ['qfq', '01']: + if_fq = 'qfq' + elif str(if_fq) in ['hfq', '02']: + if_fq = 'hfq' + elif str(if_fq) in ['bfq', '00']: + if_fq = 'bfq' + else: + QA_util_log_info('wrong with fq_factor! using qfq') + if_fq = 'qfq' + + data = QATs.get_k_data(str(name), start, end, + ktype='D', autype=if_fq, retry_count=200, pause=0.005).sort_index() + + data['date_stamp'] = data['date'].apply(lambda x: QA_util_date_stamp(x)) + data['fqtype'] = if_fq + if type_ in ['json']: + data_json = QA_util_to_json_from_pandas(data) + return data_json + elif type_ in ['pd', 'pandas', 'p']: + data['date'] = pd.to_datetime(data['date']) + data = data.set_index('date', drop=False) + data['date'] = data['date'].apply(lambda x: str(x)[0:10]) + return data
+ + +
[docs]def QA_fetch_get_stock_realtime(): + data = QATs.get_today_all() + data_json = QA_util_to_json_from_pandas(data) + return data_json
+ + +
[docs]def QA_fetch_get_stock_info(name): + data = QATs.get_stock_basics() + data_json = QA_util_to_json_from_pandas(data) + + for i in range(0, len(data_json) - 1, 1): + data_json[i]['code'] = data.index[i] + return data_json
+ + +
[docs]def QA_fetch_get_stock_tick(name, date): + if (len(name) != 6): + name = str(name)[0:6] + return QATs.get_tick_data(name, date)
+ + +
[docs]def QA_fetch_get_stock_list(): + df = QATs.get_stock_basics() + return list(df.index)
+ + +
[docs]def QA_fetch_get_stock_time_to_market(): + data = QATs.get_stock_basics() + return data[data['timeToMarket'] != 0]['timeToMarket'].apply(lambda x: QA_util_date_int2str(x))
+ + +
[docs]def QA_fetch_get_trade_date(end, exchange): + data = QATs.trade_cal() + da = data[data.isOpen > 0] + data_json = QA_util_to_json_from_pandas(data) + message = [] + for i in range(0, len(data_json) - 1, 1): + date = data_json[i]['calendarDate'] + num = i + 1 + exchangeName = 'SSE' + data_stamp = QA_util_date_stamp(date) + mes = {'date': date, 'num': num, + 'exchangeName': exchangeName, 'date_stamp': data_stamp} + message.append(mes) + return message
+# test + +# print(get_stock_day("000001",'2001-01-01','2010-01-01')) +# print(get_stock_tick("000001.SZ","2017-02-21")) +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAFetch/QAWind.html b/_build/html/_modules/QUANTAXIS/QAFetch/QAWind.html new file mode 100644 index 000000000..6fe96f818 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAFetch/QAWind.html @@ -0,0 +1,347 @@ + + + + + + + + QUANTAXIS.QAFetch.QAWind — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAFetch.QAWind

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+"""
+QAWind
+
+QAWind is a data fetch module just for WIND Institution Version
+
+QAWind is under the [QAStandard#0.0.2 @101-1],[QAStandard#0.0.2 @501-0] protocol
+
+@author: yutiansut
+
+@last modified:2017/4/5
+"""
+import datetime
+import re
+import time
+
+import numpy as np
+import pandas as pd
+import pymongo
+
+from QUANTAXIS.QAUtil import QA_util_date_valid, QA_util_log_info
+
+from QUANTAXIS.QAFetch import data_list as data_list
+
+
+
[docs]def QA_fetch_get_stock_info(name, startDate, endDate): + try: + from WindPy import w + except: + QA_util_log_info('No WindPY Module!') + w.start() + # get the all stock list on the endDate + # judge the vaild date + if(QA_util_date_valid(endDate) is False): + QA_util_log_info("wrong date") + else: + # tempStr='date='+endDate+";sectorid=a001010100000000" + # data=w.wset("sectorconstituent",tempStr) + data = w.wsd(name, "sec_name,sec_englishname,ipo_date,exch_city,mkt,\ + sec_status,delist_date,issuecurrencycode,curr,RO,parvalue,\ + lotsize,tunit,exch_eng,country,concept,marginornot,SHSC,\ + parallelcode,sec_type,backdoor,backdoordate,windtype", + startDate, endDate) + # QA_util_log_info(data) + if (data.ErrorCode != 0): + QA_util_log_info("Connent to Wind successfully") + return data.Data
+ + +
[docs]def QA_fetch_get_stock_day(name, startDate, endDate, if_fq='01'): + try: + from WindPy import w + except: + QA_util_log_info('No WindPY Module!') + w.start() + if(QA_util_date_valid(endDate) == False): + QA_util_log_info("wrong date") + else: + if if_fq in ['00', 'bfq']: + data = w.wsd(name, "sec_name,pre_close,open,high,low,close,volume", + startDate, endDate) + elif if_fq in ['01', 'qfq']: + data = w.wsd(name, "sec_name,pre_close,open,high,low,close,volume", + startDate, endDate, "PriceAdj=F") + elif if_fq in ['02', 'hfq']: + data = w.wsd(name, "sec_name,pre_close,open,high,low,close,volume", + startDate, endDate, "PriceAdj=B") + else: + QA_util_log_info('wrong fq factor! using qfq') + data = w.wsd(name, "sec_name,pre_close,open,high,low,close,volume", + startDate, endDate, "PriceAdj=B") + if (data.ErrorCode == 0): + QA_util_log_info("Connent to Wind successfully") + + return pd.DataFrame(np.asarray(data.Data).T, columns=data.Fields, index=data.Times)
+ + +
[docs]def QA_fetch_get_stock_day_simple(name, startDate, endDate): + try: + from WindPy import w + except: + QA_util_log_info('No WindPY Module!') + w.start() + if(QA_util_date_valid(endDate) == False): + QA_util_log_info("wrong date") + else: + data = w.wsd(name, "sec_name,preclose,open,high,low,close,volume", + startDate, endDate, "Fill=Previous;PriceAdj=F") + #data=w.wsd("000002.SZ", "open,high,low,close,volume", "2017-03-03", "2017-04-01", "PriceAdj=B") + QA_util_log_info(data.ErrorCode) + if (data.ErrorCode == 0): + QA_util_log_info("Connent to Wind successfully") + return data.Data
+ + +
[docs]def QA_fetch_get_stock_indicator(name, startDate, endDate): + try: + from WindPy import w + except: + QA_util_log_info('No WindPY Module!') + w.start() + if(QA_util_date_valid(endDate) == False): + QA_util_log_info("wrong date") + else: + # ADTM动态买卖气指标,ATR真实波幅,BBI多空指数,BBIBOLL多空布林线,BIAS乖离率,BOLL布林带,CCI顺势指标,CDP逆势操作,DMA平均线差, + # DMI趋向标准,DPO区间震荡线,ENV,EXPMA指数平滑移动平均,KDJ随机指标,slowKD慢速kd,MA简单移动平均,MACD指数平滑移动平均,MIKE麦克指数, + # MTM动力指标,PRICEOSC价格震荡指标,PVT量价趋势指标,RC变化率指数,ROC变动速率,RSI相对强弱指标,SAR抛物转向,SI摆动指标,SOBV能量潮, + # SRMI MI修正指标,STD 标准差,TAPI 加权指数成交值,TRIX 三重指数平滑平均,VHF纵横指标,VMA量简单移动平均,VMACD量指数平滑移动平均, + # VOSC成交量震荡,WVAD威廉变异离散量,vol_ratio量比 + data = w.wsd(name, "ADTM,ATR,BBI,BBIBOLL,BIAS,BOLL,CCI,CDP,\ + DMA,DMI,DPO,ENV,EXPMA,KDJ,slowKD,MA,MACD,\ + MIKE,MTM,PRICEOSC,PVT,RC,ROC,RSI,SAR,SI,\ + SOBV,SRMI,STD,TAPI,TRIX,VHF,VMA,VMACD,VOSC,\ + WVAD,vol_ratio", startDate, endDate, + "ADTM_N1=23;ADTM_N2=8;ADTM_IO=1;ATR_N=14;ATR_IO=1;\ + BBI_N1=3;BBI_N2=6;BBI_N3=12;BBI_N4=24;BBIBOLL_N=10;\ + BBIBOLL_Width=3;BBIBOLL_IO=1;BIAS_N=12;BOLL_N=26;\ + BOLL_Width=2;BOLL_IO=1;CCI_N=14;CDP_IO=1;DMA_S=10;\ + DMA_L=50;DMA_N=10;DMA_IO=1;DMI_N=14;DMI_N1=6;\ + DMI_IO=1;DPO_N=20;DPO_M=6;DPO_IO=1;ENV_N=14;ENV_IO=1;\ + EXPMA_N=12;KDJ_N=9;KDJ_M1=3;KDJ_M2=3;KDJ_IO=1;SlowKD_N1=9;\ + SlowKD_N2=3;SlowKD_N3=3;SlowKD_N4=5;SlowKD_IO=1;MA_N=5;\ + MACD_L=26;MACD_S=12;MACD_N=9;MACD_IO=1;MIKE_N=12;MIKE_IO=1;\ + MTM_interDay=6;MTM_N=6;MTM_IO=1;PRICEOSC_L=26;PRICEOSC_S=12;\ + RC_N=50;ROC_interDay=12;ROC_N=6;ROC_IO=1;RSI_N=6;SAR_N=4;\ + SAR_SP=2;SAR_MP=20;SRMI_N=9;STD_N=26;TAPI_N=6;TAPI_IO=1;\ + TRIX_N1=12;TRIX_N2=20;TRIX_IO=1;VHF_N=28;VMA_N=5;VMACD_S=12;\ + VMACD_L=26;VMACD_N=9;VMACD_IO=1;VOSC_S=12;VOSC_L=26;WVAD_N1=24;\ + WVAD_N2=6;WVAD_IO=1;VolumeRatio_N=5") + if (data.ErrorCode == 0): + QA_util_log_info("Connent to Wind successfully") + return pd.DataFrame(np.asarray(data.Data).T, columns=data.Fields, index=data.Times)
+ + +
[docs]def QA_fetch_get_stock_shape(name, startDate, endDate): + try: + from WindPy import w + except: + QA_util_log_info('No WindPY Module!') + w.start() + if(QA_util_date_valid(endDate) == False): + QA_util_log_info("wrong date") + else: + # history_low近期创历史新低,stage_high近期创阶段新高,history_high近期创历史新高,stage_low近期创阶段新高,up_days连涨天数,down_days连跌天数,breakout_ma向上有效突破均线,breakdown_ma向下有效突破均线,bull_bear_ma均线多空排列看涨看跌 + data = w.wsd(name, "history_low,stage_high,history_high,stage_low,up_days,down_days,breakout_ma,breakdown_ma,bull_bear_ma", + startDate, endDate, "n=3;m=60;meanLine=60;N1=5;N2=10;N3=20;N4=30;upOrLow=1") + if (data.ErrorCode == 0): + QA_util_log_info("Connent to Wind successfully") + return pd.DataFrame(np.asarray(data.Data).T, columns=data.Fields, index=data.Times)
+ + +
[docs]def QA_fetch_get_stock_risk(name, startDate, endDate): + try: + from WindPy import w + except: + QA_util_log_info('No WindPY Module!') + w.start() + if(QA_util_date_valid(endDate) == False): + QA_util_log_info("wrong date") + else: + data = w.wsd(name, "annualyeild_100w,annualyeild_24m,annualyeild_60m,\ + annualstdevr_100w,annualstdevr_24m,annualstdevr_60m,beta_100w,\ + beta_24m,beta_60m,avgreturn,avgreturny,stdevry,stdcof,\ + risk_nonsysrisk1,r2,alpha2,beta,sharpe,treynor,jensen,jenseny,betadf", + startDate, endDate, "period=2;returnType=1;index=000001.SH;yield=1") + if (data.ErrorCode == 0): + QA_util_log_info("Connent to Wind successfully") + return pd.DataFrame(np.asarray(data.Data).T, columns=data.Fields, index=data.Times)
+ + +
[docs]def QA_fetch_get_stock_xueqiu(name, startDate, endDate): + try: + from WindPy import w + except: + QA_util_log_info('No WindPY Module!') + w.start() + if(QA_util_date_valid(endDate) == False): + QA_util_log_info("wrong date") + else: + data = w.wsd(name, "xq_accmfocus,xq_accmcomments,xq_accmshares,\ + xq_focusadded,xq_commentsadded,xq_sharesadded,\ + xq_WOW_focus,xq_WOW_comments,xq_WOW_shares", startDate, endDate, "") + if (data.ErrorCode == 0): + QA_util_log_info("Connent to Wind successfully") + return pd.DataFrame(np.asarray(data.Data).T, columns=data.Fields, index=data.Times)
+ + +
[docs]def QA_fetch_get_stock_financial(name, startDate, endDate): + try: + from WindPy import w + except: + QA_util_log_info('No WindPY Module!') + w.start() + pass
+ + +
[docs]def QA_fetch_get_trade_date(endDate, exchange): + try: + from WindPy import w + except: + QA_util_log_info('No WindPY Module!') + w.start() + supportExchanges = ["SSE", "SZSE", "CFFEX", "SHFE", "DCE", "CZCE"] + if (exchange in supportExchanges): + #"SSE","SZSE","CFFEX","SHFE","DCE","CZCE" + # 上海股票交易所,深圳股票交易所,中国金融期货交易所,上海期货交易所,大连商品交易所,郑州期货交易所 + exchanges = "TradingCalendar=" + exchange + data = w.tdays("1990-01-01", endDate, exchanges) + # QA_util_log_info(data.Data) + dates = pd.DataFrame(np.asarray(data.Data).T, + columns=data.Fields, index=data.Times) + else: + QA_util_log_info("exchange name problem") + return dates
+ + +
[docs]def QA_fetch_get_stock_list(date): + try: + from WindPy import w + except: + QA_util_log_info('No WindPY Module!') + w.start() + if(QA_util_date_valid(date) == False): + QA_util_log_info("wrong date") + else: + awgs = 'date=' + date + ';sectorid=a001010100000000' + data = w.wset("sectorconstituent", awgs) + return pd.DataFrame(np.asarray(data.Data).T, columns=data.Fields, index=data.Times)
+ + +
[docs]def QA_fetch_get_stock_list_special(date, id): + try: + from WindPy import w + except: + QA_util_log_info('No WindPY Module!') + w.start() + if(QA_util_date_valid(date) == False): + QA_util_log_info("wrong date") + else: + if id in ['big', 'small', 'cixin', 'yujing', 'rzrq', 'rq', 'yj', 'st', 'sst']: + awgs = 'date=' + date + ';sectorid=' + \ + data_list.wind_stock_list_special_id[id] + data = w.wset("sectorconstituent", awgs) + return pd.DataFrame(np.asarray(data.Data).T, columns=data.Fields, index=data.Times)
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAFetch/QAfinancial.html b/_build/html/_modules/QUANTAXIS/QAFetch/QAfinancial.html new file mode 100644 index 000000000..2bf1873f3 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAFetch/QAfinancial.html @@ -0,0 +1,158 @@ + + + + + + + + QUANTAXIS.QAFetch.QAfinancial — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAFetch.QAfinancial

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+import os
+import sys
+import requests
+from pytdx.reader.history_financial_reader import HistoryFinancialReader
+from pytdx.crawler.history_financial_crawler import HistoryFinancialCrawler, HistoryFinancialListCrawler
+
+from QUANTAXIS.QASU.save_local import qa_path
+"""
+参见PYTDX 1.65
+"""
+
+FINANCIAL_URL = 'http://down.tdx.com.cn:8001/fin/gpcw.txt'
+
+
+
[docs]def get_filename(): + """ + get_filename + """ + return [l[0] for l in [line.strip().split(",") for line in requests.get(FINANCIAL_URL).text.strip().split('\n')]]
+ + +
[docs]def download(): + """ + 会创建一个download/文件夹 + """ + result = get_filename() + for item in result: + r = requests.get('http://down.tdx.com.cn:8001/fin/{}'.format(item)) + + file = '{}{}{}{}{}'.format(qa_path, os.sep, 'downloads', os.sep, item) + with open(file, "wb") as code: + code.write(r.content)
+ + +
[docs]def get_and_parse(filename): + return HistoryFinancialReader().get_df(filename)
+ + +
[docs]def prase_all(): + """ + 解析目录下的所有文件 + """ + filepath = '{}{}{}{}'.format(qa_path, os.sep, 'downloads', os.sep) + filename = os.listdir(filepath) + data = [] + for item in filename: + file = '{}{}{}{}{}'.format(qa_path, os.sep, 'downloads', os.sep, item) + data += get_and_parse(file) + return data
+ + +if __name__ == '__main__': + # download() + prase_all() +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAFetch/realtime.html b/_build/html/_modules/QUANTAXIS/QAFetch/realtime.html new file mode 100644 index 000000000..8a4e6b557 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAFetch/realtime.html @@ -0,0 +1,141 @@ + + + + + + + + QUANTAXIS.QAFetch.realtime — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAFetch.realtime

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+"""单线程的实时获取
+""" 
+
+
+from QUANTAXIS.QAFetch.QATdx import select_best_ip, QA_fetch_get_stock_day, QA_fetch_get_stock_list
+from QUANTAXIS.QAData.QADataStruct import QA_DataStruct_Stock_day
+import pandas as pd
+import datetime
+
+
+
[docs]def get_today_all(output='pd'): + """today all + + Returns: + [type] -- [description] + """ + + data = [] + today = str(datetime.date.today()) + codes = QA_fetch_get_stock_list('stock').code.tolist() + bestip = select_best_ip()['stock'] + for code in codes: + try: + l = QA_fetch_get_stock_day( + code, today, today, '00', ip=bestip) + except: + bestip = select_best_ip()['stock'] + l = QA_fetch_get_stock_day( + code, today, today, '00', ip=bestip) + if l is not None: + data.append(l) + + res = pd.concat(data) + if output in ['pd']: + return res + elif output in ['QAD']: + return QA_DataStruct_Stock_day(res.set_index(['date', 'code'], drop=False))
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAIndicator/base.html b/_build/html/_modules/QUANTAXIS/QAIndicator/base.html new file mode 100644 index 000000000..c2cb658cb --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAIndicator/base.html @@ -0,0 +1,262 @@ + + + + + + + + QUANTAXIS.QAIndicator.base — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAIndicator.base

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+
+from functools import reduce
+
+import numpy as np
+import pandas as pd
+
+
+"""
+Series 类
+
+这个是下面以DataFrame为输入的基础函数
+return pd.Series format
+"""
+
+
+
[docs]def EMA(Series, N): + return pd.Series.ewm(Series, span=N, min_periods=N - 1, adjust=True).mean()
+ + +
[docs]def MA(Series, N): + return pd.Series.rolling(Series, N).mean()
+ +# 威廉SMA 参考https://www.joinquant.com/post/867 + + +
[docs]def SMA(Series, N, M=1): + """ + 威廉SMA算法 + + 本次修正主要是对于返回值的优化,现在的返回值会带上原先输入的索引index + 2018/5/3 + @yutiansut + """ + ret = [] + i = 1 + length = len(Series) + # 跳过X中前面几个 nan 值 + while i < length: + if np.isnan(Series.iloc[i]): + i += 1 + else: + break + preY = Series.iloc[i] # Y' + ret.append(preY) + while i < length: + Y = (M * Series.iloc[i] + (N - M) * preY) / float(N) + ret.append(Y) + preY = Y + i += 1 + return pd.Series(ret,index=Series.tail(len(ret)).index)
+ + +
[docs]def DIFF(Series, N=1): + return pd.Series(Series).diff(N)
+ + +
[docs]def HHV(Series, N): + return pd.Series(Series).rolling(N).max().values
+ + +
[docs]def LLV(Series, N): + return pd.Series(Series).rolling(N).min().values
+ + +
[docs]def SUM(Series, N): + return pd.Series.rolling(Series, N).sum()
+ + +
[docs]def ABS(Series): + return abs(Series)
+ + +
[docs]def MAX(A, B): + var = IF(A > B, A, B) + return var
+ + +
[docs]def MIN(A, B): + var = IF(A < B, A, B) + return var
+ + +
[docs]def CROSS(A, B): + if A.iloc[-2] < B.iloc[-2] and A.iloc[-1] > B.iloc[-1]: + return True + else: + return False
+ + +
[docs]def COUNT(COND, N): + var = np.where(COND, 1, 0) + return var[-N:].sum()
+ + +
[docs]def IF(COND, V1, V2): + var = np.where(COND, V1, V2) + return pd.Series(var, index=V1.index)
+ + +
[docs]def REF(Series, N): + var = Series.diff(N) + var = Series - var + return var
+ + +
[docs]def LAST(COND, N1, N2): + """表达持续性 + + Arguments: + COND {[type]} -- [description] + N1 {[type]} -- [description] + N2 {[type]} -- [description] + """ + N2=1 if N2==0 else N2 + assert N2>0 + assert N1>N2 + return COND.iloc[-N1:-N2].all()
+ + +
[docs]def STD(Series, N): + return pd.Series.rolling(Series, N).std()
+ + +
[docs]def AVEDEV(Series, N): + '平均绝对偏差 mean absolute deviation' + return pd.Series(Series).tail(N).mad()
+ + +
[docs]def MACD(Series, FAST, SLOW, MID): + """macd指标 仅适用于Series + 对于DATAFRAME的应用请使用QA_indicator_macd + """ + EMAFAST = EMA(Series, FAST) + EMASLOW = EMA(Series, SLOW) + DIFF = EMAFAST - EMASLOW + DEA = EMA(DIFF, MID) + MACD = (DIFF - DEA) * 2 + DICT = {'DIFF': DIFF, 'DEA': DEA, 'MACD': MACD} + VAR = pd.DataFrame(DICT) + return VAR
+ + +
[docs]def BBIBOLL(Series, N1, N2, N3, N4, N, M): # 多空布林线 + + bbiboll = BBI(Series, N1, N2, N3, N4) + UPER = bbiboll + M * STD(bbiboll, N) + DOWN = bbiboll - M * STD(bbiboll, N) + DICT = {'BBIBOLL': bbiboll, 'UPER': UPER, 'DOWN': DOWN} + VAR = pd.DataFrame(DICT) + return VAR
+ + +
[docs]def BBI(Series, N1, N2, N3, N4): + '多空指标' + + bbi = (MA(Series, N1) + MA(Series, N2) + + MA(Series, N3) + MA(Series, N4)) / 4 + DICT = {'BBI': bbi} + VAR = pd.DataFrame(DICT) + return VAR
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAIndicator/indicators.html b/_build/html/_modules/QUANTAXIS/QAIndicator/indicators.html new file mode 100644 index 000000000..edbc70c2e --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAIndicator/indicators.html @@ -0,0 +1,700 @@ + + + + + + + + QUANTAXIS.QAIndicator.indicators — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAIndicator.indicators

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+from functools import reduce
+
+import numpy as np
+import pandas as pd
+
+from QUANTAXIS.QAIndicator.base import *
+
+
+"""
+DataFrame 类
+
+以下的函数都可以被直接add_func
+
+
+"""
+
+
+"""
+1.	趋向指标 
+又叫趋势跟踪类指标,主要用于跟踪并预测股价的发展趋势
+
+包含的主要指标
+1. 移动平均线 MA
+2. 指数平滑移动平均线 MACD
+3. 趋向指标 DMI
+4. 瀑布线 PBX
+5. 平均线差 DMA
+6. 动力指标(动量线)  MTM
+7. 指数平均线 EXPMA
+8. 佳庆指标 CHO
+"""
+
+
+
[docs]def QA_indicator_MA(DataFrame, N): + CLOSE = DataFrame['close'] + return pd.DataFrame({'MA': MA(CLOSE, N)})
+ + +
[docs]def QA_indicator_EMA(DataFrame, N): + CLOSE = DataFrame['close'] + return pd.DataFrame({'EMA': EMA(CLOSE, N)})
+ + +
[docs]def QA_indicator_SMA(DataFrame, N): + CLOSE = DataFrame['close'] + return pd.DataFrame({'SMA': SMA(CLOSE, N)})
+ + +
[docs]def QA_indicator_MACD(DataFrame, short=12, long=26, mid=9): + """ + MACD CALC + """ + CLOSE = DataFrame['close'] + + DIF = EMA(CLOSE, short)-EMA(CLOSE, long) + DEA = EMA(DIF, mid) + MACD = (DIF-DEA)*2 + + return pd.DataFrame({'DIF': DIF, 'DEA': DEA, 'MACD': MACD})
+ + +
[docs]def QA_indicator_DMI(DataFrame, M1=14, M2=6): + """ + 趋向指标 DMI + """ + HIGH = DataFrame.high + LOW = DataFrame.low + CLOSE = DataFrame.close + OPEN = DataFrame.open + + TR = SUM(MAX(MAX(HIGH-LOW, ABS(HIGH-REF(CLOSE, 1))), + ABS(LOW-REF(CLOSE, 1))), M1) + HD = HIGH-REF(HIGH, 1) + LD = REF(LOW, 1)-LOW + DMP = SUM(IF(HD > 0 and HD > LD, HD, 0), M1) + DMM = SUM(IF(LD > 0 and LD > HD, LD, 0), M1) + DI1 = DMP*100/TR + DI2 = DMM*100/TR + ADX = MA(ABS(DI2-DI1)/(DI1+DI2)*100, M2) + ADXR = (ADX+REF(ADX, M2))/2 + + return pd.DataFrame({ + 'DI1': DI1, 'DI2': DI2, + 'ADX': ADX, 'ADXR': ADXR + })
+ + +
[docs]def QA_indicator_PBX(DataFrame, N1=3, N2=5, N3=8, N4=13, N5=18, N6=24): + '瀑布线' + C = DataFrame['close'] + PBX1 = (EMA(C, N1) + EMA(C, 2 * N1) + EMA(C, 4 * N1)) / 3 + PBX2 = (EMA(C, N2) + EMA(C, 2 * N2) + EMA(C, 4 * N2)) / 3 + PBX3 = (EMA(C, N3) + EMA(C, 2 * N3) + EMA(C, 4 * N3)) / 3 + PBX4 = (EMA(C, N4) + EMA(C, 2 * N4) + EMA(C, 4 * N4)) / 3 + PBX5 = (EMA(C, N5) + EMA(C, 2 * N5) + EMA(C, 4 * N5)) / 3 + PBX6 = (EMA(C, N6) + EMA(C, 2 * N6) + EMA(C, 4 * N6)) / 3 + DICT = {'PBX1': PBX1, 'PBX2': PBX2, 'PBX3': PBX3, + 'PBX4': PBX4, 'PBX5': PBX5, 'PBX6': PBX6} + + return pd.DataFrame(DICT)
+ + +
[docs]def QA_indicator_DMA(DataFrame, M1=10, M2=50, M3=10): + """ + 平均线差 DMA + """ + CLOSE = DataFrame.close + DDD = MA(CLOSE, M1) - MA(CLOSE, M2) + AMA = MA(DDD, M3) + return pd.DataFrame({ + 'DDD': DDD, 'AMA': AMA + })
+ + +
[docs]def QA_indicator_MTM(DataFrame, N=12, M=6): + '动量线' + C = DataFrame.close + mtm = C - REF(C, N) + MTMMA = MA(mtm, M) + DICT = {'MTM': mtm, 'MTMMA': MTMMA} + + return pd.DataFrame(DICT)
+ + +
[docs]def QA_indicator_EXPMA(DataFrame, P1=5, P2=10, P3=20, P4=60): + """ 指数平均线 EXPMA""" + CLOSE = DataFrame.close + MA1 = EMA(CLOSE, P1) + MA2 = EMA(CLOSE, P2) + MA3 = EMA(CLOSE, P3) + MA4 = EMA(CLOSE, P4) + return pd.DataFrame({ + 'MA1': MA1, 'MA2': MA2, 'MA3': MA3, 'MA4': MA4 + })
+ + +
[docs]def QA_indicator_CHO(DataFrame, N1=10, N2=20, M=6): + """ + 佳庆指标 CHO + """ + HIGH = DataFrame.high + LOW = DataFrame.low + CLOSE = DataFrame.close + VOL = DataFrame.volume + MID = SUM(VOL*(2*CLOSE-HIGH-LOW)/(HIGH+LOW), 0) + CHO = MA(MID, N1)-MA(MID, N2) + MACHO = MA(CHO, M) + return pd.DataFrame({ + 'CHO': CHO, 'MACHO': MACHO + })
+ + +""" + +2. 反趋向指标 +主要捕捉趋势的转折点 + +随机指标KDJ +乖离率 BIAS +变动速率 ROC +顺势指标 CCI +威廉指标 W&R +震荡量(变动速率) OSC +相对强弱指标 RSI +动态买卖指标 ADTM + +""" + + +
[docs]def QA_indicator_KDJ(DataFrame, N=9, M1=3, M2=3): + C = DataFrame['close'] + H = DataFrame['high'] + L = DataFrame['low'] + + RSV = (C - LLV(L, N)) / (HHV(H, N) - LLV(L, N)) * 100 + K = SMA(RSV, M1) + D = SMA(K, M2) + J = 3 * K - 2 * D + DICT = {'KDJ_K': K, 'KDJ_D': D, 'KDJ_J': J} + return pd.DataFrame(DICT)
+ + +
[docs]def QA_indicator_BIAS(DataFrame, N1, N2, N3): + '乖离率' + CLOSE = DataFrame['close'] + BIAS1 = (CLOSE - MA(CLOSE, N1)) / MA(CLOSE, N1) * 100 + BIAS2 = (CLOSE - MA(CLOSE, N2)) / MA(CLOSE, N2) * 100 + BIAS3 = (CLOSE - MA(CLOSE, N3)) / MA(CLOSE, N3) * 100 + DICT = {'BIAS1': BIAS1, 'BIAS2': BIAS2, 'BIAS3': BIAS3} + + return pd.DataFrame(DICT)
+ + +
[docs]def QA_indicator_ROC(DataFrame, N=12, M=6): + '变动率指标' + C = DataFrame['close'] + roc = 100 * (C - REF(C, N)) / REF(C, N) + ROCMA = MA(roc, M) + DICT = {'ROC': roc, 'ROCMA': ROCMA} + + return pd.DataFrame(DICT)
+ + +
[docs]def QA_indicator_CCI(DataFrame, N=14): + """ + TYP:=(HIGH+LOW+CLOSE)/3; + CCI:(TYP-MA(TYP,N))/(0.015*AVEDEV(TYP,N)); + """ + typ = (DataFrame['high'] + DataFrame['low'] + DataFrame['close']) / 3 + cci = ((typ - MA(typ, N)) / (0.015 * AVEDEV(typ, N))) + a = 100 + b = -100 + + return pd.DataFrame({ + 'CCI': cci, 'a': a, 'b': b + })
+ + +
[docs]def QA_indicator_WR(DataFrame, N, N1): + '威廉指标' + HIGH = DataFrame['high'] + LOW = DataFrame['low'] + CLOSE = DataFrame['close'] + WR1 = 100 * (HHV(HIGH, N) - CLOSE) / (HHV(HIGH, N) - LLV(LOW, N)) + WR2 = 100 * (HHV(HIGH, N1) - CLOSE) / (HHV(HIGH, N1) - LLV(LOW, N1)) + DICT = {'WR1': WR1, 'WR2': WR2} + + return pd.DataFrame(DICT)
+ + +
[docs]def QA_indicator_OSC(DataFrame, N=20, M=6): + """变动速率线 + + 震荡量指标OSC,也叫变动速率线。属于超买超卖类指标,是从移动平均线原理派生出来的一种分析指标。 + + 它反应当日收盘价与一段时间内平均收盘价的差离值,从而测出股价的震荡幅度。 + + 按照移动平均线原理,根据OSC的值可推断价格的趋势,如果远离平均线,就很可能向平均线回归。 + """ + C = DataFrame['close'] + OS = (C - MA(C, N)) * 100 + MAOSC = EMA(OS, M) + DICT = {'OSC': OS, 'MAOSC': MAOSC} + + return pd.DataFrame(DICT)
+ + +
[docs]def QA_indicator_RSI(DataFrame, N1=12, N2=26, N3=9): + '相对强弱指标RSI1:SMA(MAX(CLOSE-LC,0),N1,1)/SMA(ABS(CLOSE-LC),N1,1)*100;' + CLOSE = DataFrame['close'] + LC = REF(CLOSE, 1) + RSI1 = SMA(MAX(CLOSE - LC, 0), N1) / SMA(ABS(CLOSE - LC), N1) * 100 + RSI2 = SMA(MAX(CLOSE - LC, 0), N2) / SMA(ABS(CLOSE - LC), N2) * 100 + RSI3 = SMA(MAX(CLOSE - LC, 0), N3) / SMA(ABS(CLOSE - LC), N3) * 100 + DICT = {'RSI1': RSI1, 'RSI2': RSI2, 'RSI3': RSI3} + + return pd.DataFrame(DICT)
+ + +
[docs]def QA_indicator_ADTM(DataFrame, N=23, M=8): + '动态买卖气指标' + HIGH = DataFrame.high + LOW = DataFrame.low + OPEN = DataFrame.open + DTM = IF(OPEN <= REF(OPEN, 1), 0, MAX( + (HIGH - OPEN), (OPEN - REF(OPEN, 1)))) + DBM = IF(OPEN >= REF(OPEN, 1), 0, MAX((OPEN - LOW), (OPEN - REF(OPEN, 1)))) + STM = SUM(DTM, N) + SBM = SUM(DBM, N) + ADTM1 = IF(STM > SBM, (STM - SBM) / STM, + IF(STM == SBM, 0, (STM - SBM) / SBM)) + MAADTM = MA(ADTM1, M) + DICT = {'ADTM': ADTM1, 'MAADTM': MAADTM} + + return pd.DataFrame(DICT)
+ + +""" +3. 量能指标 +通过成交量的大小和变化研判趋势变化 +容量指标 VR +量相对强弱 VRSI +能量指标 CR +人气意愿指标 ARBR +成交量标准差 VSTD""" + + +
[docs]def QA_indicator_VR(DataFrame, M1=26, M2=100, M3=200): + VOL = DataFrame.volume + CLOSE = DataFrame.close + LC = REF(CLOSE, 1) + VR = SUM(IF(CLOSE > LC, VOL, 0), M1)/SUM(IF(CLOSE <= LC, VOL, 0), M1)*100 + a = M2 + b = M3 + return pd.DataFrame({ + 'VR': VR, 'a': a, 'b': b + })
+ + +
[docs]def QA_indicator_VRSI(DataFrame, N=6): + + VOL = DataFrame.volume + vrsi = SMA(MAX(VOL-REF(VOL, 1), 0), N, 1) / \ + SMA(ABS(VOL-REF(VOL, 1)), N, 1)*100 + + return pd.DataFrame({'VRSI': vrsi})
+ + +
[docs]def QA_indicator_CR(DataFrame, N=26, M1=5, M2=10, M3=20): + HIGH = DataFrame.high + LOW = DataFrame.low + CLOSE = DataFrame.close + VOL = DataFrame.volume + MID = (HIGH+LOW+CLOSE)/3 + + CR = SUM(MAX(0, HIGH-REF(MID, 1)), N)/SUM(MAX(0, REF(MID, 1)-LOW), N)*100 + MA1 = REF(MA(CR, M1), M1/2.5+1) + MA2 = REF(MA(CR, M2), M2/2.5+1) + MA3 = REF(MA(CR, M3), M3/2.5+1) + return pd.DataFrame({ + 'CR': CR, 'MA1': MA1, 'MA2': MA2, 'MA3': MA3 + })
+ + +
[docs]def QA_indicator_ARBR(DataFrame, M1=26, M2=70, M3=150): + HIGH = DataFrame.high + LOW = DataFrame.low + CLOSE = DataFrame.close + OPEN = DataFrame.open + AR = SUM(HIGH-OPEN, M1)/SUM(OPEN-LOW, M1)*100 + BR = SUM(MAX(0, HIGH-REF(CLOSE, 1)), M1) / \ + SUM(MAX(0, REF(CLOSE, 1)-LOW), M1)*100 + a = M2 + b = M3 + return pd.DataFrame({ + 'AR': AR, 'BR': BR, 'a': a, 'b': b + })
+ + +
[docs]def QA_indicator_VSTD(DataFrame, N=10): + VOL = DataFrame.volume + vstd = STD(VOL, N) + return pd.DataFrame({'VSTD': vstd})
+ + +""" +4. 量价指标 +通过成交量和股价变动关系分析未来趋势 +震荡升降指标ASI +价量趋势PVT +能量潮OBV +量价趋势VPT +""" + + +
[docs]def QA_indicator_ASI(DataFrame, M1=26, M2=10): + """ + LC=REF(CLOSE,1); + AA=ABS(HIGH-LC); + BB=ABS(LOW-LC); + CC=ABS(HIGH-REF(LOW,1)); + DD=ABS(LC-REF(OPEN,1)); + R=IF(AA>BB AND AA>CC,AA+BB/2+DD/4,IF(BB>CC AND BB>AA,BB+AA/2+DD/4,CC+DD/4)); + X=(CLOSE-LC+(CLOSE-OPEN)/2+LC-REF(OPEN,1)); + SI=16*X/R*MAX(AA,BB); + ASI:SUM(SI,M1); + ASIT:MA(ASI,M2); + """ + CLOSE = DataFrame['close'] + HIGH = DataFrame['high'] + LOW = DataFrame['low'] + OPEN = DataFrame['open'] + LC = REF(CLOSE, 1) + AA = ABS(HIGH - LC) + BB = ABS(LOW-LC) + CC = ABS(HIGH - REF(LOW, 1)) + DD = ABS(LC - REF(OPEN, 1)) + + R = IF(AA > BB and AA > CC, AA+BB/2+DD/4, + IF(BB > CC and BB > AA, BB+AA/2+DD/4, CC+DD/4)) + X = (CLOSE - LC + (CLOSE - OPEN) / 2 + LC - REF(OPEN, 1)) + SI = 16*X/R*MAX(AA, BB) + ASI = SUM(SI, M1) + ASIT = MA(ASI, M2) + return pd.DataFrame({ + 'ASI': ASI, 'ASIT': ASIT + })
+ + +
[docs]def QA_indicator_PVT(DataFrame): + CLOSE = DataFrame.close + VOL = DataFrame.volume + PVT = SUM((CLOSE-REF(CLOSE, 1))/REF(CLOSE, 1)*VOL, 0) + return pd.DataFrame({'PVT': PVT})
+ + +
[docs]def QA_indicator_OBV(DataFrame): + """能量潮""" + VOL = DataFrame.volume + CLOSE = DataFrame.close + pd.DataFrame({ + 'OBV': SUM(IF(CLOSE > REF(CLOSE, 1), VOL, IF(CLOSE < REF(CLOSE, 1), -VOL, 0)), 0)/10000 + })
+ + +
[docs]def QA_indicator_VPT(DataFrame, N=51, M=6): + VOL = DataFrame.volume + CLOSE = DataFrame.close + VPT = SUM(VOL*(CLOSE-REF(CLOSE, 1))/REF(CLOSE, 1), 0) + MAVPT = MA(VPT, M) + return pd.DataFrame({ + 'VPT': VPT, 'MAVPT': MAVPT + })
+ + +""" +5. 压力支撑指标 +主要用于分析股价目前收到的压力和支撑 +布林带 BOLL +麦克指标 MIKE +""" + + +
[docs]def QA_indicator_BOLL(DataFrame, N=20, P=2): + '布林线' + C = DataFrame['close'] + boll = MA(C, N) + UB = boll + P * STD(C, N) + LB = boll - P * STD(C, N) + DICT = {'BOLL': boll, 'UB': UB, 'LB': LB} + + return pd.DataFrame(DICT)
+ + +
[docs]def QA_indicator_MIKE(DataFrame, N=12): + """ + MIKE指标 + 指标说明 + MIKE是另外一种形式的路径指标。 + 买卖原则 + 1 WEAK-S,MEDIUM-S,STRONG-S三条线代表初级、中级、强力支撑。 + 2 WEAK-R,MEDIUM-R,STRONG-R三条线代表初级、中级、强力压力。 + """ + HIGH = DataFrame.high + LOW = DataFrame.low + CLOSE = DataFrame.close + + TYP = (HIGH+LOW+CLOSE)/3 + LL = LLV(LOW, N) + HH = HHV(HIGH, N) + + WR = TYP+(TYP-LL) + MR = TYP+(HH-LL) + SR = 2*HH-LL + WS = TYP-(HH-TYP) + MS = TYP-(HH-LL) + SS = 2*LL-HH + return pd.DataFrame({ + 'WR': WR, 'MR': MR, 'SR': SR, + 'WS': WS, 'MS': MS, 'SS': SS + })
+ + +
[docs]def QA_indicator_BBI(DataFrame, N1=3, N2=6, N3=12, N4=24): + '多空指标' + C = DataFrame['close'] + bbi = (MA(C, N1) + MA(C, N2) + MA(C, N3) + MA(C, N4)) / 4 + DICT = {'BBI': bbi} + + return pd.DataFrame(DICT)
+ + +
[docs]def QA_indicator_MFI(DataFrame, N=14): + """ + 资金指标 + TYP := (HIGH + LOW + CLOSE)/3; + V1:=SUM(IF(TYP>REF(TYP,1),TYP*VOL,0),N)/SUM(IF(TYP<REF(TYP,1),TYP*VOL,0),N); + MFI:100-(100/(1+V1)); + 赋值: (最高价 + 最低价 + 收盘价)/3 + V1赋值:如果TYP>1日前的TYP,返回TYP*成交量(手),否则返回0的N日累和/如果TYP<1日前的TYP,返回TYP*成交量(手),否则返回0的N日累和 + 输出资金流量指标:100-(100/(1+V1)) + """ + C = DataFrame['close'] + H = DataFrame['high'] + L = DataFrame['low'] + VOL = DataFrame['volume'] + TYP = (C + H + L) / 3 + V1 = SUM(IF(TYP > REF(TYP, 1), TYP * VOL, 0), N) / \ + SUM(IF(TYP < REF(TYP, 1), TYP * VOL, 0), N) + mfi = 100 - (100 / (1 + V1)) + DICT = {'MFI': mfi} + + return pd.DataFrame(DICT)
+ + +
[docs]def QA_indicator_ATR(DataFrame, N=14): + """ + 输出TR:(最高价-最低价)和昨收-最高价的绝对值的较大值和昨收-最低价的绝对值的较大值 + 输出真实波幅:TR的N日简单移动平均 + 算法:今日振幅、今日最高与昨收差价、今日最低与昨收差价中的最大值,为真实波幅,求真实波幅的N日移动平均 + + 参数:N 天数,一般取14 + + """ + C = DataFrame['close'] + H = DataFrame['high'] + L = DataFrame['low'] + TR = MAX(MAX((H - L), ABS(REF(C, 1) - H)), ABS(REF(C, 1) - L)) + atr = MA(TR, N) + return pd.DataFrame({'TR': TR, 'ATR': atr})
+ + +
[docs]def QA_indicator_SKDJ(DataFrame, N=9, M=3): + """ + 1.指标>80 时,回档机率大;指标<20 时,反弹机率大; + 2.K在20左右向上交叉D时,视为买进信号参考; + 3.K在80左右向下交叉D时,视为卖出信号参考; + 4.SKDJ波动于50左右的任何讯号,其作用不大。 + + """ + CLOSE = DataFrame['close'] + LOWV = LLV(DataFrame['low'], N) + HIGHV = HHV(DataFrame['high'], N) + RSV = EMA((CLOSE - LOWV) / (HIGHV - LOWV) * 100, M) + K = EMA(RSV, M) + D = MA(K, M) + DICT = {'RSV': RSV, 'SKDJ_K': K, 'SKDJ_D': D} + + return pd.DataFrame(DICT)
+ + +
[docs]def QA_indicator_DDI(DataFrame, N=13, N1=26, M=1, M1=5): + """ + '方向标准离差指数' + 分析DDI柱状线,由红变绿(正变负),卖出信号参考;由绿变红,买入信号参考。 + """ + + H = DataFrame['high'] + L = DataFrame['low'] + DMZ = IF((H + L) <= (REF(H, 1) + REF(L, 1)), 0, + MAX(ABS(H - REF(H, 1)), ABS(L - REF(L, 1)))) + DMF = IF((H + L) >= (REF(H, 1) + REF(L, 1)), 0, + MAX(ABS(H - REF(H, 1)), ABS(L - REF(L, 1)))) + DIZ = SUM(DMZ, N) / (SUM(DMZ, N) + SUM(DMF, N)) + DIF = SUM(DMF, N) / (SUM(DMF, N) + SUM(DMZ, N)) + ddi = DIZ - DIF + ADDI = SMA(ddi, N1, M) + AD = MA(ADDI, M1) + DICT = {'DDI': ddi, 'ADDI': ADDI, 'AD': AD} + + return pd.DataFrame(DICT)
+ + +
[docs]def QA_indicator_shadow(DataFrame): + """ + 上下影线指标 + """ + return { + 'LOW': lower_shadow(DataFrame), 'UP': upper_shadow(DataFrame), + 'BODY': body(DataFrame), 'BODY_ABS': body_abs(DataFrame), 'PRICE_PCG': price_pcg(DataFrame) + }
+ + +
[docs]def lower_shadow(DataFrame): # 下影线 + return abs(DataFrame.low - MIN(DataFrame.open, DataFrame.close))
+ + +
[docs]def upper_shadow(DataFrame): # 上影线 + return abs(DataFrame.high - MAX(DataFrame.open, DataFrame.close))
+ + +
[docs]def body_abs(DataFrame): + return abs(DataFrame.open - DataFrame.close)
+ + +
[docs]def body(DataFrame): + return DataFrame.close - DataFrame.open
+ + +
[docs]def price_pcg(DataFrame): + return body(DataFrame) / DataFrame.open
+ + +
[docs]def amplitude(DataFrame): + return (DataFrame.high - DataFrame.low) / DataFrame.low
+ + +""" + +6. 大盘指标 +通过涨跌家数研究大盘指数的走势 +涨跌比率 ADR +绝对幅度指标 ABI +新三价率 TBR +腾落指数 ADL +广量冲力指标 +指数平滑广量 STIX +""" +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAMarket/QABacktestBroker.html b/_build/html/_modules/QUANTAXIS/QAMarket/QABacktestBroker.html new file mode 100644 index 000000000..11fff50a3 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAMarket/QABacktestBroker.html @@ -0,0 +1,366 @@ + + + + + + + + QUANTAXIS.QAMarket.QABacktestBroker — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAMarket.QABacktestBroker

+# coding :utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+
+import datetime
+
+from QUANTAXIS.QAEngine.QAEvent import QA_Event
+from QUANTAXIS.QAFetch.QAQuery import (QA_fetch_future_day,
+                                       QA_fetch_future_min, QA_fetch_index_day,
+                                       QA_fetch_index_min, QA_fetch_stock_day,
+                                       QA_fetch_stock_min)
+from QUANTAXIS.QAFetch.QATdx import (QA_fetch_get_future_day,
+                                     QA_fetch_get_future_min,
+                                     QA_fetch_get_index_day,
+                                     QA_fetch_get_index_min,
+                                     QA_fetch_get_stock_day,
+                                     QA_fetch_get_stock_min)
+from QUANTAXIS.QAMarket.QABroker import QA_Broker
+from QUANTAXIS.QAMarket.QADealer import QA_Dealer
+from QUANTAXIS.QAMarket.QAOrderHandler import QA_OrderHandler
+from QUANTAXIS.QAUtil.QADate import QA_util_to_datetime
+from QUANTAXIS.QAUtil.QALogs import QA_util_log_info
+from QUANTAXIS.QAUtil.QAParameter import (AMOUNT_MODEL, BROKER_EVENT,
+                                          BROKER_TYPE, ENGINE_EVENT, FREQUENCE,
+                                          MARKET_EVENT, MARKET_TYPE,
+                                          ORDER_MODEL)
+
+
+
[docs]class QA_BacktestBroker(QA_Broker): + """ + QUANTAXIS Broker 部分 + + 回测 + 股票/指数/期货/债券/ETF/基金 + @yutiansut + + + 对于不同的市场规则: + 股票市场 t+1 + 期货/期权/加密货币市场 t+0 + + 股票/加密货币市场不允许卖空 + 期货/期权市场允许卖空 + + t+1的市场是 + 当日的买入 更新持仓- 不更新可卖数量- 资金冻结 + 当日的卖出 及时更新可用资金 + + t+0市场是: + 当日买入 即时更新持仓和可卖 + 当日卖出 即时更新 + + 卖空的规则是 + 允许无仓位的时候卖出证券(按市值和保证金比例限制算) + """ + + def __init__(self, commission_fee_coeff=0.0015, if_nondatabase=False): + """[summary] + + + Keyword Arguments: + commission_fee_coeff {[type]} -- [description] (default: {0}) + environment {[type]} -- [description] (default: {RUNNING_ENVIRONMENT}) + if_nondatabase {[type]} -- [description] (default: {False}) + """ + super().__init__() + self.dealer = QA_Dealer(commission_fee_coeff) + self.order_handler = QA_OrderHandler() + self.engine = { + MARKET_TYPE.STOCK_CN: self.dealer.backtest_stock_dealer} + + self.fetcher = {(MARKET_TYPE.STOCK_CN, FREQUENCE.DAY): QA_fetch_stock_day, (MARKET_TYPE.STOCK_CN, FREQUENCE.FIFTEEN_MIN): QA_fetch_stock_min, + (MARKET_TYPE.STOCK_CN, FREQUENCE.ONE_MIN): QA_fetch_stock_min, (MARKET_TYPE.STOCK_CN, FREQUENCE.FIVE_MIN): QA_fetch_stock_min, + (MARKET_TYPE.STOCK_CN, FREQUENCE.THIRTY_MIN): QA_fetch_stock_min, (MARKET_TYPE.STOCK_CN, FREQUENCE.SIXTY_MIN): QA_fetch_stock_min, + (MARKET_TYPE.INDEX_CN, FREQUENCE.DAY): QA_fetch_index_day, (MARKET_TYPE.INDEX_CN, FREQUENCE.FIFTEEN_MIN): QA_fetch_index_min, + (MARKET_TYPE.INDEX_CN, FREQUENCE.ONE_MIN): QA_fetch_index_min, (MARKET_TYPE.INDEX_CN, FREQUENCE.FIVE_MIN): QA_fetch_index_min, + (MARKET_TYPE.INDEX_CN, FREQUENCE.THIRTY_MIN): QA_fetch_index_min, (MARKET_TYPE.INDEX_CN, FREQUENCE.SIXTY_MIN): QA_fetch_index_min, + (MARKET_TYPE.FUND_CN, FREQUENCE.DAY): QA_fetch_index_day, (MARKET_TYPE.FUND_CN, FREQUENCE.FIFTEEN_MIN): QA_fetch_index_min, + (MARKET_TYPE.FUND_CN, FREQUENCE.ONE_MIN): QA_fetch_index_min, (MARKET_TYPE.FUND_CN, FREQUENCE.FIVE_MIN): QA_fetch_index_min, + (MARKET_TYPE.FUND_CN, FREQUENCE.THIRTY_MIN): QA_fetch_index_min, (MARKET_TYPE.FUND_CN, FREQUENCE.SIXTY_MIN): QA_fetch_index_min} + + self.commission_fee_coeff = commission_fee_coeff + self.market_data = None + self.if_nondatabase = if_nondatabase + self.name = BROKER_TYPE.BACKETEST + self._quotation = {} # 一个可以缓存数据的dict + self.broker_data = None + +
[docs] def run(self, event): + if event.event_type is MARKET_EVENT.QUERY_DATA: + # 查询数据部分 + code = event.code + frequence = event.frequence + start = event.start + end = start if event.end is None else event.end + market_type = event.market_type + res = self.query_data(code, start, end, frequence, market_type) + if event.callback: + event.callback(res) + else: + return res + elif event.event_type is MARKET_EVENT.QUERY_ORDER: + self.order_handler.run(event) + elif event.event_type is ENGINE_EVENT.UPCOMING_DATA: + new_marketdata_dict = event.market_data.dicts + for item in new_marketdata_dict.keys(): + if item not in self._quotation.keys(): + self._quotation[item] = new_marketdata_dict[item] + # if self.broker_data is None: + # self.broker_data = event.market_data + # else: + # self.broker_data.append(event.market_data) + # self.broker_data=event.market_data + + elif event.event_type is BROKER_EVENT.RECEIVE_ORDER: + self.order_handler.run(event) + self.run(QA_Event(event_type=BROKER_EVENT.TRADE, broker=self)) + elif event.event_type is BROKER_EVENT.TRADE: + event = self.order_handler.run(event) + + event.message = 'trade' + if event.callback: + event.callback(event) + elif event.event_type is BROKER_EVENT.SETTLE: + self.order_handler.run(event) + if event.callback: + event.callback('settle')
+ +
[docs] def query_data(self, code, start, end, frequence, market_type=None): + """ + 标准格式是numpy + """ + try: + return self.broker_data.select_time( + start, end).select_code(code).to_numpy() + except: + return self.fetcher[(market_type, frequence)]( + code, start, end, frequence=frequence)
+ +
[docs] def receive_order(self, event): + """ + get the order and choice which market to trade + + """ + order = event.order + + if 'market_data' in event.__dict__.keys(): + self.market_data = self.get_market( + order) if event.market_data is None else event.market_data + else: + self.market_data = self.get_market(order) + + order = self.warp(order) + + return self.dealer.deal(order, self.market_data)
+ +
[docs] def warp(self, order): + """对order/market的封装 + + [description] + + Arguments: + order {[type]} -- [description] + + Returns: + [type] -- [description] + """ + + # 因为成交模式对时间的封装 + + if order.order_model == ORDER_MODEL.MARKET: + + if order.frequence is FREQUENCE.DAY: + # exact_time = str(datetime.datetime.strptime( + # str(order.datetime), '%Y-%m-%d %H-%M-%S') + datetime.timedelta(day=1)) + + order.date = order.datetime[0:10] + order.datetime = '{} 09:30:00'.format(order.date) + elif order.frequence in [FREQUENCE.ONE_MIN, FREQUENCE.FIVE_MIN, FREQUENCE.FIFTEEN_MIN, FREQUENCE.THIRTY_MIN, FREQUENCE.SIXTY_MIN]: + print(order.datetime) + exact_time = str(datetime.datetime.strptime( + str(order.datetime), '%Y-%m-%d %H:%M:%S') + datetime.timedelta(minutes=1)) + order.date = exact_time[0:10] + order.datetime = exact_time + self.market_data = self.get_market(order) + if self.market_data is None: + return order + order.price = (float(self.market_data["high"]) + + float(self.market_data["low"])) * 0.5 + elif order.order_model == ORDER_MODEL.NEXT_OPEN: + try: + exact_time = str(datetime.datetime.strptime( + str(order.datetime), '%Y-%m-%d %H-%M-%S') + datetime.timedelta(day=1)) + order.date = exact_time[0:10] + order.datetime = '{} 09:30:00'.format(order.date) + except: + order.datetime = '{} 15:00:00'.format(order.date) + self.market_data = self.get_market(order) + if self.market_data is None: + return order + order.price = float(self.market_data["close"]) + elif order.order_model == ORDER_MODEL.CLOSE: + + try: + order.datetime = self.market_data.datetime + except: + if len(str(order.datetime)) == 19: + pass + else: + order.datetime = '{} 15:00:00'.format(order.date) + self.market_data = self.get_market(order) + if self.market_data is None: + return order + order.price = float(self.market_data["close"]) + + elif order.order_model == ORDER_MODEL.STRICT: + '加入严格模式' + if order.frequence is FREQUENCE.DAY: + exact_time = str(datetime.datetime.strptime( + order.datetime, '%Y-%m-%d %H-%M-%S') + datetime.timedelta(day=1)) + + order.date = exact_time[0:10] + order.datetime = '{} 09:30:00'.format(order.date) + elif order.frequence in [FREQUENCE.ONE_MIN, FREQUENCE.FIVE_MIN, FREQUENCE.FIFTEEN_MIN, FREQUENCE.THIRTY_MIN, FREQUENCE.SIXTY_MIN]: + exact_time = str(datetime.datetime.strptime( + order.datetime, '%Y-%m-%d %H-%M-%S') + datetime.timedelta(minute=1)) + order.date = exact_time[0:10] + order.datetime = exact_time + self.market_data = self.get_market(order) + if self.market_data is None: + return order + if order.towards == 1: + order.price = float(self.market_data["high"]) + else: + order.price = float(self.market_data["low"]) + + return order
+ +
[docs] def get_market(self, order): + """get_market func + + [description] + + Arguments: + order {orders} -- [description] + + Returns: + [type] -- [description] + """ + + # 首先判断是否在_quotation里面 + + if (order.datetime, order.code) in self._quotation.keys(): + return self._quotation[(QA_util_to_datetime(order.datetime), order.code)] + + else: + try: + data = self.fetcher[(order.market_type, order.frequence)]( + code=order.code, start=order.datetime, end=order.datetime, format='json')[0] + if 'vol' in data.keys() and 'volume' not in data.keys(): + data['volume'] = data['vol'] + elif 'vol' not in data.keys() and 'volume' in data.keys(): + data['vol'] = data['volume'] + return data + except Exception as e: + QA_util_log_info('MARKET_ENGING ERROR: {}'.format(e)) + return None
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAMarket/QABroker.html b/_build/html/_modules/QUANTAXIS/QAMarket/QABroker.html new file mode 100644 index 000000000..07ab878eb --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAMarket/QABroker.html @@ -0,0 +1,225 @@ + + + + + + + + QUANTAXIS.QAMarket.QABroker — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAMarket.QABroker

+# coding :utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+
+"""
+需要一个可以被修改和继承的基类
+
+2017/8/12
+
+"""
+import datetime
+from abc import abstractmethod
+
+from QUANTAXIS.QAEngine.QAEvent import QA_Event, QA_Worker
+from QUANTAXIS.QAUtil.QAParameter import EVENT_TYPE, FREQUENCE, ORDER_MODEL
+
+
+
[docs]class QA_Broker(QA_Worker): + """MARKET ENGINGE ABSTRACT + + receive_order => warp => get_data => engine + """ + + def __init__(self, *args, **kwargs): + super().__init__() + self.type = EVENT_TYPE.BROKER_EVENT + self.name = None + + def __repr__(self): + return '< QA_MARKET >' + +
[docs] @abstractmethod + def receive_order(self, event): + raise NotImplementedError
+ +
[docs] def get_market(self, order): + pass
+ +
[docs] def warp(self, order): + """对order/market的封装 + + [description] + + Arguments: + order {[type]} -- [description] + + Returns: + [type] -- [description] + """ + + # 因为成交模式对时间的封装 + + if order.order_model == ORDER_MODEL.MARKET: + + if order.frequence is FREQUENCE.DAY: + # exact_time = str(datetime.datetime.strptime( + # str(order.datetime), '%Y-%m-%d %H-%M-%S') + datetime.timedelta(day=1)) + + order.date = order.datetime[0:10] + order.datetime = '{} 09:30:00'.format(order.date) + elif order.frequence in [FREQUENCE.ONE_MIN, FREQUENCE.FIVE_MIN, FREQUENCE.FIFTEEN_MIN, FREQUENCE.THIRTY_MIN, FREQUENCE.SIXTY_MIN]: + print(order.datetime) + exact_time = str(datetime.datetime.strptime( + str(order.datetime), '%Y-%m-%d %H:%M:%S') + datetime.timedelta(minutes=1)) + order.date = exact_time[0:10] + order.datetime = exact_time + self.market_data = self.get_market(order) + if self.market_data is None: + return order + order.price = (float(self.market_data["high"]) + + float(self.market_data["low"])) * 0.5 + elif order.order_model == ORDER_MODEL.NEXT_OPEN: + try: + exact_time = str(datetime.datetime.strptime( + str(order.datetime), '%Y-%m-%d %H-%M-%S') + datetime.timedelta(day=1)) + order.date = exact_time[0:10] + order.datetime = '{} 09:30:00'.format(order.date) + except: + order.datetime = '{} 15:00:00'.format(order.date) + self.market_data = self.get_market(order) + if self.market_data is None: + return order + order.price = float(self.market_data["close"]) + elif order.order_model == ORDER_MODEL.CLOSE: + + try: + order.datetime = self.market_data.datetime + except: + if len(str(order.datetime)) == 19: + pass + else: + order.datetime = '{} 15:00:00'.format(order.date) + self.market_data = self.get_market(order) + if self.market_data is None: + return order + order.price = float(self.market_data["close"]) + + elif order.order_model == ORDER_MODEL.STRICT: + '加入严格模式' + if order.frequence is FREQUENCE.DAY: + exact_time = str(datetime.datetime.strptime( + order.datetime, '%Y-%m-%d %H-%M-%S') + datetime.timedelta(day=1)) + + order.date = exact_time[0:10] + order.datetime = '{} 09:30:00'.format(order.date) + elif order.frequence in [FREQUENCE.ONE_MIN, FREQUENCE.FIVE_MIN, FREQUENCE.FIFTEEN_MIN, FREQUENCE.THIRTY_MIN, FREQUENCE.SIXTY_MIN]: + exact_time = str(datetime.datetime.strptime( + order.datetime, '%Y-%m-%d %H-%M-%S') + datetime.timedelta(minute=1)) + order.date = exact_time[0:10] + order.datetime = exact_time + self.market_data = self.get_market(order) + if self.market_data is None: + return order + if order.towards == 1: + order.price = float(self.market_data["high"]) + else: + order.price = float(self.market_data["low"]) + + return order
+ + +
[docs]class QA_BROKER_EVENT(QA_Event): + def __init__(self, *args, **kwargs): + super().__init__() + + self.event_type = None
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAMarket/QADealer.html b/_build/html/_modules/QUANTAXIS/QAMarket/QADealer.html new file mode 100644 index 000000000..1bc017fbc --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAMarket/QADealer.html @@ -0,0 +1,352 @@ + + + + + + + + QUANTAXIS.QAMarket.QADealer — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAMarket.QADealer

+# coding :utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+#from .market_config import stock_market,future_market,HK_stock_market,US_stock_market
+
+
+from QUANTAXIS.QAUtil import QA_util_log_info, QA_util_random_with_topic
+from QUANTAXIS.QAUtil.QAParameter import MARKET_TYPE, TRADE_STATUS
+
+
+"""撮合类
+
+
+输入是
+
+self.market_data
+self.order
+rules
+
+输出是
+
+standard message
+
+"""
+
+
+
[docs]class commission(): + if_buyside_commission = False + if_sellside_commission = True + if_commission = if_buyside_commission and if_sellside_commission
+ + +
[docs]class dealer_preset(): + def __init__(self, market_type, *args, **kwargs): + + self.market_type = market_type + self.if_price_limit = None # 是否限制涨跌停(美股/加密货币不限制) + self.if_commission = None # 是否收手续费(部分合约/部分加密货币不收手续费) + self.if_tax = None # 是否收税 + self.if_t0 = None # 是否t+0 + self.if_sellopen = None # 是否允许卖空 + self.trading_time = None # 交易时间 + self.commission_coeff = None # 手续费比例 + self.tax_coeff = None # 费率 + +
[docs] def load_preset(self): + if self.market_type is MARKET_TYPE.STOCK_CN: + self.if_price_limit = True # 是否限制涨跌停(美股/加密货币不限制) + self.if_commission = True # 是否收手续费(部分合约/部分加密货币不收手续费) + self.if_tax = True # 是否收税 + self.if_t0 = False # 是否t+0 + self.if_sellopen = False # 是否允许卖空 + self.trading_time = [[930, 1130], [1300, 1500]] # 交易时间 + self.commission_coeff = 0.00025 # 手续费比例 + self.tax_coeff = 0.001 # 费率 + return self + elif self.market_type is MARKET_TYPE.FUTURE_CN: + self.if_price_limit = True # 是否限制涨跌停(美股/加密货币不限制) + self.if_commission = True # 是否收手续费(部分合约/部分加密货币不收手续费) + self.if_tax = False # 是否收税 + self.if_t0 = True # 是否t+0 + self.if_sellopen = True # 是否允许卖空 + self.trading_time = [[930, 1130], [1300, 1500]] # 交易时间 + self.commission_coeff = 0.00025 # 手续费比例 + self.tax_coeff = 0 # 费率 + else: + pass + return self
+ + +
[docs]class QA_Dealer(): + + """[summary] + + + 对于不同的市场规则: + 股票市场 t+1 + 期货/期权/加密货币市场 t+0 + + 股票/加密货币市场不允许卖空 + 期货/期权市场允许卖空 + + t+1的市场是 + 当日的买入 更新持仓- 不更新可卖数量- 资金冻结 + 当日的卖出 及时更新可用资金 + + t+0市场是: + 当日买入 即时更新持仓和可卖 + 当日卖出 即时更新 + + 卖空的规则是 + 允许无仓位的时候卖出证券(按市值和保证金比例限制算) + """ + + def __init__(self, commission_fee_coeff=0.00025, tax_coeff=0.001, *args, **kwargs): + self.commission_fee_coeff = commission_fee_coeff + self.tax_coeff = tax_coeff + self.deal_name = '' + self.deal_engine = {'0x01': self.backtest_stock_dealer} + self.session = {} + self.order = None + self.market_data = None + self.commission_fee = None + self.tax = None + self.status = None + +
[docs] def deal(self, order, market_data): + self.order = order + self.market_data = market_data + self.deal_price = 0 + self.deal_amount = 0 + if order.market_type is MARKET_TYPE.STOCK_CN: + return self.backtest_stock_dealer()
+ +
[docs] def callback_message(self): + # 这是标准的return back message + message = { + 'header': { + 'source': 'market', + 'status': self.status, + 'code': self.order.code, + 'session': { + 'user': self.order.user, + 'strategy': self.order.strategy, + 'account': self.order.account_cookie + }, + 'order_id': self.order.order_id, + 'trade_id': QA_util_random_with_topic('Trade') + }, + 'body': { + 'order': { + 'price': float("%.2f" % float(self.deal_price)), + 'code': self.order.code, + 'amount': self.deal_amount, + 'date': self.order.date, + 'datetime': self.order.datetime, + 'towards': self.order.towards + }, + 'market': { + 'open': self.market_data['open'], + 'high': self.market_data['high'], + 'low': self.market_data['low'], + 'close': self.market_data['close'], + 'volume': self.market_data['volume'], + 'code': self.market_data['code'] + }, + 'fee': { + 'commission': self.commission_fee, + 'tax': self.tax + } + } + } + return message
+ +
[docs] def cal_fee(self): + if self.order.market_type is MARKET_TYPE.STOCK_CN: + if int(self.order.towards) > 0: + commission_fee = self.commission_fee_coeff * \ + float(self.deal_price) * float(self.order.amount) + self.commission_fee = 5 if commission_fee < 5 else commission_fee + + self.tax = 0 # 买入不收印花税 + else: + commission_fee = self.commission_fee_coeff * \ + float(self.deal_price) * float(self.order.amount) + + self.commission_fee = 5 if commission_fee < 5 else commission_fee + + self.tax = self.tax_coeff * \ + float(self.deal_price) * float(self.order.amount) + elif self.order.market_type is MARKET_TYPE.FUTURE_CN: + # 期货不收税 + # 双边手续费 也没有最小手续费限制 + self.commission_fee = self.commission_fee_coeff * \ + float(self.deal_price) * float(self.order.amount) + #self.commission_fee = 5 if commission_fee < 5 else commission_fee + + self.tax = 0 # 买入不收印花税
+ +
[docs] def backtest_stock_dealer(self): + # 新增一个__commission_fee_coeff 手续费系数 + """MARKET ENGINE STOCK + + 在拿到市场数据后对于订单的撮合判断 生成成交信息 + + + trading system + step1: check self.market_data + step2: deal + step3: return callback + """ + try: + if float(self.market_data['open']) == float(self.market_data['high']) == float(self.market_data['close']) == float(self.market_data['low']): + + self.status = TRADE_STATUS.PRICE_LIMIT + self.deal_price = 0 + self.deal_amount = 0 + self.cal_fee() + return self.callback_message() + elif ((float(self.order.price) < float(self.market_data["high"]) and + float(self.order.price) > float(self.market_data["low"])) or + float(self.order.price) == float(self.market_data["low"]) or + float(self.order.price) == float(self.market_data['high'])): + '能成功交易的情况 有滑点调整' + if float(self.order.amount) < float(self.market_data['volume']) * 100 / 16: + self.deal_price = self.order.price + self.deal_amount = self.order.amount + elif float(self.order.amount) >= float(self.market_data['volume']) * 100 / 16 and \ + float(self.order.amount) < float(self.market_data['volume']) * 100 / 8: + """ + add some slippers + + buy_price=mean(max{open,close},high) + sell_price=mean(min{open,close},low) + """ + if int(self.order.towards) > 0: + self.deal_price = (max(float(self.market_data['open']), float( + self.market_data['close'])) + float(self.market_data['high'])) * 0.5 + else: + self.deal_price = (min(float(self.market_data['open']), float( + self.market_data['close'])) + float(self.market_data['low'])) * 0.5 + self.deal_amount = self.order.amount + + else: + self.deal_amount = float(self.market_data['volume']) / 8 + if int(self.order.towards) > 0: + self.deal_price = float(self.market_data['high']) + else: + self.deal_price = float(self.market_data['low']) + + self.cal_fee() + self.status = TRADE_STATUS.SUCCESS + return self.callback_message() + else: + self.status = TRADE_STATUS.FAILED + self.deal_price = 0 + self.deal_amount = 0 + self.cal_fee() + return self.callback_message() + + except Exception as e: + QA_util_log_info('MARKET ENGINE ERROR: {}'.format(e)) + self.status = TRADE_STATUS.NO_MARKET_DATA + return self.callback_message()
+ + + +
[docs]class Stock_Dealer(QA_Dealer): + def __init__(self, *args, **kwargs): + super().__init__()
+ +if __name__ == '__main__': + pass +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAMarket/QAMarket.html b/_build/html/_modules/QUANTAXIS/QAMarket/QAMarket.html new file mode 100644 index 000000000..7c5687b9e --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAMarket/QAMarket.html @@ -0,0 +1,399 @@ + + + + + + + + QUANTAXIS.QAMarket.QAMarket — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAMarket.QAMarket

+# coding :utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+
+from QUANTAXIS.QAARP.QAAccount import QA_Account
+from QUANTAXIS.QAEngine.QAEvent import QA_Event
+from QUANTAXIS.QAEngine.QATask import QA_Task
+from QUANTAXIS.QAMarket.QABacktestBroker import QA_BacktestBroker
+from QUANTAXIS.QAMarket.QARandomBroker import QA_RandomBroker
+from QUANTAXIS.QAMarket.QARealBroker import QA_RealBroker
+from QUANTAXIS.QAMarket.QASimulatedBroker import QA_SimulatedBroker
+from QUANTAXIS.QAMarket.QATrade import QA_Trade
+from QUANTAXIS.QAUtil.QAParameter import (ACCOUNT_EVENT, AMOUNT_MODEL,
+                                          BROKER_EVENT, BROKER_TYPE,
+                                          ENGINE_EVENT, MARKET_EVENT,
+                                          FREQUENCE, ORDER_EVENT,
+                                          ORDER_MODEL)
+from QUANTAXIS.QAUtil.QALogs import QA_util_log_info
+
+
+
[docs]class QA_Market(QA_Trade): + """ + QUANTAXIS MARKET 部分 + + 交易前置/可连接到多个broker中 + + 暂时还是采用多线程engine模式 + + """ + + def __init__(self, *args, **kwargs): + super().__init__() + self.session = {} + self._broker = {BROKER_TYPE.BACKETEST: QA_BacktestBroker, BROKER_TYPE.RANODM: QA_RandomBroker, + BROKER_TYPE.REAL: QA_RealBroker, BROKER_TYPE.SIMULATION: QA_SimulatedBroker} + + self.broker = {} + self.running_time = None + self.last_query_data = None + + def __repr__(self): + return '< QA_MARKET with {} Broker >'.format(list(self.broker.keys())) + +
[docs] def upcoming_data(self, broker, data): + # main thread' + + # if self.running_time is not None and self.running_time!= data.datetime[0]: + # for item in self.broker.keys(): + # self._settle(item) + + self.running_time = data.datetime[0] + for item in self.session.values(): + # session里面是已经注册的account + self.event_queue.put(QA_Task( + worker=item, + event=QA_Event( + event_type=ENGINE_EVENT.UPCOMING_DATA, + market_data=data, + broker_name=broker, + send_order=self.insert_order, + query_data=self.query_data_no_wait, + query_order=self.query_order, + query_assets=self.query_assets, + query_trade=self.query_trade + ) + ))
+ +
[docs] def start(self): + self.trade_engine.start()
+ # self.trade_engine.create_kernal('MARKET') + # self.trade_engine.start_kernal('MARKET') + +
[docs] def connect(self, broker): + if broker in self._broker.keys(): + + self.broker[broker] = self._broker[broker]() # 在这里实例化 + self.trade_engine.create_kernal('{}'.format(broker)) + self.trade_engine.start_kernal('{}'.format(broker)) + # 开启trade事件子线程 + return True + else: + return False
+ +
[docs] def register(self, broker_name, broker): + if broker_name not in self._broker.keys(): + self.broker[broker_name] = broker + self.trade_engine.create_kernal('{}'.format(broker_name)) + self.trade_engine.start_kernal('{}'.format(broker_name)) + return True + else: + return False
+ +
[docs] def get_account(self, account_cookie): + return self.session[account_cookie]
+ +
[docs] def login(self, broker_name, account_cookie, account=None): + if account is None: + if account_cookie not in self.session.keys(): + self.session[account_cookie] = QA_Account( + account_cookie=account_cookie, broker=broker_name) + return True + else: + return False + else: + if account_cookie not in self.session.keys(): + account.broker = broker_name + self.session[account_cookie] = account + return True + else: + return False
+ +
[docs] def logout(self, account_cookie, broker_name): + if account_cookie not in self.session.keys(): + return False + else: + self.session.pop(account_cookie)
+ +
[docs] def get_trading_day(self): + return self.running_time
+ +
[docs] def get_account_id(self): + return list(self.session.keys())
+ +
[docs] def insert_order(self, account_id, amount, amount_model, time, code, price, order_model, towards, market_type, frequence, broker_name): + + flag = False + if order_model in [ORDER_MODEL.CLOSE, ORDER_MODEL.NEXT_OPEN]: + _price = self.query_data_no_wait(broker_name=broker_name, frequence=frequence, + market_type=market_type, code=code, start=time) + + if _price is not None and len(_price) > 0: + price = float(_price[0][4]) + flag = True + else: + QA_util_log_info('MARKET WARING: SOMEING WRONG WITH ORDER \n ') + QA_util_log_info('code {} date {} price {} order_model {} amount_model {}'.format( + code, time, price, order_model, amount_model)) + elif order_model is ORDER_MODEL.MARKET: + _price = self.query_data_no_wait(broker_name=broker_name, frequence=frequence, + market_type=market_type, code=code, start=time) + if _price is not None and len(_price) > 0: + price = float(_price[0][1]) + flag = True + else: + QA_util_log_info('MARKET WARING: SOMEING WRONG WITH ORDER \n ') + QA_util_log_info('code {} date {} price {} order_model {} amount_model {}'.format( + code, time, price, order_model, amount_model)) + + elif order_model is ORDER_MODEL.LIMIT: + # if price > self.last_query_data[0][2] or price < self.last_query_data[0][3]: + flag = True + if flag: + order = self.get_account(account_id).send_order( + amount=amount, amount_model=amount_model, time=time, code=code, price=price, + order_model=order_model, towards=towards) + self.event_queue.put( + QA_Task( + worker=self.broker[self.get_account(account_id).broker], + engine=self.get_account(account_id).broker, + event=QA_Event( + event_type=BROKER_EVENT.RECEIVE_ORDER, + order=order, + callback=self.on_insert_order))) + else: + pass
+ +
[docs] def on_insert_order(self, order): + print(order)
+ + def _renew_account(self): + for item in self.session.values(): + + self.event_queue.put( + QA_Task( + worker=item, + event=QA_Event( + event_type=ACCOUNT_EVENT.SETTLE))) + +
[docs] def query_order(self, broker_name, order_id): + + res = self.event_queue.put( + QA_Task( + worker=self.broker[broker_name], + engine=broker_name, + event=QA_Event( + order_id=order_id + ) + )) + + return res
+ +
[docs] def query_assets(self, account_cookie): + return self.get_account(account_cookie).assets
+ +
[docs] def query_position(self, account_cookie): + return self.get_account(account_cookie).hold
+ +
[docs] def query_cash(self, account_cookie): + return self.get_account(account_cookie).cash_available
+ +
[docs] def query_data_no_wait(self, broker_name, frequence, market_type, code, start, end=None): + return self.broker[broker_name].run(event=QA_Event( + event_type=MARKET_EVENT.QUERY_DATA, + frequence=frequence, + market_type=market_type, + code=code, + start=start, + end=end + ))
+ +
[docs] def query_data(self, broker_name, frequence, market_type, code, start, end=None): + self.event_queue.put( + QA_Task( + worker=self.broker[broker_name], + engine=broker_name, + event=QA_Event( + event_type=MARKET_EVENT.QUERY_DATA, + frequence=frequence, + market_type=market_type, + code=code, + start=start, + end=end, + callback=self.on_query_data + ) + ))
+ +
[docs] def query_currentbar(self, broker_name, market_type, code): + return self.broker[broker_name].run(event=QA_Event( + event_type=MARKET_EVENT.QUERY_DATA, + frequence=FREQUENCE.CURRENT, + market_type=market_type, + code=code, + start=self.running_time, + end=None + ))
+ +
[docs] def on_query_data(self, data): + print('ON QUERY') + print(data) + self.last_query_data = data
+ +
[docs] def on_trade_event(self, event): + print('ON TRADE') + print(event.res)
+ + def _trade(self, event): + "内部函数" + + self.event_queue.put(QA_Task( + worker=self.broker[event.broker_name], + engine=event.broker_name, + event=QA_Event( + event_type=BROKER_EVENT.TRADE, + broker=self.broker[event.broker_name], + broker_name=event.broker_name, + callback=self.on_trade_event + ))) + + def _settle(self, broker_name, callback=False): + # 向事件线程发送BROKER的SETTLE事件 + + # 向事件线程发送ACCOUNT的SETTLE事件 + for item in self.session.values(): + if item.broker is broker_name: + self.event_queue.put( + QA_Task( + worker=item, + engine=broker_name, + event=QA_Event( + event_type=ACCOUNT_EVENT.SETTLE))) + self.event_queue.put(QA_Task( + worker=self.broker[broker_name], + engine=broker_name, + event=QA_Event( + event_type=BROKER_EVENT.SETTLE, + broker=self.broker[broker_name], + callback=callback))) + + print('===== SETTLED {} ====='.format(self.running_time)) + + def _close(self): + pass + +
[docs] def clear(self): + return self.trade_engine.clear()
+ + +if __name__ == '__main__': + + import QUANTAXIS as QA + + user = QA.QA_Portfolio() + # 创建两个account + + a_1 = user.new_account() + a_2 = user.new_account() + market = QA_Market() + + market.connect(QA.RUNNING_ENVIRONMENT.BACKETEST) + # +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAMarket/QAOrder.html b/_build/html/_modules/QUANTAXIS/QAMarket/QAOrder.html new file mode 100644 index 000000000..623c7ff75 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAMarket/QAOrder.html @@ -0,0 +1,323 @@ + + + + + + + + QUANTAXIS.QAMarket.QAOrder — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAMarket.QAOrder

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+
+import pandas as pd
+
+from QUANTAXIS.QAUtil import (QA_util_log_info, QA_util_random_with_topic,
+                              QA_util_to_json_from_pandas)
+from QUANTAXIS.QAUtil.QAParameter import AMOUNT_MODEL, ORDER_STATUS
+
+
+"""
+重新定义Order模式
+
+在2017-12-15的Account-remake-version 分支中
+
+Bid类全部被更名为Order类
+
+用于和 bid_ask 区分
+
+by yutiansut@2017/12/15
+
+
+@2018/1/9
+需要重新考虑 order的重复创建耗时问题
+
+order_frame 是一个管理性面板  但是还是需要一个缓存dict
+
+"""
+
+
+
[docs]class QA_Order(): + def __init__(self, price=None, date=None, datetime=None, sending_time=None, transact_time=None, amount=None, market_type=None, frequence=None, + towards=None, code=None, user=None, account_cookie=None, strategy=None, order_model=None, amount_model=AMOUNT_MODEL.BY_AMOUNT, + order_id=None, trade_id=None, status='100', callback=False, *args, **kwargs): + """委托字段 + price 委托的价格 + date 委托的日期 + datetime 委托的时间 + sending_time 发送委托单的时间 + transact_time 委托成交的时间 + amount 委托量 + market_type 委托的市场 + frequence 频率 + towards 委托方向 + code 委托代码 + user 委托股东 + account_cookie 委托账户的cookie + strategy 策略名 + order_model 委托方式(限价/市价/下一个bar/) + amount_model 委托量模式(按量委托/按总成交额委托) + order_id 委托单id + trade_id 成交id + status 订单状态 + callback 回调函数 + """ + + self.price = price + self.datetime = None + if datetime is None and date is not None: + self.date = date + self.datetime = '{} 09:31:00'.format(self.date) + + elif date is None and datetime is not None: + self.date = datetime[0:10] + self.datetime = datetime + + elif date is not None and datetime is not None: + self.date = date + self.datetime = datetime + else: + pass + self.sending_time = self.datetime if sending_time is None else sending_time # 下单时间 + self.transact_time = transact_time + self.amount = amount + self.towards = towards # side + self.code = code + self.user = user + self.market_type = market_type + self.frequence = frequence + self.account_cookie = account_cookie + self.strategy = strategy + self.type = market_type # see below + self.order_model = order_model + self.amount_model = amount_model + self.order_id = QA_util_random_with_topic( + topic='Order') if order_id is None else order_id + self.trade_id = trade_id + self.status = status + self.callback = callback + + def __repr__(self): + return '< QA_Order datetime:{} code:{} price:{} towards:{} btype:{} order_id:{} account:{} status:{} >'.format( + self.datetime, self.code, self.price, self.towards, self.type, self.order_id, self.account_cookie, self.status) + +
[docs] def info(self): + return vars(self)
+ +
[docs] def to_df(self): + return pd.DataFrame([vars(self), ])
+ +
[docs] def to_dict(self): + return vars(self)
+ +
[docs] def from_dict(self, order): + try: + # QA_util_log_info('QA_ORDER CHANGE: from {} change to {}'.format( + # self.order_id, order['order_id'])) + self.price = order['price'] + self.date = order['date'] + self.datetime = order['datetime'] + self.sending_time = order['sending_time'] # 下单时间 + self.transact_time = order['transact_time'] + self.amount = order['amount'] + self.frequence = order['frequence'] + self.market_type = order['market_type'] + self.towards = order['towards'] + self.code = order['code'] + self.user = order['user'] + self.account_cookie = order['account_cookie'] + self.strategy = order['strategy'] + self.type = order['type'] + self.order_model = order['order_model'] + self.amount_model = order['amount_model'] + self.order_id = order['order_id'] + self.trade_id = order['trade_id'] + self.callback = order['callback'] + return self + except Exception as e: + QA_util_log_info('Failed to tran from dict {}'.format(e))
+ + +
[docs]class QA_OrderQueue(): # also the order tree + """ + 一个待成交队列 + 这里面都是对于方法的封装 + + """ + + def __init__(self): + self.order_list = [] + self.queue = pd.DataFrame() + self._queue = {} + + def __repr__(self): + return '< QA_OrderQueue AMOUNT {} WAITING TRADE {} >'.format(len(self.queue), len(self.pending)) + + def __call__(self): + return self.queue + + def _from_dataframe(self, dataframe): + try: + self.order_list = [QA_Order().from_dict(item) + for item in QA_util_to_json_from_pandas(dataframe)] + return self.order_list + except: + pass + +
[docs] def insert_order(self, order): + order.status = ORDER_STATUS.QUEUED + self.queue = self.queue.append( + order.to_df(), ignore_index=True) + self.queue.set_index('order_id', drop=False, inplace=True) + self._queue[order.order_id] = order + return order
+ + @property + def order_ids(self): + return self.queue.index + +
[docs] def settle(self): + """结算 + + 清空订单簿 + """ + self.queue = pd.DataFrame() + self._queue = {}
+ + @property + def pending(self): + """选择待成交列表 + + [description] + + Returns: + dataframe + """ + try: + return self.queue.query('status!=200').query('status!=500').query('status!=400') + except: + return pd.DataFrame() + + @property + def trade_list(self): + """批量交易 + + [description] + + Returns: + list of orders + """ + + return [self._queue[order_id] for order_id in self.pending.index] + +
[docs] def query_order(self, order_id): + + return self.queue.get(order_id, None)
+ +
[docs] def set_status(self, order_id, new_status): + try: + if order_id in self.order_ids: + self.queue.loc[order_id, 'status'] = new_status + self._queue[order_id].status = new_status + else: + pass + except: + return None
+ + +if __name__ == '__main__': + ax = QA_Order() + + print(ax.info()) + print(ax.to_df()) +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAMarket/QAOrderHandler.html b/_build/html/_modules/QUANTAXIS/QAMarket/QAOrderHandler.html new file mode 100644 index 000000000..2c5003935 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAMarket/QAOrderHandler.html @@ -0,0 +1,168 @@ + + + + + + + + QUANTAXIS.QAMarket.QAOrderHandler — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAMarket.QAOrderHandler

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+
+from QUANTAXIS.QAEngine.QAEvent import QA_Event, QA_Worker
+from QUANTAXIS.QAMarket.QAOrder import QA_OrderQueue
+from QUANTAXIS.QAUtil.QAParameter import (BROKER_EVENT, EVENT_TYPE,
+                                          MARKET_EVENT, ORDER_EVENT)
+
+
+
[docs]class QA_OrderHandler(QA_Worker): + """ORDER执行器 + + + ORDEHANDLDER 归属于MARKET前置 + + 仅负责一个无状态的执行层 + + ORDER执行器的作用是因为 + 在实盘中 当一个订单发送出去的时候,市场不会返回一个更新的订单类回来 + 大部分时间都依赖子线程主动查询 或者是一个市场信息来进行判断 + + ORDER_Handler的作用就是根据信息更新Order + + 用于接受订单 发送给相应的marker_broker 再根据返回的信息 进行更新 + + 可用的market_broker: + 1.回测盘 + 2.实时模拟盘 + 3.实盘 + + """ + + def __init__(self, *args, **kwargs): + super().__init__() + self.order_queue = QA_OrderQueue() + self.type = EVENT_TYPE.MARKET_EVENT + + self.event = QA_Event() + +
[docs] def run(self, event): + if event.event_type is BROKER_EVENT.RECEIVE_ORDER: + # 此时的message应该是订单类 + order = self.order_queue.insert_order(event.order) + if event.callback: + event.callback(order) + + elif event.event_type is BROKER_EVENT.TRADE: + res=[] + for item in self.order_queue.trade_list: + result=event.broker.receive_order( + QA_Event(event_type=BROKER_EVENT.TRADE, order=item)) + self.order_queue.set_status( + item.order_id, result['header']['status']) + if item.callback: + item.callback(result) + res.append(result) + event.res = res + + return event + + elif event.event_type is BROKER_EVENT.SETTLE: + self.order_queue.settle() + + elif event.event_type is MARKET_EVENT.QUERY_ORDER: + return self.query_order(event.order_id)
+ +
[docs] def query_order(self, order_id): + return self.order_queue.queue.query()
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAMarket/QARandomBroker.html b/_build/html/_modules/QUANTAXIS/QAMarket/QARandomBroker.html new file mode 100644 index 000000000..fef0168bd --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAMarket/QARandomBroker.html @@ -0,0 +1,118 @@ + + + + + + + + QUANTAXIS.QAMarket.QARandomBroker — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAMarket.QARandomBroker

+# coding :utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+
+from QUANTAXIS.QAMarket.QABroker import QA_Broker
+
+
+
[docs]class QA_RandomBroker(QA_Broker): + def __init__(self, *args, **kwargs): + pass + +
[docs] def get_data(self, order): + pass
+ +
[docs] def warp(self, order): + pass
+ +
[docs] def receive_order(self, order): + pass
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAMarket/QARealBroker.html b/_build/html/_modules/QUANTAXIS/QAMarket/QARealBroker.html new file mode 100644 index 000000000..d5401996d --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAMarket/QARealBroker.html @@ -0,0 +1,118 @@ + + + + + + + + QUANTAXIS.QAMarket.QARealBroker — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAMarket.QARealBroker

+# coding :utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+
+from QUANTAXIS.QAMarket.QABroker import QA_Broker
+
+
+
[docs]class QA_RealBroker(QA_Broker): + def __init__(self, *args, **kwargs): + pass + +
[docs] def get_data(self, order): + pass
+ +
[docs] def warp(self, order): + pass
+ +
[docs] def receive_order(self,order): + pass
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAMarket/QASimulatedBroker.html b/_build/html/_modules/QUANTAXIS/QAMarket/QASimulatedBroker.html new file mode 100644 index 000000000..597b3ff20 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAMarket/QASimulatedBroker.html @@ -0,0 +1,163 @@ + + + + + + + + QUANTAXIS.QAMarket.QASimulatedBroker — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAMarket.QASimulatedBroker

+# coding :utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+from QUANTAXIS.QAMarket.QABroker import QA_Broker
+from QUANTAXIS.QAFetch.QATdx import (QA_fetch_get_future_day,
+                                     QA_fetch_get_future_min,
+                                     QA_fetch_get_index_day,
+                                     QA_fetch_get_index_min,
+                                     QA_fetch_get_stock_day,
+                                     QA_fetch_get_stock_min)
+from QUANTAXIS.QAMarket.QADealer import QA_Dealer
+from QUANTAXIS.QAUtil.QAParameter import MARKET_TYPE, FREQUENCE
+from QUANTAXIS.QAUtil.QALogs import QA_util_log_info
+
+
[docs]class QA_SimulatedBroker(QA_Broker): + def __init__(self, *args, **kwargs): + self.dealer = QA_Dealer() + self.fetcher = {(MARKET_TYPE.STOCK_CN, FREQUENCE.DAY): QA_fetch_get_stock_day, (MARKET_TYPE.STOCK_CN, FREQUENCE.FIFTEEN_MIN): QA_fetch_get_stock_min, + (MARKET_TYPE.STOCK_CN, FREQUENCE.ONE_MIN): QA_fetch_get_stock_min, (MARKET_TYPE.STOCK_CN, FREQUENCE.FIVE_MIN): QA_fetch_get_stock_min, + (MARKET_TYPE.STOCK_CN, FREQUENCE.THIRTY_MIN): QA_fetch_get_stock_min, (MARKET_TYPE.STOCK_CN, FREQUENCE.SIXTY_MIN): QA_fetch_get_stock_min, + (MARKET_TYPE.INDEX_CN, FREQUENCE.DAY): QA_fetch_get_index_day, (MARKET_TYPE.INDEX_CN, FREQUENCE.FIFTEEN_MIN): QA_fetch_get_index_min, + (MARKET_TYPE.INDEX_CN, FREQUENCE.ONE_MIN): QA_fetch_get_index_min, (MARKET_TYPE.INDEX_CN, FREQUENCE.FIVE_MIN): QA_fetch_get_index_min, + (MARKET_TYPE.INDEX_CN, FREQUENCE.THIRTY_MIN): QA_fetch_get_index_min, (MARKET_TYPE.INDEX_CN, FREQUENCE.SIXTY_MIN): QA_fetch_get_index_min, + (MARKET_TYPE.FUND_CN, FREQUENCE.DAY): QA_fetch_get_index_day, (MARKET_TYPE.FUND_CN, FREQUENCE.FIFTEEN_MIN): QA_fetch_get_index_min, + (MARKET_TYPE.FUND_CN, FREQUENCE.ONE_MIN): QA_fetch_get_index_min, (MARKET_TYPE.FUND_CN, FREQUENCE.FIVE_MIN): QA_fetch_get_index_min, + (MARKET_TYPE.FUND_CN, FREQUENCE.THIRTY_MIN): QA_fetch_get_index_min, (MARKET_TYPE.FUND_CN, FREQUENCE.SIXTY_MIN): QA_fetch_get_index_min} + +
[docs] def get_market(self, order): + try: + data = self.fetcher[(order.market_type, order.frequence)]( + code=order.code, start=order.datetime, end=order.datetime).values[0] + if 'vol' in data.keys() and 'volume' not in data.keys(): + data['volume'] = data['vol'] + elif 'vol' not in data.keys() and 'volume' in data.keys(): + data['vol'] = data['volume'] + return data + except Exception as e: + QA_util_log_info('MARKET_ENGING ERROR: {}'.format(e)) + return None
+ + + +
[docs] def receive_order(self, event): + order = event.order + + if 'market_data' in event.__dict__.keys(): + self.market_data = self.get_market( + order) if event.market_data is None else event.market_data + else: + self.market_data = self.get_market(order) + + order = self.warp(order) + + return self.dealer.deal(order, self.market_data)
+ +
[docs] def query_data(self, code, start, end, frequence, market_type=None): + """ + 标准格式是numpy + """ + try: + return self.fetcher[(market_type, frequence)]( + code, start, end, frequence=frequence) + except: + pass
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAMarket/QATrade.html b/_build/html/_modules/QUANTAXIS/QAMarket/QATrade.html new file mode 100644 index 000000000..da7beba50 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAMarket/QATrade.html @@ -0,0 +1,206 @@ + + + + + + + + QUANTAXIS.QAMarket.QATrade — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAMarket.QATrade

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+from QUANTAXIS.QAEngine.QAThreadEngine import QA_Engine
+
+# 交易封装
+
+
+
[docs]class QA_Trade(): + "多线程+generator模式" + + def __init__(self, *args, **kwargs): + self.trade_engine = QA_Engine() + self.event_queue = self.trade_engine.queue + + # self.spi_thread.start() + +
[docs] def connect(self, *args, **kwargs): + + pass
+ +
[docs] def on_connect(self, *args, **kwargs): + pass
+ +
[docs] def release(self, *args, **kwargs): + pass
+ +
[docs] def get_trading_day(self, *args, **kwargs): + pass
+ +
[docs] def register_spi(self, *args, **kwargs): + pass
+ +
[docs] def get_api_last_error(self, *args, **kwargs): + pass
+ +
[docs] def get_api_version(self, *args, **kwargs): + pass
+ +
[docs] def get_client_id(self, *args, **kwargs): + pass
+ +
[docs] def get_account_id(self, *args, **kwargs): + pass
+ +
[docs] def subscribe_public_topic(self, *args, **kwargs): + pass
+ +
[docs] def login(self, *args, **kwargs): + pass
+ +
[docs] def logout(self, *args, **kwargs): + pass
+ +
[docs] def insert_order(self, *args, **kwargs): + pass
+ +
[docs] def on_insert_order(self, *args, **kwargs): + pass
+ +
[docs] def cancel_order(self, *args, **kwargs): + pass
+ +
[docs] def on_cancel_order(self, *args, **kwargs): + pass
+ +
[docs] def query_order(self, *args, **kwargs): + pass
+ +
[docs] def on_query_order(self, *args, **kwargs): + pass
+ +
[docs] def query_trade(self, *args, **kwargs): + pass
+ +
[docs] def on_query_trade(self, *args, **kwargs): + pass
+ +
[docs] def query_position(self, *args, **kwargs): + pass
+ +
[docs] def on_query_position(self, *args, **kwargs): + pass
+ +
[docs] def query_assets(self, *args, **kwargs): + pass
+ +
[docs] def on_query_assets(self, *args, **kwargs): + pass
+ +
[docs] def query_data(self, *args, **kwargs): + pass
+ +
[docs] def on_query_data(self, *args, **kwargs): + pass
+ +
[docs] def on_error(self, *args, **kwargs): + pass
+ +
[docs] def on_order_event(self, *args, **kwargs): + pass
+ +
[docs] def on_trade_event(self, *args, **kwargs): + pass
+ +
[docs] def on_cancel_order_event(self, *args, **kwargs): + pass
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAMarket/shipaneBroker.html b/_build/html/_modules/QUANTAXIS/QAMarket/shipaneBroker.html new file mode 100644 index 000000000..99bb6117e --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAMarket/shipaneBroker.html @@ -0,0 +1,228 @@ + + + + + + + + QUANTAXIS.QAMarket.shipaneBroker — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAMarket.shipaneBroker

+# coding:utf-8
+
+
+import requests
+import json
+import urllib
+import base64
+import pandas as pd
+from cryptography.hazmat.backends import default_backend
+from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
+from QUANTAXIS.QAMarket.QABroker import QA_Broker
+try:
+    from pytdx.log import log
+except ImportError:
+    def log(x):
+        return None
+
+
+
[docs]class SPETradeApi(QA_Broker): + def __init__(self, endpoint="http://127.0.0.1:8888"): + + self._endpoint = endpoint + self._session = requests.Session() + +
[docs] def call(self, func, params=None): + + json_obj = { + "func": func + } + + if params is not None: + json_obj["params"] = params + + response = self._session.post(self._endpoint, json=json_obj) + + text = response.text + + return json.loads(text)
+ +
[docs] def data_to_df(self, result): + if 'data' in result: + data = result['data'] + return pd.DataFrame(data=data)
+ + #------ functions + +
[docs] def ping(self): + + return self.call("ping", {})
+ +
[docs] def logon(self, ip, port, version, yyb_id, account_id, trade_account, jy_passwrod, tx_password): + return self.call("logon", { + "ip": ip, + "port": port, + "version": version, + "yyb_id": yyb_id, + "account_no": account_id, + "trade_account": trade_account, + "jy_password": jy_passwrod, + "tx_password": tx_password + })
+ +
[docs] def logoff(self, client_id): + return self.call("logoff", { + "client_id": client_id + })
+ +
[docs] def query_data(self, client_id, category): + return self.call("query_data", { + "client_id": client_id, + "category": category + })
+ +
[docs] def send_order(self, client_id, category, price_type, gddm, zqdm, price, quantity): + return self.call("send_order", { + 'client_id': client_id, + 'category': category, + 'price_type': price_type, + 'gddm': gddm, + 'zqdm': zqdm, + 'price': price, + 'quantity': quantity + })
+ +
[docs] def cancel_order(self, client_id, exchange_id, hth): + return self.call("cancel_order", { + 'client_id': client_id, + 'exchange_id': exchange_id, + 'hth': hth + })
+ +
[docs] def get_quote(self, client_id, code): + return self.call("get_quote", { + 'client_id': client_id, + 'code': code, + })
+ +
[docs] def repay(self, client_id, amount): + return self.call("repay", { + 'client_id': client_id, + 'amount': amount + })
+ +
[docs] def receive_order(self, event): + """ + 0 限价委托; 上海限价委托 / 深圳限价委托 + 1 市价委托(深圳对方最优价格) + 2 市价委托(深圳本方最优价格) + 3 市价委托(深圳即时成交剩余撤销) + 4 市价委托(上海五档即成剩撤 / 深圳五档即成剩撤) + 5 市价委托(深圳全额成交或撤销) + 6 市价委托(上海五档即成转限价) + """ + return self.send_order(event.client_id, event.category, event.price_type, event.gddm, event.zqdm, event.price, event.quantity)
+ #client_id, category, price_type, gddm, zqdm, price, quantity + +
[docs] def run(self, event): + pass
+ + +if __name__ == "__main__": + import os + api = SPETradeApi(endpoint="http://10.11.5.175:10092/api", + enc_key=b"4f1cf3fec4c84c84", enc_iv=b"0c78abc083b011e7") + #api = SPETradeApi(endpoint="http://10.11.5.175:10092/api") + print("---Ping---") + result = api.ping() + print(result) + + print("---登入---") + acc = os.getenv("TDX_ACCOUNT", "") + password = os.getenv("TDX_PASS", "") + result = api.logon("202.108.253.186", 7708, + "8.23", 32, + acc, acc, password, "") + + print(result) + + if result["success"]: + client_id = result["data"]["client_id"] + + for i in (0, 1, 2, 3, 4, 5, 6, 7, 8, 12, 13, 14, 15): + print("---查询信息 cate=%d--" % i) + print(api.data_to_df(api.query_data(client_id, i))) + + print("---查询报价---") + print(api.data_to_df(api.get_quote(client_id, '600315'))) + + print("---登出---") + print(api.logoff(client_id)) +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAMarket/shipaneclient.html b/_build/html/_modules/QUANTAXIS/QAMarket/shipaneclient.html new file mode 100644 index 000000000..24ae4174a --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAMarket/shipaneclient.html @@ -0,0 +1,361 @@ + + + + + + + + QUANTAXIS.QAMarket.shipaneclient — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAMarket.shipaneclient

+# -*- coding: utf-8 -*-
+
+import copy
+import datetime
+import re
+from enum import Enum
+from urllib.parse import urlencode
+
+import lxml.html
+import pandas as pd
+import requests
+import six
+import tushare as ts
+from lxml import etree
+from pandas.compat import StringIO
+from requests import Request
+from requests.auth import HTTPBasicAuth
+
+
+
[docs]class MediaType(Enum): + DEFAULT = 'application/json' + JOIN_QUANT = 'application/vnd.joinquant+json'
+ + +
[docs]class ConnectionMethod(Enum): + DIRECT = 'DIRECT' + PROXY = 'PROXY'
+ + +
[docs]class Client(object): + KEY_REGEX = r'key=([^&]*)' + + def __init__(self, logger=None, **kwargs): + if logger is not None: + self._logger = logger + else: + import logging + self._logger = logging.getLogger(__name__) + self._connection_method = ConnectionMethod[kwargs.pop('connection_method', 'DIRECT')] + if self._connection_method is ConnectionMethod.DIRECT: + self._host = kwargs.pop('host', 'localhost') + self._port = kwargs.pop('port', 8888) + else: + self._proxy_base_url = kwargs.pop('proxy_base_url') + self._proxy_username = kwargs.pop('proxy_username') + self._proxy_password = kwargs.pop('proxy_password') + self._instance_id = kwargs.pop('instance_id') + self._base_url = self.__create_base_url() + self._key = kwargs.pop('key', '') + self._client = kwargs.pop('client', '') + self._timeout = kwargs.pop('timeout', (5.0, 10.0)) + + @property + def host(self): + return self._host + + @host.setter + def host(self, value): + self._host = value + + @property + def port(self): + return self._port + + @port.setter + def port(self, value): + self._port = value + + @property + def key(self): + return self._key + + @key.setter + def key(self, value): + self._key = value + + @property + def timeout(self): + return self._timeout + + @timeout.setter + def timeout(self, value): + self._timeout = value + +
[docs] def get_statuses(self, timeout=None): + request = Request('GET', self.__create_url(None, 'statuses')) + self.__send_request(request, timeout)
+ +
[docs] def get_account(self, client=None, timeout=None): + request = Request('GET', self.__create_url(client, 'accounts')) + response = self.__send_request(request, timeout) + return response.json()
+ +
[docs] def get_positions(self, client=None, media_type=MediaType.DEFAULT, timeout=None): + request = Request('GET', self.__create_url(client, 'positions')) + request.headers['Accept'] = media_type.value + response = self.__send_request(request, timeout) + json = response.json() + if media_type == MediaType.DEFAULT: + sub_accounts = pd.DataFrame(json['subAccounts']).T + positions = pd.DataFrame(json['dataTable']['rows'], columns=json['dataTable']['columns']) + portfolio = {'sub_accounts': sub_accounts, 'positions': positions} + return portfolio + return json
+ +
[docs] def get_orders(self, client=None, status="", timeout=None): + request = Request('GET', self.__create_url(client, 'orders', status=status)) + response = self.__send_request(request, timeout) + json = response.json() + df = pd.DataFrame(json['dataTable']['rows'], columns=json['dataTable']['columns']) + return df
+ +
[docs] def buy(self, client=None, timeout=None, **kwargs): + kwargs['action'] = 'BUY' + return self.__execute(client, timeout, **kwargs)
+ +
[docs] def sell(self, client=None, timeout=None, **kwargs): + kwargs['action'] = 'SELL' + return self.__execute(client, timeout, **kwargs)
+ +
[docs] def ipo(self, client=None, timeout=None, **kwargs): + kwargs['action'] = 'IPO' + return self.__execute(client, timeout, **kwargs)
+ +
[docs] def execute(self, client=None, timeout=None, **kwargs): + return self.__execute(client, timeout, **kwargs)
+ +
[docs] def cancel(self, client=None, order_id=None, timeout=None): + request = Request('DELETE', self.__create_order_url(client, order_id)) + self.__send_request(request, timeout)
+ +
[docs] def cancel_all(self, client=None, timeout=None): + request = Request('DELETE', self.__create_order_url(client)) + self.__send_request(request, timeout)
+ +
[docs] def query(self, client=None, navigation=None, timeout=None): + request = Request('GET', self.__create_url(client, '', navigation=navigation)) + response = self.__send_request(request, timeout) + json = response.json() + df = pd.DataFrame(json['dataTable']['rows'], columns=json['dataTable']['columns']) + return df
+ +
[docs] def query_new_stocks(self): + return self.__query_new_stocks()
+ +
[docs] def query_convertible_bonds(self): + return self.__query_convertible_bonds()
+ +
[docs] def purchase_new_stocks(self, client=None, timeout=None): + today = datetime.datetime.strftime(datetime.datetime.today(), '%Y-%m-%d') + df = self.query_new_stocks() + df = df[(df.ipo_date == today)] + self._logger.info('今日有[{}]支可申购新股'.format(len(df))) + for index, row in df.iterrows(): + try: + order = { + 'symbol': row['xcode'], + 'price': row['price'], + 'amountProportion': 'ALL' + } + self._logger.info('申购新股:{}'.format(order)) + self.ipo(client, timeout, **order) + except Exception as e: + self._logger.error( + '客户端[{}]申购新股[{}({})]失败\n{}'.format((client or self._client), row['name'], row['code'], e))
+ +
[docs] def purchase_convertible_bonds(self, client=None, timeout=None): + today = datetime.datetime.strftime(datetime.datetime.today(), '%Y-%m-%d') + df = self.query_convertible_bonds() + df = df[(df.ipo_date == today)] + self._logger.info('今日有[{}]支可申购转债'.format(len(df))) + for index, row in df.iterrows(): + try: + order = { + 'symbol': row['xcode'], + 'price': 100, + 'amountProportion': 'ALL' + } + self._logger.info('申购转债:{}'.format(order)) + self.buy(client, timeout, **order) + except Exception as e: + self._logger.error( + '客户端[{}]申购转债[{}({})]失败\n{}'.format((client or self._client), row['bname'], row['xcode'], e))
+ +
[docs] def create_adjustment(self, client=None, request_json=None, timeout=None): + request = Request('POST', self.__create_url(client, 'adjustments'), json=request_json) + request.headers['Content-Type'] = MediaType.JOIN_QUANT.value + response = self.__send_request(request, timeout) + json = response.json() + return json
+ +
[docs] def start_clients(self, timeout=None): + request = Request('PUT', self.__create_url(None, 'clients')) + self.__send_request(request, timeout)
+ +
[docs] def shutdown_clients(self, timeout=None): + request = Request('DELETE', self.__create_url(None, 'clients')) + self.__send_request(request, timeout)
+ + def __execute(self, client=None, timeout=None, **kwargs): + if not kwargs.get('type'): + kwargs['type'] = 'LIMIT' + request = Request('POST', self.__create_order_url(client), json=kwargs) + response = self.__send_request(request) + return response.json() + + def __query_new_stocks(self): + DATA_URL = 'http://vip.stock.finance.sina.com.cn/corp/view/vRPD_NewStockIssue.php?page=1&cngem=0&orderBy=NetDate&orderType=desc' + html = lxml.html.parse(DATA_URL) + res = html.xpath('//table[@id=\"NewStockTable\"]/tr') + if six.PY2: + sarr = [etree.tostring(node) for node in res] + else: + sarr = [etree.tostring(node).decode('utf-8') for node in res] + sarr = ''.join(sarr) + sarr = sarr.replace('<font color="red">*</font>', '') + sarr = '<table>%s</table>' % sarr + df = pd.read_html(StringIO(sarr), skiprows=[0, 1])[0] + df = df.select(lambda x: x in [0, 1, 2, 3, 7], axis=1) + df.columns = ['code', 'xcode', 'name', 'ipo_date', 'price'] + df['code'] = df['code'].map(lambda x: str(x).zfill(6)) + df['xcode'] = df['xcode'].map(lambda x: str(x).zfill(6)) + return df + + def __query_convertible_bonds(self): + df = ts.new_cbonds() + return df + + def __create_order_url(self, client=None, order_id=None, **params): + return self.__create_url(client, 'orders', order_id, **params) + + def __create_url(self, client, resource, resource_id=None, **params): + all_params = copy.deepcopy(params) + all_params.update(client=(client or self._client)) + all_params.update(key=(self._key or '')) + if resource_id is None: + path = '/{}'.format(resource) + else: + path = '/{}/{}'.format(resource, resource_id) + url = '{}{}?{}'.format(self._base_url, path, urlencode(all_params)) + return url + + def __create_base_url(self): + if self._connection_method is ConnectionMethod.DIRECT: + return 'http://{}:{}'.format(self._host, self._port) + else: + return self._proxy_base_url + + def __send_request(self, request, timeout=None): + if self._connection_method is ConnectionMethod.PROXY: + request.auth = HTTPBasicAuth(self._proxy_username, self._proxy_password) + request.headers['X-Instance-ID'] = self._instance_id + prepared_request = request.prepare() + self.__log_request(prepared_request) + with requests.sessions.Session() as session: + response = session.send(prepared_request, timeout=(timeout or self._timeout)) + self.__log_response(response) + response.raise_for_status() + return response + + def __log_request(self, prepared_request): + url = self.__eliminate_privacy(prepared_request.path_url) + if prepared_request.body is None: + self._logger.info('Request:\n{} {}'.format(prepared_request.method, url)) + else: + self._logger.info('Request:\n{} {}\n{}'.format(prepared_request.method, url, prepared_request.body)) + + def __log_response(self, response): + message = u'Response:\n{} {}\n{}'.format(response.status_code, response.reason, response.text) + if response.status_code == 200: + self._logger.info(message) + else: + self._logger.error(message) + + @classmethod + def __eliminate_privacy(cls, url): + match = re.search(cls.KEY_REGEX, url) + if match is None: + return url + key = match.group(1) + masked_key = '*' * len(key) + url = re.sub(cls.KEY_REGEX, "key={}".format(masked_key), url) + return url
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAMarket/tdxRealBroker.html b/_build/html/_modules/QUANTAXIS/QAMarket/tdxRealBroker.html new file mode 100644 index 000000000..dcab1ab8e --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAMarket/tdxRealBroker.html @@ -0,0 +1,305 @@ + + + + + + + + QUANTAXIS.QAMarket.tdxRealBroker — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAMarket.tdxRealBroker

+# coding:utf-8
+
+
+import requests
+import json
+import urllib
+import base64
+import pandas as pd
+from cryptography.hazmat.backends import default_backend
+from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
+from QUANTAXIS.QAMarket.QABroker import QA_Broker
+try:
+    from pytdx.log import log
+except ImportError:
+    def log(x): 
+        return None
+
+
+
[docs]class TdxTradeApiParams: + + """ + 0 资金 + 1 股份 + 2 当日委托 + 3 当日成交 + 4 可撤单 + 5 股东代码 + 6 融资余额 + 7 融券余额 + 8 可融证券 + 9 + 10 + 11 + 12 可申购新股查询 + 13 新股申购额度查询 + 14 配号查询 + 15 中签查询 + """ + QUERY_CATEGORY_CASH = 0 + QUERY_CATEGORY_STOCKS = 1 + QUERY_CATEGORY_ORDER_OF_TODAY = 2 + QUERY_CATEGORY_DEAL_OF_TODAY = 3 + QUERY_CATEGORY_CANCELABLE_ORDER = 4 + QUERY_CATEGORY_SHAREHOLDERS_CODE = 5 + QUERY_CATEGORY_BALANCE_OF_MARGIN_LOAN = 6 + QUERY_CATEGORY_BALANCE_OF_STOCK_LOAN = 7 + QUERY_CATEGORY_OPERABLE_MARGIN_SOTCK = 8 + + QUERY_CATEGORY_NEW_STOCKS = 12 + QUERY_CATEGORY_NEW_STOCKS_QUOTA = 13 + QUERY_CATEGORY_NEW_STOCK_NUMBER = 14 + QUERY_CATEGORY_NEW_STOCK_HIT = 15
+ + +
[docs]class TDXBroker(QA_Broker): + def __init__(self, endpoint="http://127.0.0.1:10092/api", encoding="utf-8", enc_key=None, enc_iv=None): + + self._endpoint = endpoint + self._encoding = "utf-8" + if enc_key == None or enc_iv == None: + self._transport_enc = False + self._transport_enc_key = None + self._transport_enc_iv = None + self._cipher = None + else: + self._transport_enc = True + self._transport_enc_key = enc_key + self._transport_enc_iv = enc_iv + backend = default_backend() + self._cipher = Cipher(algorithms.AES( + enc_key), modes.CBC(enc_iv), backend=backend) + + self._session = requests.Session() + +
[docs] def call(self, func, params=None): + + json_obj = { + "func": func + } + + if params is not None: + json_obj["params"] = params + + if self._transport_enc: + data_to_send = self.encrypt(json_obj) + response = self._session.post(self._endpoint, data=data_to_send) + else: + response = self._session.post(self._endpoint, json=json_obj) + response.encoding = self._encoding + text = response.text + + if self._transport_enc: + decoded_text = self.decrypt(text) + log.debug(decoded_text) + return json.loads(decoded_text) + else: + return json.loads(text)
+ +
[docs] def encrypt(self, source_obj): + encrypter = self._cipher.encryptor() + source = json.dumps(source_obj) + source = source.encode(self._encoding) + need_to_padding = 16 - (len(source) % 16) + if need_to_padding > 0: + source = source + b'\x00' * need_to_padding + enc_data = encrypter.update(source) + encrypter.finalize() + b64_enc_data = base64.encodebytes(enc_data) + return urllib.parse.quote(b64_enc_data)
+ +
[docs] def decrypt(self, source): + decrypter = self._cipher.decryptor() + source = urllib.parse.unquote(source) + source = base64.decodebytes(source.encode("utf-8")) + data_bytes = decrypter.update(source) + decrypter.finalize() + return data_bytes.rstrip(b"\x00").decode(self._encoding)
+ +
[docs] def data_to_df(self, result): + if 'data' in result: + data = result['data'] + return pd.DataFrame(data=data)
+ + #------ functions + +
[docs] def ping(self): + + return self.call("ping", {})
+ +
[docs] def logon(self, ip, port, version, yyb_id, account_id, trade_account, jy_passwrod, tx_password): + return self.call("logon", { + "ip": ip, + "port": port, + "version": version, + "yyb_id": yyb_id, + "account_no": account_id, + "trade_account": trade_account, + "jy_password": jy_passwrod, + "tx_password": tx_password + })
+ +
[docs] def logoff(self, client_id): + return self.call("logoff", { + "client_id": client_id + })
+ +
[docs] def query_data(self, client_id, category): + return self.call("query_data", { + "client_id": client_id, + "category": category + })
+ +
[docs] def send_order(self, client_id, category, price_type, gddm, zqdm, price, quantity): + return self.call("send_order", { + 'client_id': client_id, + 'category': category, + 'price_type': price_type, + 'gddm': gddm, + 'zqdm': zqdm, + 'price': price, + 'quantity': quantity + })
+ +
[docs] def cancel_order(self, client_id, exchange_id, hth): + return self.call("cancel_order", { + 'client_id': client_id, + 'exchange_id': exchange_id, + 'hth': hth + })
+ +
[docs] def get_quote(self, client_id, code): + return self.call("get_quote", { + 'client_id': client_id, + 'code': code, + })
+ +
[docs] def repay(self, client_id, amount): + return self.call("repay", { + 'client_id': client_id, + 'amount': amount + })
+ +
[docs] def receive_order(self, event): + """ + 0 限价委托; 上海限价委托 / 深圳限价委托 + 1 市价委托(深圳对方最优价格) + 2 市价委托(深圳本方最优价格) + 3 市价委托(深圳即时成交剩余撤销) + 4 市价委托(上海五档即成剩撤 / 深圳五档即成剩撤) + 5 市价委托(深圳全额成交或撤销) + 6 市价委托(上海五档即成转限价) + """ + return self.send_order(event.client_id, event.category, event.price_type,event.gddm,event.zqdm,event.price,event.quantity)
+ #client_id, category, price_type, gddm, zqdm, price, quantity + +
[docs] def run(self,event): + pass
+ + +if __name__ == "__main__": + import os + api = TDXBroker(endpoint="http://10.11.5.175:10092/api", + enc_key=b"4f1cf3fec4c84c84", enc_iv=b"0c78abc083b011e7") + #api = TdxTradeApi(endpoint="http://10.11.5.175:10092/api") + print("---Ping---") + result = api.ping() + print(result) + + print("---登入---") + acc = os.getenv("TDX_ACCOUNT", "") + password = os.getenv("TDX_PASS", "") + result = api.logon("202.108.253.186", 7708, + "8.23", 32, + acc, acc, password, "") + + print(result) + + if result["success"]: + client_id = result["data"]["client_id"] + + for i in (0, 1, 2, 3, 4, 5, 6, 7, 8, 12, 13, 14, 15): + print("---查询信息 cate=%d--" % i) + print(api.data_to_df(api.query_data(client_id, i))) + + print("---查询报价---") + print(api.data_to_df(api.get_quote(client_id, '600315'))) + + print("---登出---") + print(api.logoff(client_id)) +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QASU/main.html b/_build/html/_modules/QUANTAXIS/QASU/main.html new file mode 100644 index 000000000..cb47d1884 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QASU/main.html @@ -0,0 +1,282 @@ + + + + + + + + QUANTAXIS.QASU.main — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QASU.main

+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+from QUANTAXIS.QASU import save_tdx as stdx
+from QUANTAXIS.QASU import save_tdx_file as tdx_file
+from QUANTAXIS.QASU import save_tushare as sts
+from QUANTAXIS.QAUtil import DATABASE
+
+
+
+
+
[docs]def QA_SU_save_stock_info(engine, client=DATABASE): + """save stock info + + Arguments: + engine {[type]} -- [description] + + Keyword Arguments: + client {[type]} -- [description] (default: {DATABASE}) + """ + + engine = select_save_engine(engine) + engine.QA_SU_save_stock_info(client=client)
+ + +
[docs]def QA_SU_save_stock_list(engine, client=DATABASE): + """save stock_list + + Arguments: + engine {[type]} -- [description] + + Keyword Arguments: + client {[type]} -- [description] (default: {DATABASE}) + """ + + engine = select_save_engine(engine) + engine.QA_SU_save_stock_list(client=client)
+ + +
[docs]def QA_SU_save_stock_day(engine, client=DATABASE): + """save stock_day + + Arguments: + engine {[type]} -- [description] + + Keyword Arguments: + client {[type]} -- [description] (default: {DATABASE}) + """ + + engine = select_save_engine(engine) + engine.QA_SU_save_stock_day(client=client)
+ + +
[docs]def QA_SU_save_stock_min(engine, client=DATABASE): + """save stock_min + + Arguments: + engine {[type]} -- [description] + + Keyword Arguments: + client {[type]} -- [description] (default: {DATABASE}) + """ + + engine = select_save_engine(engine) + engine.QA_SU_save_stock_min(client=client)
+ + +
[docs]def QA_SU_save_index_day(engine, client=DATABASE): + """save index_day + + Arguments: + engine {[type]} -- [description] + + Keyword Arguments: + client {[type]} -- [description] (default: {DATABASE}) + """ + + engine = select_save_engine(engine) + engine.QA_SU_save_index_day(client=client)
+ + +
[docs]def QA_SU_save_index_min(engine, client=DATABASE): + """save index_min + + Arguments: + engine {[type]} -- [description] + + Keyword Arguments: + client {[type]} -- [description] (default: {DATABASE}) + """ + + engine = select_save_engine(engine) + engine.QA_SU_save_index_min(client=client)
+ + +
[docs]def QA_SU_save_etf_day(engine, client=DATABASE): + """save etf_day + + Arguments: + engine {[type]} -- [description] + + Keyword Arguments: + client {[type]} -- [description] (default: {DATABASE}) + """ + + engine = select_save_engine(engine) + engine.QA_SU_save_etf_day(client=client)
+ + +
[docs]def QA_SU_save_etf_min(engine, client=DATABASE): + """save etf_min + + Arguments: + engine {[type]} -- [description] + + Keyword Arguments: + client {[type]} -- [description] (default: {DATABASE}) + """ + + engine = select_save_engine(engine) + engine.QA_SU_save_etf_min(client=client)
+ + +
[docs]def QA_SU_save_stock_xdxr(engine, client=DATABASE): + """save stock_xdxr + + Arguments: + engine {[type]} -- [description] + + Keyword Arguments: + client {[type]} -- [description] (default: {DATABASE}) + """ + + engine = select_save_engine(engine) + engine.QA_SU_save_stock_xdxr(client=client)
+ +
[docs]def QA_SU_save_stock_block(engine, client=DATABASE): + """save stock_block + + Arguments: + engine {[type]} -- [description] + + Keyword Arguments: + client {[type]} -- [description] (default: {DATABASE}) + """ + + engine = select_save_engine(engine) + engine.QA_SU_save_stock_block(client=client)
+ + + +
[docs]def select_save_engine(engine): + """select save_engine + + Arguments: + engine {[type]} -- [description] + + Returns: + [type] -- [description] + """ + + + if engine in ['tushare', 'ts', 'Tushare']: + return sts + elif engine in ['tdx']: + return stdx
+ + + + +
[docs]def QA_SU_save_stock_min_5(file_dir, client=DATABASE): + """save stock_min5 + + Arguments: + file_dir {[type]} -- [description] + + Keyword Arguments: + client {[type]} -- [description] (default: {DATABASE}) + + Returns: + [type] -- [description] + """ + + return tdx_file.QA_save_tdx_to_mongo(file_dir, client)
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QASU/save_account.html b/_build/html/_modules/QUANTAXIS/QASU/save_account.html new file mode 100644 index 000000000..ec7187747 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QASU/save_account.html @@ -0,0 +1,137 @@ + + + + + + + + QUANTAXIS.QASU.save_account — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QASU.save_account

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+from QUANTAXIS.QAUtil import DATABASE
+
+"""对于账户的增删改查(QAACCOUNT/QAUSER/QAPORTFOLIO)
+"""
+
+
+
[docs]def save_account(message, collection=DATABASE.account): + """save account + + Arguments: + message {[type]} -- [description] + + Keyword Arguments: + collection {[type]} -- [description] (default: {DATABASE}) + """ + + collection.save(message)
+ + + +
[docs]def update_account(mes, collection=DATABASE.account): + """update the account with account message + + Arguments: + mes {[type]} -- [description] + + Keyword Arguments: + collection {[type]} -- [description] (default: {DATABASE}) + """ + + collection.find_one_and_update({'account_cookie': mes['account_cookie']})
+ + +
[docs]def save_riskanalysis(message,collection=DATABASE.risk): + collection.save(message)
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QASU/save_backtest.html b/_build/html/_modules/QUANTAXIS/QASU/save_backtest.html new file mode 100644 index 000000000..81896c589 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QASU/save_backtest.html @@ -0,0 +1,164 @@ + + + + + + + + QUANTAXIS.QASU.save_backtest — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QASU.save_backtest

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+import csv
+import os
+
+from QUANTAXIS.QAUtil import QA_util_log_expection
+
+
+"""适用于老代码的回测
+现在已经废弃
+"""
+
+
+
[docs]def QA_SU_save_account_message(message, client): + coll = client.quantaxis.backtest_history + try: + coll.insert({ + 'time_stamp': message['body']['date_stamp'], + "cookie": message['header']['cookie'], + 'user': message['header']['session']['user'], + 'strategy': message['header']['session']['strategy'], + 'cash': message['body']['account']['cash'], + 'hold': message['body']['account']['hold'], + 'history': message['body']['account']['history'], + 'assets': message['body']['account']['assets'], + 'detail': message['body']['account']['detail'] + }) + except: + QA_util_log_expection('error in saving backtest account')
+ + +
[docs]def QA_SU_save_backtest_message(message, client): + __coll = client.quantaxis.backtest_info + + __coll.insert(message)
+ + +
[docs]def QA_SU_save_account_to_csv(message, path=os.getcwd()): + + __file_name_1 = '{}backtest-ca&history-{}.csv'.format( + path, str(message['header']['cookie'])) + with open(__file_name_1, 'w', newline='') as C: + csvwriter = csv.writer(C) + csvwriter.writerow(['date', 'code', 'price', 'towards', 'amount', + 'order_id', 'trade_id', 'commission_fee', 'cash', 'assets']) + for i in range(0, max(len(message['body']['account']['cash']), len(message['body']['account']['assets']))): + try: + message['body']['account']['history'][i].append( + message['body']['account']['cash'][i]) + message['body']['account']['history'][i].append( + message['body']['account']['assets'][i]) + csvwriter.writerow(message['body']['account']['history'][i]) + except: + pass
+ + +
[docs]def QA_SU_save_pnl_to_csv(detail, cookie): + __file_name_2 = 'backtest-pnl--' + \ + str(cookie) + '.csv' + with open(__file_name_2, 'w', newline='') as E: + csvwriter_1 = csv.writer(E) + csvwriter_1.writerow(detail.columns) + for item in detail: + csvwriter_1.writerow(item)
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QASU/save_local.html b/_build/html/_modules/QUANTAXIS/QASU/save_local.html new file mode 100644 index 000000000..777de6cbd --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QASU/save_local.html @@ -0,0 +1,127 @@ + + + + + + + + QUANTAXIS.QASU.save_local — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QASU.save_local

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+import os
+import sys
+
+#QUNATAXIS_DIR='{}{}{}'.format( os.path.expanduser('~'), os.sep, '.quantaxis')
+
+path = os.path.expanduser('~')
+qa_path = '{}{}{}'.format(path, os.sep, '.quantaxis')
+setting_path = '{}{}{}'.format(qa_path, os.sep, '.setting')
+cache_path = '{}{}{}'.format(qa_path, os.sep, '.cache')
+
+
+
[docs]def make_cache(): + pass
+ + +
[docs]def make_dir(): + path = os.path.expanduser('~') + qa_path = '{}{}{}'.format(path, os.sep, '.quantaxis') + os.makedirs(qa_path, exist_ok=True) + setting_path = '{}{}{}'.format(qa_path, os.sep, '.setting') + cache_path = '{}{}{}'.format(qa_path, os.sep, '.cache') + downloads_path = '{}{}{}'.format(qa_path, os.sep, 'downloads') + os.makedirs(setting_path, exist_ok=True) + os.makedirs(cache_path, exist_ok=True) + os.makedirs(downloads_path, exist_ok=True)
+ +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QASU/save_tdx.html b/_build/html/_modules/QUANTAXIS/QASU/save_tdx.html new file mode 100644 index 000000000..9906364ae --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QASU/save_tdx.html @@ -0,0 +1,648 @@ + + + + + + + + QUANTAXIS.QASU.save_tdx — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QASU.save_tdx

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+import concurrent
+import datetime
+from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor
+
+import pandas as pd
+import pymongo
+
+from QUANTAXIS.QAFetch import QA_fetch_get_stock_block
+from QUANTAXIS.QAFetch.QATdx import (QA_fetch_get_index_day,
+                                     QA_fetch_get_index_min,
+                                     QA_fetch_get_stock_day,
+                                     QA_fetch_get_stock_info,
+                                     QA_fetch_get_stock_list,
+                                     QA_fetch_get_stock_min,
+                                     QA_fetch_get_stock_transaction,
+                                     QA_fetch_get_stock_xdxr, select_best_ip)
+from QUANTAXIS.QAFetch.QATushare import QA_fetch_get_stock_time_to_market
+from QUANTAXIS.QAUtil import (DATABASE, QA_util_get_next_day,
+                              QA_util_get_real_date, QA_util_log_info,
+                              QA_util_to_json_from_pandas, trade_date_sse)
+
+# ip=select_best_ip()
+
+
+
[docs]def now_time(): + return str(QA_util_get_real_date(str(datetime.date.today() - datetime.timedelta(days=1)), trade_date_sse, -1)) + \ + ' 17:00:00' if datetime.datetime.now().hour < 15 else str(QA_util_get_real_date( + str(datetime.date.today()), trade_date_sse, -1)) + ' 15:00:00'
+ + +
[docs]def QA_SU_save_stock_day(client=DATABASE): + """save stock_day + + Keyword Arguments: + client {[type]} -- [description] (default: {DATABASE}) + """ + + stock_list = QA_fetch_get_stock_time_to_market() + coll_stock_day = client.stock_day + coll_stock_day.create_index( + [("code", pymongo.ASCENDING), ("date_stamp", pymongo.ASCENDING)]) + err = [] + + def __saving_work(code, coll_stock_day): + try: + QA_util_log_info( + '##JOB01 Now Saving STOCK_DAY==== %s' % (str(code))) + + ref = coll_stock_day.find({'code': str(code)[0:6]}) + end_date = str(now_time())[0:10] + if ref.count() > 0: + # 加入这个判断的原因是因为如果股票是刚上市的 数据库会没有数据 所以会有负索引问题出现 + + start_date = ref[ref.count() - 1]['date'] + + QA_util_log_info(' UPDATE_STOCK_DAY \n Trying updating %s from %s to %s' % + (code, start_date, end_date)) + if start_date != end_date: + coll_stock_day.insert_many( + QA_util_to_json_from_pandas( + QA_fetch_get_stock_day(str(code), QA_util_get_next_day(start_date), end_date, '00'))) + else: + start_date = '1990-01-01' + QA_util_log_info(' UPDATE_STOCK_DAY \n Trying updating %s from %s to %s' % + (code, start_date, end_date)) + if start_date != end_date: + coll_stock_day.insert_many( + QA_util_to_json_from_pandas( + QA_fetch_get_stock_day(str(code), start_date, end_date, '00'))) + except: + err.append(str(code)) + for item in range(len(stock_list)): + QA_util_log_info('The %s of Total %s' % + (item, len(stock_list))) + QA_util_log_info('DOWNLOAD PROGRESS %s ' % str( + float(item / len(stock_list) * 100))[0:4] + '%') + + __saving_work(stock_list.index[item], coll_stock_day) + if len(err) < 1: + QA_util_log_info('SUCCESS') + else: + QA_util_log_info('ERROR CODE \n ') + QA_util_log_info(err)
+ + +
[docs]def QA_SU_save_stock_xdxr(client=DATABASE): + """[summary] + + Keyword Arguments: + client {[type]} -- [description] (default: {DATABASE}) + """ + + client.drop_collection('stock_xdxr') + stock_list = QA_fetch_get_stock_time_to_market() + coll = client.stock_xdxr + coll.create_index([('code', pymongo.ASCENDING), + ('date', pymongo.ASCENDING)]) + err = [] + + def __saving_work(code, coll): + QA_util_log_info('##JOB02 Now Saving XDXR INFO ==== %s' % (str(code))) + try: + coll.insert_many( + QA_util_to_json_from_pandas( + QA_fetch_get_stock_xdxr(str(code)))) + + except: + + err.append(str(code)) + for i_ in range(len(stock_list)): + QA_util_log_info('The %s of Total %s' % (i_, len(stock_list))) + QA_util_log_info('DOWNLOAD PROGRESS %s ' % str( + float(i_ / len(stock_list) * 100))[0:4] + '%') + __saving_work(stock_list.index[i_], coll) + if len(err) < 1: + QA_util_log_info('SUCCESS') + else: + + try_code = err + err = [] + QA_util_log_info('Try to get stock xdxr info in erro list! \n') + for i__ in range(len(try_code)): + QA_util_log_info('The %s of Total %s' % (i__, len(try_code))) + QA_util_log_info('DOWNLOAD PROGRESS %s ' % str( + float(i__ / len(try_code) * 100))[0:4] + '%') + __saving_work(try_code[i__], coll) + if len(err) < 1: + QA_util_log_info('SUCCESS') + else: + QA_util_log_info('ERROR CODE \n ') + QA_util_log_info(err)
+ + +
[docs]def QA_SU_save_stock_min(client=DATABASE): + """save stock_min + + Keyword Arguments: + client {[type]} -- [description] (default: {DATABASE}) + """ + + stock_list = QA_fetch_get_stock_time_to_market() + coll = client.stock_min + coll.create_index([('code', pymongo.ASCENDING), ('time_stamp', + pymongo.ASCENDING), ('date_stamp', pymongo.ASCENDING)]) + err = [] + + def __saving_work(code, coll): + QA_util_log_info('##JOB03 Now Saving STOCK_MIN ==== %s' % (str(code))) + try: + for type in ['1min', '5min', '15min', '30min', '60min']: + ref_ = coll.find( + {'code': str(code)[0:6], 'type': type}) + end_time = str(now_time())[0:19] + if ref_.count() > 0: + start_time = ref_[ref_.count() - 1]['datetime'] + + QA_util_log_info( + '##JOB03.%s Now Saving %s from %s to %s ==%s ' % (['1min', '5min', '15min', '30min', '60min'].index(type), str(code), start_time, end_time, type)) + if start_time != end_time: + __data = QA_fetch_get_stock_min( + str(code), start_time, end_time, type) + if len(__data) > 1: + coll.insert_many( + QA_util_to_json_from_pandas(__data)[1::]) + else: + start_time = '2015-01-01' + QA_util_log_info( + '##JOB03.%s Now Saving %s from %s to %s ==%s ' % (['1min', '5min', '15min', '30min', '60min'].index(type), str(code), start_time, end_time, type)) + if start_time != end_time: + __data = QA_fetch_get_stock_min( + str(code), start_time, end_time, type) + if len(__data) > 1: + coll.insert_many( + QA_util_to_json_from_pandas(__data)) + except Exception as e: + QA_util_log_info(e) + + err.append(code) + + executor = ThreadPoolExecutor(max_workers=4) + #executor.map((__saving_work, stock_list.index[i_], coll),URLS) + res = {executor.submit( + __saving_work, stock_list.index[i_], coll) for i_ in range(len(stock_list))} + count = 0 + for i_ in concurrent.futures.as_completed(res): + QA_util_log_info('The %s of Total %s' % (count, len(stock_list))) + QA_util_log_info('DOWNLOAD PROGRESS %s ' % str( + float(count / len(stock_list) * 100))[0:4] + '%') + count = count + 1 + if len(err) < 1: + QA_util_log_info('SUCCESS') + else: + QA_util_log_info('ERROR CODE \n ') + QA_util_log_info(err)
+ + +
[docs]def QA_SU_save_index_day(client=DATABASE): + """save index_day + + Keyword Arguments: + client {[type]} -- [description] (default: {DATABASE}) + """ + + __index_list = QA_fetch_get_stock_list('index') + coll = client.index_day + coll.create_index([('code', pymongo.ASCENDING), + ('date_stamp', pymongo.ASCENDING)]) + err = [] + + def __saving_work(code, coll): + + try: + ref_ = coll.find({'code': str(code)[0:6]}) + end_time = str(now_time())[0:10] + if ref_.count() > 0: + start_time = ref_[ref_.count() - 1]['date'] + + QA_util_log_info('##JOB04 Now Saving INDEX_DAY==== \n Trying updating %s from %s to %s' % + (code, start_time, end_time)) + + if start_time != end_time: + coll.insert_many( + QA_util_to_json_from_pandas( + QA_fetch_get_index_day(str(code), QA_util_get_next_day(start_time), end_time))) + else: + start_time = '1990-01-01' + QA_util_log_info('##JOB04 Now Saving INDEX_DAY==== \n Trying updating %s from %s to %s' % + (code, start_time, end_time)) + coll.insert_many( + QA_util_to_json_from_pandas( + QA_fetch_get_index_day(str(code), start_time, end_time))) + except Exception as e: + QA_util_log_info(e) + err.append(str(code)) + for i_ in range(len(__index_list)): + #__saving_work('000001') + QA_util_log_info('The %s of Total %s' % (i_, len(__index_list))) + QA_util_log_info('DOWNLOAD PROGRESS %s ' % str( + float(i_ / len(__index_list) * 100))[0:4] + '%') + __saving_work(__index_list.index[i_][0], coll) + if len(err) < 1: + QA_util_log_info('SUCCESS') + else: + QA_util_log_info('ERROR CODE \n ') + QA_util_log_info(err)
+ + +
[docs]def QA_SU_save_index_min(client=DATABASE): + """save index_min + + Keyword Arguments: + client {[type]} -- [description] (default: {DATABASE}) + """ + + __index_list = QA_fetch_get_stock_list('index') + coll = client.index_min + coll.create_index([('code', pymongo.ASCENDING), ('time_stamp', + pymongo.ASCENDING), ('date_stamp', pymongo.ASCENDING)]) + err = [] + + def __saving_work(code, coll): + + QA_util_log_info('##JOB05 Now Saving Index_MIN ==== %s' % (str(code))) + try: + + for type in ['1min', '5min', '15min', '30min', '60min']: + ref_ = coll.find( + {'code': str(code)[0:6], 'type': type}) + end_time = str(now_time())[0:19] + if ref_.count() > 0: + start_time = ref_[ref_.count() - 1]['datetime'] + + QA_util_log_info( + '##JOB05.%s Now Saving %s from %s to %s ==%s ' % (['1min', '5min', '15min', '30min', '60min'].index(type), str(code), start_time, end_time, type)) + if start_time != end_time: + __data = QA_fetch_get_index_min( + str(code), start_time, end_time, type) + if len(__data) > 1: + coll.insert_many( + QA_util_to_json_from_pandas(__data[1::])) + else: + start_time = '2015-01-01' + QA_util_log_info( + '##JOB05.%s Now Saving %s from %s to %s ==%s ' % (['1min', '5min', '15min', '30min', '60min'].index(type), str(code), start_time, end_time, type)) + if start_time != end_time: + __data = QA_fetch_get_index_min( + str(code), start_time, end_time, type) + if len(__data) > 1: + coll.insert_many( + QA_util_to_json_from_pandas(__data)) + except: + err.append(code) + + executor = ThreadPoolExecutor(max_workers=4) + + res = {executor.submit( + __saving_work, __index_list.index[i_][0], coll) for i_ in range(len(__index_list))} # multi index ./. + count = 0 + for i_ in concurrent.futures.as_completed(res): + QA_util_log_info('The %s of Total %s' % (count, len(__index_list))) + QA_util_log_info('DOWNLOAD PROGRESS %s ' % str( + float(count / len(__index_list) * 100))[0:4] + '%') + count = count + 1 + if len(err) < 1: + QA_util_log_info('SUCCESS') + else: + QA_util_log_info('ERROR CODE \n ') + QA_util_log_info(err)
+ + +
[docs]def QA_SU_save_etf_day(client=DATABASE): + """save etf_day + + Keyword Arguments: + client {[type]} -- [description] (default: {DATABASE}) + """ + + __index_list = QA_fetch_get_stock_list('etf') + coll = client.index_day + coll.create_index([('code', pymongo.ASCENDING), + ('date_stamp', pymongo.ASCENDING)]) + err = [] + + def __saving_work(code, coll): + + try: + + ref_ = coll.find({'code': str(code)[0:6]}) + end_time = str(now_time())[0:10] + if ref_.count() > 0: + start_time = ref_[ref_.count() - 1]['date'] + + QA_util_log_info('##JOB06 Now Saving ETF_DAY==== \n Trying updating %s from %s to %s' % + (code, start_time, end_time)) + + if start_time != end_time: + coll.insert_many( + QA_util_to_json_from_pandas( + QA_fetch_get_index_day(str(code), QA_util_get_next_day(start_time), end_time))) + else: + start_time = '1990-01-01' + QA_util_log_info('##JOB06 Now Saving ETF_DAY==== \n Trying updating %s from %s to %s' % + (code, start_time, end_time)) + + if start_time != end_time: + coll.insert_many( + QA_util_to_json_from_pandas( + QA_fetch_get_index_day(str(code), start_time, end_time))) + except: + err.append(str(code)) + for i_ in range(len(__index_list)): + #__saving_work('000001') + QA_util_log_info('The %s of Total %s' % (i_, len(__index_list))) + QA_util_log_info('DOWNLOAD PROGRESS %s ' % str( + float(i_ / len(__index_list) * 100))[0:4] + '%') + __saving_work(__index_list.index[i_][0], coll) + if len(err) < 1: + QA_util_log_info('SUCCESS') + else: + QA_util_log_info('ERROR CODE \n ') + QA_util_log_info(err)
+ + +
[docs]def QA_SU_save_etf_min(client=DATABASE): + """save etf_min + + Keyword Arguments: + client {[type]} -- [description] (default: {DATABASE}) + """ + + __index_list = QA_fetch_get_stock_list('etf') + coll = client.index_min + coll.create_index([('code', pymongo.ASCENDING), ('time_stamp', + pymongo.ASCENDING), ('date_stamp', pymongo.ASCENDING)]) + err = [] + + def __saving_work(code, coll): + + QA_util_log_info('##JOB07 Now Saving ETF_MIN ==== %s' % (str(code))) + try: + + for type in ['1min', '5min', '15min', '30min', '60min']: + ref_ = coll.find( + {'code': str(code)[0:6], 'type': type}) + end_time = str(now_time())[0:19] + if ref_.count() > 0: + start_time = ref_[ref_.count() - 1]['datetime'] + + QA_util_log_info( + '##JOB07.%s Now Saving %s from %s to %s ==%s ' % (['1min', '5min', '15min', '30min', '60min'].index(type), str(code), start_time, end_time, type)) + if start_time != end_time: + __data = QA_fetch_get_index_min( + str(code), start_time, end_time, type) + if len(__data) > 1: + coll.insert_many( + QA_util_to_json_from_pandas(__data[1::])) + else: + start_time = '2015-01-01' + QA_util_log_info( + '##JOB07.%s Now Saving %s from %s to %s ==%s ' % (['1min', '5min', '15min', '30min', '60min'].index(type), str(code), start_time, end_time, type)) + if start_time != end_time: + __data = QA_fetch_get_index_min( + str(code), start_time, end_time, type) + if len(__data) > 1: + coll.insert_many( + QA_util_to_json_from_pandas(__data)) + except: + err.append(code) + + executor = ThreadPoolExecutor(max_workers=4) + + res = {executor.submit( + __saving_work, __index_list.index[i_][0], coll) for i_ in range(len(__index_list))} # multi index ./. + count = 0 + for i_ in concurrent.futures.as_completed(res): + QA_util_log_info('The %s of Total %s' % (count, len(__index_list))) + QA_util_log_info('DOWNLOAD PROGRESS %s ' % str( + float(count / len(__index_list) * 100))[0:4] + '%') + count = count + 1 + if len(err) < 1: + QA_util_log_info('SUCCESS') + else: + QA_util_log_info('ERROR CODE \n ') + QA_util_log_info(err)
+ + +
[docs]def QA_SU_save_stock_list(client=DATABASE): + """save stock_list + + Keyword Arguments: + client {[type]} -- [description] (default: {DATABASE}) + """ + + client.drop_collection('stock_list') + coll = client.stock_list + coll.create_index('code') + err = [] + + try: + QA_util_log_info('##JOB08 Now Saving STOCK_LIST ====') + coll.insert_many(QA_util_to_json_from_pandas( + QA_fetch_get_stock_list())) + except: + pass
+ + +
[docs]def QA_SU_save_stock_block(client=DATABASE): + """save stock_block + + Keyword Arguments: + client {[type]} -- [description] (default: {DATABASE}) + """ + + client.drop_collection('stock_block') + coll = client.stock_block + coll.create_index('code') + err = [] + try: + QA_util_log_info('##JOB09 Now Saving STOCK_BlOCK ====') + coll.insert_many(QA_util_to_json_from_pandas( + QA_fetch_get_stock_block('tdx'))) + coll.insert_many(QA_util_to_json_from_pandas( + QA_fetch_get_stock_block('ths'))) + except: + pass
+ + +
[docs]def QA_SU_save_stock_info(client=DATABASE): + """save stock_info + + Keyword Arguments: + client {[type]} -- [description] (default: {DATABASE}) + """ + + client.drop_collection('stock_info') + stock_list = QA_fetch_get_stock_time_to_market() + coll = client.stock_info + coll.create_index('code') + err = [] + + def __saving_work(code, coll): + QA_util_log_info( + '##JOB010 Now Saving STOCK INFO ==== %s' % (str(code))) + try: + coll.insert_many( + QA_util_to_json_from_pandas( + QA_fetch_get_stock_info(str(code)))) + + except: + err.append(str(code)) + for i_ in range(len(stock_list)): + #__saving_work('000001') + QA_util_log_info('The %s of Total %s' % (i_, len(stock_list))) + QA_util_log_info('DOWNLOAD PROGRESS %s ' % str( + float(i_ / len(stock_list) * 100))[0:4] + '%') + __saving_work(stock_list.index[i_], coll) + if len(err) < 1: + QA_util_log_info('SUCCESS') + else: + QA_util_log_info('ERROR CODE \n ') + QA_util_log_info(err)
+ + +
[docs]def QA_SU_save_stock_transaction(client=DATABASE): + """save stock_transaction + + Keyword Arguments: + client {[type]} -- [description] (default: {DATABASE}) + """ + + stock_list = QA_fetch_get_stock_time_to_market() + coll = client.stock_transaction + coll.create_index('code') + err = [] + + def __saving_work(code): + QA_util_log_info( + '##JOB10 Now Saving STOCK_TRANSACTION ==== %s' % (str(code))) + try: + coll.insert_many( + QA_util_to_json_from_pandas( + QA_fetch_get_stock_transaction(str(code), str(stock_list[code]), str(now_time())[0:10]))) + except: + err.append(str(code)) + for i_ in range(len(stock_list)): + #__saving_work('000001') + QA_util_log_info('The %s of Total %s' % (i_, len(stock_list))) + QA_util_log_info('DOWNLOAD PROGRESS %s ' % str( + float(i_ / len(stock_list) * 100))[0:4] + '%') + __saving_work(stock_list.index[i_]) + if len(err) < 1: + QA_util_log_info('SUCCESS') + else: + QA_util_log_info('ERROR CODE \n ') + QA_util_log_info(err)
+ + +if __name__ == '__main__': + # QA_SU_save_stock_day() + # QA_SU_save_stock_xdxr() + # QA_SU_save_stock_min() + # QA_SU_save_stock_transaction() + # QA_SU_save_index_day() + # QA_SU_save_stock_list() + # QA_SU_save_index_min() + pass +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QASU/save_tdx_file.html b/_build/html/_modules/QUANTAXIS/QASU/save_tdx_file.html new file mode 100644 index 000000000..1c4342c4d --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QASU/save_tdx_file.html @@ -0,0 +1,153 @@ + + + + + + + + QUANTAXIS.QASU.save_tdx_file — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QASU.save_tdx_file

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+
+import json
+import os
+
+from pytdx.reader import TdxMinBarReader
+
+from QUANTAXIS.QAUtil import (DATABASE, QA_util_date_stamp, QA_util_log_info,
+                              QA_util_time_stamp)
+
+
+
[docs]def QA_save_tdx_to_mongo(file_dir, client=DATABASE): + """save file + + Arguments: + file_dir {str:direction} -- 文件的地址 + + Keyword Arguments: + client {Mongodb:Connection} -- Mongo Connection (default: {DATABASE}) + """ + + reader = TdxMinBarReader() + __coll = client.stock_min_five + for a, v, files in os.walk(file_dir): + + for file in files: + + if (str(file)[0:2] == 'sh' and int(str(file)[2]) == 6) or \ + (str(file)[0:2] == 'sz' and int(str(file)[2]) == 0) or \ + (str(file)[0:2] == 'sz' and int(str(file)[2]) == 3): + + QA_util_log_info('Now_saving ' + str(file) + [2:8] + '\'s 5 min tick') + fname = file_dir + os.sep + file + df = reader.get_df(fname) + df['code'] = str(file)[2:8] + df['market'] = str(file)[0:2] + df['datetime'] = [str(x) for x in list(df.index)] + df['date'] = [str(x)[0:10] for x in list(df.index)] + df['time_stamp'] = df['datetime'].apply( + lambda x: QA_util_time_stamp(x)) + df['date_stamp'] = df['date'].apply( + lambda x: QA_util_date_stamp(x)) + data_json = json.loads(df.to_json(orient='records')) + __coll.insert_many(data_json)
+ + +if __name__ == '__main__': + file_dir = ['C:\\users\\yutiansut\\desktop\\sh5fz', + 'C:\\users\\yutiansut\\desktop\\sz5fz'] + for item in file_dir: + QA_save_tdx_to_mongo(item) +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QASU/save_tushare.html b/_build/html/_modules/QUANTAXIS/QASU/save_tushare.html new file mode 100644 index 000000000..152567f3a --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QASU/save_tushare.html @@ -0,0 +1,221 @@ + + + + + + + + QUANTAXIS.QASU.save_tushare — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QASU.save_tushare

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+import datetime
+import json
+import re
+import time
+
+import tushare as ts
+
+from QUANTAXIS.QAFetch.QATushare import (QA_fetch_get_stock_day,
+                                         QA_fetch_get_stock_info,
+                                         QA_fetch_get_stock_list,
+                                         QA_fetch_get_trade_date)
+from QUANTAXIS.QAUtil import (QA_util_date_stamp, QA_util_log_info,
+                              QA_util_time_stamp, QA_util_to_json_from_pandas,
+                              trade_date_sse)
+from QUANTAXIS.QAUtil.QASetting import DATABASE
+
+
+
[docs]def QA_save_stock_day_all(client=DATABASE): + df = ts.get_stock_basics() + __coll = client.stock_day + __coll.ensure_index('code') + + def saving_work(i): + QA_util_log_info('Now Saving ==== %s' % (i)) + try: + data_json = QA_fetch_get_stock_day( + i, start='1990-01-01') + + __coll.insert_many(data_json) + except: + QA_util_log_info('error in saving ==== %s' % str(i)) + + for i_ in range(len(df.index)): + QA_util_log_info('The %s of Total %s' % (i_, len(df.index))) + QA_util_log_info('DOWNLOAD PROGRESS %s ' % str( + float(i_ / len(df.index) * 100))[0:4] + '%') + saving_work(df.index[i_]) + + saving_work('hs300') + saving_work('sz50')
+ + +
[docs]def QA_SU_save_stock_list(client=DATABASE): + data = QA_fetch_get_stock_list() + date = str(datetime.date.today()) + date_stamp = QA_util_date_stamp(date) + coll = client.stock_list + coll.insert({'date': date, 'date_stamp': date_stamp, + 'stock': {'code': data}})
+ + +
[docs]def QA_SU_save_trade_date_all(client=DATABASE): + data = QA_fetch_get_trade_date('', '') + coll = client.trade_date + coll.insert_many(data)
+ + +
[docs]def QA_SU_save_stock_info(client=DATABASE): + data = QA_fetch_get_stock_info('all') + coll = client.stock_info + coll.insert_many(data)
+ + +
[docs]def QA_save_stock_day_all_bfq(client=DATABASE): + df = ts.get_stock_basics() + + __coll = client.stock_day_bfq + __coll.ensure_index('code') + + def saving_work(i): + QA_util_log_info('Now Saving ==== %s' % (i)) + try: + data_json = QA_fetch_get_stock_day( + i, start='1990-01-01', if_fq='00') + + __coll.insert_many(data_json) + except: + QA_util_log_info('error in saving ==== %s' % str(i)) + + for i_ in range(len(df.index)): + QA_util_log_info('The %s of Total %s' % (i_, len(df.index))) + QA_util_log_info('DOWNLOAD PROGRESS %s ' % str( + float(i_ / len(df.index) * 100))[0:4] + '%') + saving_work(df.index[i_]) + + saving_work('hs300') + saving_work('sz50')
+ + +
[docs]def QA_save_stock_day_with_fqfactor(client=DATABASE): + df = ts.get_stock_basics() + + __coll = client.stock_day + __coll.ensure_index('code') + + def saving_work(i): + QA_util_log_info('Now Saving ==== %s' % (i)) + try: + data_hfq = QA_fetch_get_stock_day( + i, start='1990-01-01', if_fq='02', type_='pd') + data_json = QA_util_to_json_from_pandas(data_hfq) + __coll.insert_many(data_json) + except: + QA_util_log_info('error in saving ==== %s' % str(i)) + for i_ in range(len(df.index)): + QA_util_log_info('The %s of Total %s' % (i_, len(df.index))) + QA_util_log_info('DOWNLOAD PROGRESS %s ' % str( + float(i_ / len(df.index) * 100))[0:4] + '%') + saving_work(df.index[i_]) + + saving_work('hs300') + saving_work('sz50') + + QA_util_log_info('Saving Process has been done !') + return 0
+ + +if __name__ == '__main__': + QA_save_stock_day_with_fqfactor() +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QASU/user.html b/_build/html/_modules/QUANTAXIS/QASU/user.html new file mode 100644 index 000000000..1447c32e6 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QASU/user.html @@ -0,0 +1,126 @@ + + + + + + + + QUANTAXIS.QASU.user — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QASU.user

+# coding=utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+
+from QUANTAXIS.QAUtil.QALogs import QA_util_log_info
+
+
+
[docs]def QA_user_sign_in(name, password, client): + coll = client.quantaxis.user_list + cursor=coll.find({'username': name, 'password': password}) + if (cursor.count() > 0): + QA_util_log_info('success login! your username is:' + str(name)) + return cursor + else: + QA_util_log_info('Failed to login,please check your password ') + return None
+ + +
[docs]def QA_user_sign_up(name, password, client): + coll = client.quantaxis.user_list + if (coll.find({'username': name}).count() > 0): + QA_util_log_info('user name is already exist') + return False + else: + coll.insert({'username': name, 'password': password}) + QA_util_log_info('Success sign in! please login ') + return True
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAUtil/QABar.html b/_build/html/_modules/QUANTAXIS/QAUtil/QABar.html new file mode 100644 index 000000000..1acbddb98 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAUtil/QABar.html @@ -0,0 +1,230 @@ + + + + + + + + QUANTAXIS.QAUtil.QABar — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAUtil.QABar

+# coding=utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+import datetime
+import math
+
+import numpy as np
+import pandas as pd
+
+from QUANTAXIS.QAUtil.QADate_trade import (QA_util_date_gap,
+                                           QA_util_get_real_datelist,
+                                           QA_util_get_trade_range,
+                                           QA_util_if_trade, trade_date_sse)
+
+
+
[docs]def QA_util_make_min_index(day, type_='1min'): + """创建股票分钟线的index + + Arguments: + day {[type]} -- [description] + + Returns: + [type] -- [description] + """ + + if QA_util_if_trade(day) is True: + return pd.date_range(str(day) + ' 09:30:00', str(day) + ' 11:30:00', freq=type_, closed='right').append( + pd.date_range(str(day) + ' 13:00:00', str(day) + ' 15:00:00', freq=type_, closed='right')) + else: + return pd.DataFrame(['No trade'])
+ + +
[docs]def QA_util_make_hour_index(day, type_='1h'): + """创建股票的小时线的index + + Arguments: + day {[type]} -- [description] + + Returns: + [type] -- [description] + """ + + if QA_util_if_trade(day) is True: + return pd.date_range(str(day) + ' 09:30:00', str(day) + ' 11:30:00', freq=type_, closed='right').append( + pd.date_range(str(day) + ' 13:00:00', str(day) + ' 15:00:00', freq=type_, closed='right')) + else: + return pd.DataFrame(['No trade'])
+ + +
[docs]def QA_util_time_gap(time, gap, methods, type_): + '分钟线回测的时候的gap' + min_len = int(240 / int(str(type_).split('min')[0])) + day_gap = math.ceil(gap / min_len) + + if methods in ['>', 'gt']: + data = pd.concat([pd.DataFrame(QA_util_make_min_index(day, type_)) for day in trade_date_sse[trade_date_sse.index(str(datetime.datetime.strptime( + time, '%Y-%m-%d %H:%M:%S').date())):trade_date_sse.index(str(datetime.datetime.strptime(time, '%Y-%m-%d %H:%M:%S').date())) + day_gap + 1]]).reset_index() + return np.asarray(data[data[0] > time].head(gap)[0].apply(lambda x: str(x))).tolist()[-1] + elif methods in ['>=', 'gte']: + data = pd.concat([pd.DataFrame(QA_util_make_min_index(day, type_)) for day in trade_date_sse[trade_date_sse.index(str(datetime.datetime.strptime( + time, '%Y-%m-%d %H:%M:%S').date())):trade_date_sse.index(str(datetime.datetime.strptime(time, '%Y-%m-%d %H:%M:%S').date())) + day_gap + 1]]).reset_index() + + return np.asarray(data[data[0] >= time].head(gap)[0].apply(lambda x: str(x))).tolist()[-1] + elif methods in ['<', 'lt']: + data = pd.concat([pd.DataFrame(QA_util_make_min_index(day, type_)) for day in trade_date_sse[trade_date_sse.index(str(datetime.datetime.strptime( + time, '%Y-%m-%d %H:%M:%S').date())) - day_gap:trade_date_sse.index(str(datetime.datetime.strptime(time, '%Y-%m-%d %H:%M:%S').date())) + 1]]).reset_index() + + return np.asarray(data[data[0] < time].tail(gap)[0].apply(lambda x: str(x))).tolist()[0] + elif methods in ['<=', 'lte']: + data = pd.concat([pd.DataFrame(QA_util_make_min_index(day, type_)) for day in trade_date_sse[trade_date_sse.index(str(datetime.datetime.strptime( + time, '%Y-%m-%d %H:%M:%S').date())) - day_gap:trade_date_sse.index(str(datetime.datetime.strptime(time, '%Y-%m-%d %H:%M:%S').date())) + 1]]).reset_index() + + return np.asarray(data[data[0] <= time].tail(gap)[0].apply(lambda x: str(x))).tolist()[0] + elif methods in ['==', '=', 'eq']: + return time
+ + +""" +期货交易所交易时间: + +(一)大连、上海、郑州交易所 + +集合竞价申报时间:08:55—08:59 +集合竞价撮合时间:08:59—09:00 +正常开盘交易时间:09:00-11:30 (小节休息10:15-10:30) +13:30-15:00 + +提示:客户下单时间为集合竞价时间和正常交易时间。在8:59—9:00竞价结束时间和交易所小节休息时间(上午10:15-10:30)下单,交易系统将不接受指令,并视之为废单。(时间以交易所时钟报时为准) + +(二)上期所夜盘 + +集合竞价申报时间:20:55—20:59 +集合竞价撮合时间:20:59—21:00 +正常开盘交易时间:21:00-02:30 (黄金、白银) +21:00-01:00 (铜、铝、铅、锌、镍、锡) +21:00-23:00(螺纹钢、热轧卷板、石油沥青、天然橡胶) + +提示:法定节假日的前一日没有夜盘交易。 + +(三)大商所夜盘 + +集合竞价申报时间:20:55—20:59 +集合竞价撮合时间:20:59—21:00 +正常开盘交易时间:21:00—23:30 (豆一、豆二、豆油、豆粕、焦煤、焦炭、棕榈油、铁矿石) + +提示:法定节假日的前一日没有夜盘交易。 + +(四)郑商所夜盘 + +集合竞价申报时间:20:55—20:59 +集合竞价撮合时间:20:59—21:00 +正常开盘交易时间:21:00-23:30 (白糖、棉花、菜粕、甲醇、PTA、菜籽油、玻璃、动力煤) + +提示:法定节假日的前一日没有夜盘交易。 + +(五)中金所 + +股指:集合竞价时间:9:25—9:30 +正常开盘交易时间:9:30-11:30(第一节);13:00-15:00(第二节) + +国债: +集合竞价时间:9:10-9:15 +正常开盘交易时间:9:15-11:30(第一节);13:00-15:15(第二节) +最后交易日交易时间:9:15-11:30 + + +""" + + +if __name__ == '__main__': + pass +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAUtil/QACfg.html b/_build/html/_modules/QUANTAXIS/QAUtil/QACfg.html new file mode 100644 index 000000000..d0098ac57 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAUtil/QACfg.html @@ -0,0 +1,132 @@ + + + + + + + + QUANTAXIS.QAUtil.QACfg — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAUtil.QACfg

+#coding :utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+
+from configparser import ConfigParser
+
+
+
[docs]def QA_util_cfg_initial(CONFIG_FILE): + """[summary] + + Arguments: + CONFIG_FILE {[type]} -- [description] + """ + + pass
+ + +
[docs]def QA_util_get_cfg(__file_path, __file_name): + """[summary] + + Arguments: + __file_path {[type]} -- [description] + __file_name {[type]} -- [description] + + Returns: + [type] -- [description] + """ + + __setting_file = ConfigParser() + try: + return __setting_file.read(__file_path + __file_name) + except: + return 'wrong'
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAUtil/QACode.html b/_build/html/_modules/QUANTAXIS/QAUtil/QACode.html new file mode 100644 index 000000000..035f41e99 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAUtil/QACode.html @@ -0,0 +1,123 @@ + + + + + + + + QUANTAXIS.QAUtil.QACode — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAUtil.QACode

+#coding :utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+"""
+该文件主要是负责一些对于code名称的处理
+"""
+
+
+
[docs]def QA_util_code_tostr(code): + """ + 将所有沪深股票从数字转化到6位的代码 + + 因为有时候在csv等转换的时候,诸如 000001的股票会变成office强制转化成数字1 + + """ + return '00000{}'.format(str(code)[0:6])[-6:]
+ + +
[docs]def QA_util_code_tolist(code): + if isinstance(code, str): + return [QA_util_code_tostr(code)] + + elif isinstance(code, list): + return [QA_util_code_tostr(item) for item in code]
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAUtil/QACsv.html b/_build/html/_modules/QUANTAXIS/QAUtil/QACsv.html new file mode 100644 index 000000000..0ca630ee5 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAUtil/QACsv.html @@ -0,0 +1,141 @@ + + + + + + + + QUANTAXIS.QAUtil.QACsv — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAUtil.QACsv

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+import csv
+
+
+
[docs]def QA_util_save_csv(data, name, column=None, location=None): + # 重写了一下保存的模式 + # 增加了对于可迭代对象的判断 2017/8/10 + """ + QA_util_save_csv(data,name,column,location) + + 将list保存成csv + 第一个参数是list + 第二个参数是要保存的名字 + 第三个参数是行的名称(可选) + 第四个是保存位置(可选) + + @yutiansut + """ + assert isinstance(data, list) + if location is None: + path = './' + str(name) + '.csv' + else: + path = location + str(name) + '.csv' + with open(path, 'w', newline='') as f: + csvwriter = csv.writer(f) + if column is None: + pass + else: + csvwriter.writerow(column) + + for item in data: + + if isinstance(item, list): + csvwriter.writerow(item) + else: + csvwriter.writerow([item])
+ + +if __name__ == '__main__': + QA_util_save_csv(['a', 'v', 2, 3], 'test') + QA_util_save_csv([['a', 'v', 2, 3]], 'test2') +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAUtil/QADate.html b/_build/html/_modules/QUANTAXIS/QAUtil/QADate.html new file mode 100644 index 000000000..037d9956d --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAUtil/QADate.html @@ -0,0 +1,440 @@ + + + + + + + + QUANTAXIS.QAUtil.QADate — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAUtil.QADate

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+import datetime
+import threading
+import time
+
+from QUANTAXIS.QAUtil.QALogs import QA_util_log_info
+
+
+
[docs]def QA_util_time_now(): + """[summary] + + Returns: + [type] -- [description] + """ + + return datetime.datetime.now()
+ + +
[docs]def QA_util_date_today(): + """[summary] + + Returns: + [type] -- [description] + """ + + return datetime.date.today()
+ + +
[docs]def QA_util_date_str2int(date): + """[summary] + + Arguments: + date {[type]} -- [description] + + Returns: + [type] -- [description] + """ + + return int(str(date)[0:4] + str(date)[5:7] + str(date)[8:10])
+ + +
[docs]def QA_util_date_int2str(date): + """[summary] + + Arguments: + date {[type]} -- [description] + + Returns: + [type] -- [description] + """ + + return str(str(date)[0:4] + '-' + str(date)[4:6] + '-' + str(date)[6:8])
+ + +
[docs]def QA_util_to_datetime(time): + """[summary] + + Arguments: + time {[type]} -- [description] + + Returns: + [type] -- [description] + """ + + if len(str(time)) == 10: + _time = '{} 00:00:00'.format(time) + elif len(str(time)) == 19: + _time = str(time) + else: + QA_util_log_info('WRONG DATETIME FORMAT {}'.format(time)) + return datetime.datetime.strptime(_time, '%Y-%m-%d %H:%M:%S')
+ + +
[docs]def QA_util_date_stamp(date): + """[summary] + + Arguments: + date {[type]} -- [description] + + Returns: + [type] -- [description] + """ + + datestr = str(date)[0:10] + date = time.mktime(time.strptime(datestr, '%Y-%m-%d')) + return date
+ + +
[docs]def QA_util_time_stamp(time_): + ''' + 数据格式最好是%Y-%m-%d %H:%M:%S 中间要有空格 + ''' + if len(str(time_)) == 10: + # yyyy-mm-dd格式 + return time.mktime(time.strptime(time_, '%Y-%m-%d')) + elif len(str(time_)) == 16: + # yyyy-mm-dd hh:mm格式 + return time.mktime(time.strptime(time_, '%Y-%m-%d %H:%M')) + else: + timestr = str(time_)[0:19] + return time.mktime(time.strptime(timestr, '%Y-%m-%d %H:%M:%S'))
+ + +
[docs]def QA_util_stamp2datetime(timestamp): + """ + datestamp转datetime + + pandas转出来的timestamp是13位整数 要/1000 + + """ + try: + return datetime.datetime.fromtimestamp(timestamp) + except Exception as e: + return datetime.datetime.fromtimestamp(timestamp / 1000)
+ + +
[docs]def QA_util_ms_stamp(ms): + """[summary] + + Arguments: + ms {[type]} -- [description] + + Returns: + [type] -- [description] + """ + + return ms
+ + +
[docs]def QA_util_date_valid(date): + """[summary] + + Arguments: + date {[type]} -- [description] + + Returns: + [type] -- [description] + """ + + try: + + time.strptime(date, "%Y-%m-%d") + return True + except: + return False
+ + +
[docs]def QA_util_realtime(strtime, client): + """[summary] + + Arguments: + strtime {[type]} -- [description] + client {[type]} -- [description] + """ + + time_stamp = QA_util_date_stamp(strtime) + coll = client.quantaxis.trade_date + temp_str = coll.find_one({'date_stamp': {"$gte": time_stamp}}) + time_real = temp_str['date'] + time_id = temp_str['num'] + return {'time_real': time_real, 'id': time_id}
+ + +
[docs]def QA_util_id2date(idx, client): + """[summary] + + Arguments: + idx {[type]} -- [description] + client {[type]} -- [description] + + Returns: + [type] -- [description] + """ + + coll = client.quantaxis.trade_date + temp_str = coll.find_one({'num': idx}) + return temp_str['date']
+ + +
[docs]def QA_util_is_trade(date, code, client): + """判断是否是交易日 + + Arguments: + date {[type]} -- [description] + code {[type]} -- [description] + client {[type]} -- [description] + + Returns: + [type] -- [description] + """ + + coll = client.quantaxis.stock_day + date = str(date)[0:10] + is_trade = coll.find_one({'code': code, 'date': date}) + try: + len(is_trade) + return True + except: + return False
+ + +
[docs]def QA_util_get_date_index(date, trade_list): + """返回在trade_list中的index位置 + + Arguments: + date {[type]} -- [description] + trade_list {[type]} -- [description] + + Returns: + [type] -- [description] + """ + + return trade_list.index(date)
+ + +
[docs]def QA_util_get_index_date(id, trade_list): + return trade_list[id]
+ + +
[docs]def QA_util_select_hours(time=None, gt=None, lt=None, gte=None, lte=None): + 'quantaxis的时间选择函数,约定时间的范围,比如早上9点到11点' + if time is None: + __realtime = datetime.datetime.now() + else: + __realtime = time + + fun_list = [] + if gt != None: + fun_list.append('>') + if lt != None: + fun_list.append('<') + if gte != None: + fun_list.append('>=') + if lte != None: + fun_list.append('<=') + + assert len(fun_list) > 0 + true_list = [] + try: + for item in fun_list: + if item == '>': + if __realtime.strftime('%H') > gt: + true_list.append(0) + else: + true_list.append(1) + elif item == '<': + if __realtime.strftime('%H') < lt: + true_list.append(0) + else: + true_list.append(1) + elif item == '>=': + if __realtime.strftime('%H') >= gte: + true_list.append(0) + else: + true_list.append(1) + elif item == '<=': + if __realtime.strftime('%H') <= lte: + true_list.append(0) + else: + true_list.append(1) + + except: + return Exception + if sum(true_list) > 0: + return False + else: + return True
+ + +
[docs]def QA_util_select_min(time=None, gt=None, lt=None, gte=None, lte=None): + 'quantaxis的时间选择函数,约定时间的范围,比如30分到59分' + if time is None: + __realtime = datetime.datetime.now() + else: + __realtime = time + + fun_list = [] + if gt != None: + fun_list.append('>') + if lt != None: + fun_list.append('<') + if gte != None: + fun_list.append('>=') + if lte != None: + fun_list.append('<=') + + assert len(fun_list) > 0 + true_list = [] + try: + for item in fun_list: + if item == '>': + if __realtime.strftime('%M') > gt: + true_list.append(0) + else: + true_list.append(1) + elif item == '<': + if __realtime.strftime('%M') < lt: + true_list.append(0) + else: + true_list.append(1) + elif item == '>=': + if __realtime.strftime('%M') >= gte: + true_list.append(0) + else: + true_list.append(1) + elif item == '<=': + if __realtime.strftime('%M') <= lte: + true_list.append(0) + else: + true_list.append(1) + + except: + return Exception + if sum(true_list) > 0: + return False + else: + return True
+ + +
[docs]def QA_util_time_delay(time_=0): + '这是一个用于复用/比如说@装饰器的延时函数\ + 使用threading里面的延时,为了是不阻塞进程\ + 有时候,同时发进去两个函数,第一个函数需要延时\ + 第二个不需要的话,用sleep就会阻塞掉第二个进程' + def _exec(func): + threading.Timer(time_, func) + return _exec
+ + +
[docs]def QA_util_calc_time(func, *args, **kwargs): + '耗时长度的装饰器' + _time = datetime.datetime.now() + func(*args, **kwargs) + print(datetime.datetime.now() - _time)
+ # return datetime.datetime.now() - _time + + +if __name__ == '__main__': + print(QA_util_time_stamp('2017-01-01 10:25:08')) +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAUtil/QADate_trade.html b/_build/html/_modules/QUANTAXIS/QAUtil/QADate_trade.html new file mode 100644 index 000000000..484580f09 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAUtil/QADate_trade.html @@ -0,0 +1,242 @@ + + + + + + + + QUANTAXIS.QAUtil.QADate_trade — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAUtil.QADate_trade

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+import datetime
+
+from QUANTAXIS.QAUtil.QAParameter import MARKET_TYPE
+
+trade_date_sse = ['1990-12-19', '1990-12-20', '1990-12-21', '1990-12-24', '1990-12-25', '1990-12-26', '1990-12-27', '1990-12-28', '1990-12-31', '1991-01-02', '1991-01-03', '1991-01-04', '1991-01-07', '1991-01-08', '1991-01-09', '1991-01-10', '1991-01-11', '1991-01-14', '1991-01-15', '1991-01-16', '1991-01-17', '1991-01-18', '1991-01-21', '1991-01-22', '1991-01-23', '1991-01-24', '1991-01-25', '1991-01-28', '1991-01-29', '1991-01-30', '1991-01-31', '1991-02-01', '1991-02-04', '1991-02-05', '1991-02-06', '1991-02-07', '1991-02-08', '1991-02-11', '1991-02-12', '1991-02-13', '1991-02-14', '1991-02-19', '1991-02-20', '1991-02-21', '1991-02-22', '1991-02-25', '1991-02-26', '1991-02-27', '1991-02-28', '1991-03-01', '1991-03-04', '1991-03-05', '1991-03-06', '1991-03-07', '1991-03-08', '1991-03-11', '1991-03-12', '1991-03-13', '1991-03-14', '1991-03-15', '1991-03-18', '1991-03-19', '1991-03-20', '1991-03-21', '1991-03-22', '1991-03-25', '1991-03-26', '1991-03-27', '1991-03-28', '1991-03-29', '1991-04-01', '1991-04-02', '1991-04-03', '1991-04-04', '1991-04-05', '1991-04-08', '1991-04-09', '1991-04-10', '1991-04-11', '1991-04-12', '1991-04-15', '1991-04-16', '1991-04-17', '1991-04-18', '1991-04-19', '1991-04-22', '1991-04-23', '1991-04-24', '1991-04-25', '1991-04-26', '1991-04-29', '1991-04-30', '1991-05-02', '1991-05-03', '1991-05-06', '1991-05-07', '1991-05-08', '1991-05-09', '1991-05-10', '1991-05-13', '1991-05-14', '1991-05-15', '1991-05-16', '1991-05-17', '1991-05-20', '1991-05-21', '1991-05-22', '1991-05-23', '1991-05-24', '1991-05-27', '1991-05-28', '1991-05-29', '1991-05-30', '1991-05-31', '1991-06-03', '1991-06-04', '1991-06-05', '1991-06-06', '1991-06-07', '1991-06-10', '1991-06-11', '1991-06-12', '1991-06-13', '1991-06-14', '1991-06-17', '1991-06-18', '1991-06-19', '1991-06-20', '1991-06-21', '1991-06-24', '1991-06-25', '1991-06-26', '1991-06-27', '1991-06-28', '1991-07-01', '1991-07-02', '1991-07-03', '1991-07-04', '1991-07-05', '1991-07-08', '1991-07-09', '1991-07-10', '1991-07-11', '1991-07-12', '1991-07-15', '1991-07-16', '1991-07-17', '1991-07-18', '1991-07-19', '1991-07-22', '1991-07-23', '1991-07-24', '1991-07-25', '1991-07-26', '1991-07-29', '1991-07-30', '1991-07-31', '1991-08-01', '1991-08-02', '1991-08-05', '1991-08-06', '1991-08-07', '1991-08-08', '1991-08-09', '1991-08-12', '1991-08-13', '1991-08-14', '1991-08-15', '1991-08-16', '1991-08-19', '1991-08-20', '1991-08-21', '1991-08-22', '1991-08-23', '1991-08-26', '1991-08-27', '1991-08-28', '1991-08-29', '1991-08-30', '1991-09-02', '1991-09-03', '1991-09-04', '1991-09-05', '1991-09-06', '1991-09-09', '1991-09-10', '1991-09-11', '1991-09-12', '1991-09-13', '1991-09-16', '1991-09-17', '1991-09-18', '1991-09-19', '1991-09-20', '1991-09-23', '1991-09-24', '1991-09-25', '1991-09-26', '1991-09-27', '1991-09-30', '1991-10-03', '1991-10-04', '1991-10-07', '1991-10-08', '1991-10-09', '1991-10-10', '1991-10-11', '1991-10-14', '1991-10-15', '1991-10-16', '1991-10-17', '1991-10-18', '1991-10-21', '1991-10-22', '1991-10-23', '1991-10-24', '1991-10-25', '1991-10-28', '1991-10-29', '1991-10-30', '1991-10-31', '1991-11-01', '1991-11-04', '1991-11-05', '1991-11-06', '1991-11-07', '1991-11-08', '1991-11-11', '1991-11-12', '1991-11-13', '1991-11-14', '1991-11-15', '1991-11-18', '1991-11-19', '1991-11-20', '1991-11-21', '1991-11-22', '1991-11-25', '1991-11-26', '1991-11-27', '1991-11-28', '1991-11-29', '1991-12-02', '1991-12-03', '1991-12-04', '1991-12-05', '1991-12-06', '1991-12-09', '1991-12-10', '1991-12-11', '1991-12-12', '1991-12-13', '1991-12-16', '1991-12-17', '1991-12-18', '1991-12-19', '1991-12-20', '1991-12-23', '1991-12-24', '1991-12-25', '1991-12-26', '1991-12-27', '1991-12-30', '1991-12-31', '1992-01-02', '1992-01-03', '1992-01-06', '1992-01-07', '1992-01-08', '1992-01-09', '1992-01-10', '1992-01-13', '1992-01-14', '1992-01-15', '1992-01-16', '1992-01-17', '1992-01-20', '1992-01-21', '1992-01-22', '1992-01-23', '1992-01-24', '1992-01-27', '1992-01-28', '1992-01-29', '1992-01-30', '1992-01-31', '1992-02-03', '1992-02-07', '1992-02-10', '1992-02-11', '1992-02-12', '1992-02-13', '1992-02-14', '1992-02-17', '1992-02-18', '1992-02-19', '1992-02-20', '1992-02-21', '1992-02-24', '1992-02-25', '1992-02-26', '1992-02-27', '1992-02-28', '1992-03-02', '1992-03-03', '1992-03-04', '1992-03-05', '1992-03-06', '1992-03-09', '1992-03-10', '1992-03-11', '1992-03-12', '1992-03-13', '1992-03-16', '1992-03-17', '1992-03-18', '1992-03-19', '1992-03-20', '1992-03-23', '1992-03-24', '1992-03-25', '1992-03-26', '1992-03-27', '1992-03-30', '1992-03-31', '1992-04-01', '1992-04-02', '1992-04-03', '1992-04-06', '1992-04-07', '1992-04-08', '1992-04-09', '1992-04-10', '1992-04-13', '1992-04-14', '1992-04-15', '1992-04-16', '1992-04-17', '1992-04-20', '1992-04-21', '1992-04-22', '1992-04-23', '1992-04-24', '1992-04-27', '1992-04-28', '1992-04-29', '1992-04-30', '1992-05-04', '1992-05-05', '1992-05-06', '1992-05-07', '1992-05-08', '1992-05-11', '1992-05-12', '1992-05-13', '1992-05-14', '1992-05-15', '1992-05-18', '1992-05-19', '1992-05-20', '1992-05-21', '1992-05-22', '1992-05-25', '1992-05-26', '1992-05-27', '1992-05-28', '1992-05-29', '1992-06-01', '1992-06-02', '1992-06-03', '1992-06-04', '1992-06-05', '1992-06-08', '1992-06-09', '1992-06-10', '1992-06-11', '1992-06-12', '1992-06-15', '1992-06-16', '1992-06-17', '1992-06-18', '1992-06-19', '1992-06-22', '1992-06-23', '1992-06-24', '1992-06-25', '1992-06-26', '1992-06-29', '1992-06-30', '1992-07-01', '1992-07-02', '1992-07-03', '1992-07-06', '1992-07-07', '1992-07-08', '1992-07-09', '1992-07-10', '1992-07-13', '1992-07-14', '1992-07-15', '1992-07-16', '1992-07-17', '1992-07-20', '1992-07-21', '1992-07-22', '1992-07-23', '1992-07-24', '1992-07-27', '1992-07-28', '1992-07-29', '1992-07-30', '1992-07-31', '1992-08-03', '1992-08-04', '1992-08-05', '1992-08-06', '1992-08-07', '1992-08-10', '1992-08-11', '1992-08-12', '1992-08-13', '1992-08-14', '1992-08-17', '1992-08-18', '1992-08-19', '1992-08-20', '1992-08-21', '1992-08-24', '1992-08-25', '1992-08-26', '1992-08-27', '1992-08-28', '1992-08-31', '1992-09-01', '1992-09-02', '1992-09-03', '1992-09-04', '1992-09-07', '1992-09-08', '1992-09-09', '1992-09-10', '1992-09-11', '1992-09-14', '1992-09-15', '1992-09-16', '1992-09-17', '1992-09-18', '1992-09-21', '1992-09-22', '1992-09-23', '1992-09-24', '1992-09-25', '1992-09-28', '1992-09-29', '1992-09-30', '1992-10-05', '1992-10-06', '1992-10-07', '1992-10-08', '1992-10-09', '1992-10-12', '1992-10-13', '1992-10-14', '1992-10-15', '1992-10-16', '1992-10-19', '1992-10-20', '1992-10-21', '1992-10-22', '1992-10-23', '1992-10-26', '1992-10-27', '1992-10-28', '1992-10-29', '1992-10-30', '1992-11-02', '1992-11-03', '1992-11-04', '1992-11-05', '1992-11-06', '1992-11-09', '1992-11-10', '1992-11-11', '1992-11-12', '1992-11-13', '1992-11-16', '1992-11-17', '1992-11-18', '1992-11-19', '1992-11-20', '1992-11-23', '1992-11-24', '1992-11-25', '1992-11-26', '1992-11-27', '1992-11-30', '1992-12-01', '1992-12-02', '1992-12-03', '1992-12-04', '1992-12-07', '1992-12-08', '1992-12-09', '1992-12-10', '1992-12-11', '1992-12-14', '1992-12-15', '1992-12-16', '1992-12-17', '1992-12-18', '1992-12-21', '1992-12-22', '1992-12-23', '1992-12-24', '1992-12-25', '1992-12-28', '1992-12-29', '1992-12-30', '1992-12-31', '1993-01-04', '1993-01-05', '1993-01-06', '1993-01-07', '1993-01-08', '1993-01-11', '1993-01-12', '1993-01-13', '1993-01-14', '1993-01-15', '1993-01-18', '1993-01-19', '1993-01-20', '1993-01-21', '1993-01-22', '1993-01-27', '1993-01-28', '1993-01-29', '1993-02-01', '1993-02-02', '1993-02-03', '1993-02-04', '1993-02-05', '1993-02-08', '1993-02-09', '1993-02-10', '1993-02-11', '1993-02-12', '1993-02-15', '1993-02-16', '1993-02-17', '1993-02-18', '1993-02-19', '1993-02-22', '1993-02-23', '1993-02-24', '1993-02-25', '1993-02-26', '1993-03-01', '1993-03-02', '1993-03-03', '1993-03-04', '1993-03-05', '1993-03-08', '1993-03-09', '1993-03-10', '1993-03-11', '1993-03-12', '1993-03-15', '1993-03-16', '1993-03-17', '1993-03-18', '1993-03-19', '1993-03-22', '1993-03-23', '1993-03-24', '1993-03-25', '1993-03-26', '1993-03-29', '1993-03-30', '1993-03-31', '1993-04-01', '1993-04-02', '1993-04-05', '1993-04-06', '1993-04-07', '1993-04-08', '1993-04-09', '1993-04-12', '1993-04-13', '1993-04-14', '1993-04-15', '1993-04-16', '1993-04-19', '1993-04-20', '1993-04-21', '1993-04-22', '1993-04-23', '1993-04-26', '1993-04-27', '1993-04-28', '1993-04-29', '1993-04-30', '1993-05-03', '1993-05-04', '1993-05-05', '1993-05-06', '1993-05-07', '1993-05-10', '1993-05-11', '1993-05-12', '1993-05-13', '1993-05-14', '1993-05-17', '1993-05-18', '1993-05-19', '1993-05-20', '1993-05-21', '1993-05-24', '1993-05-25', '1993-05-26', '1993-05-27', '1993-05-28', '1993-05-31', '1993-06-01', '1993-06-02', '1993-06-03', '1993-06-04', '1993-06-07', '1993-06-08', '1993-06-09', '1993-06-10', '1993-06-11', '1993-06-14', '1993-06-15', '1993-06-16', '1993-06-17', '1993-06-18', '1993-06-21', '1993-06-22', '1993-06-23', '1993-06-24', '1993-06-25', '1993-06-28', '1993-06-29', '1993-06-30', '1993-07-01', '1993-07-02', '1993-07-05', '1993-07-06', '1993-07-07', '1993-07-08', '1993-07-09', '1993-07-12', '1993-07-13', '1993-07-14', '1993-07-15', '1993-07-16', '1993-07-19', '1993-07-20', '1993-07-21', '1993-07-22', '1993-07-23', '1993-07-26', '1993-07-27', '1993-07-28', '1993-07-29', '1993-07-30', '1993-08-02', '1993-08-03', '1993-08-04', '1993-08-05', '1993-08-06', '1993-08-09', '1993-08-10', '1993-08-11', '1993-08-12', '1993-08-13', '1993-08-16', '1993-08-17', '1993-08-18', '1993-08-19', '1993-08-20', '1993-08-23', '1993-08-24', '1993-08-25', '1993-08-26', '1993-08-27', '1993-08-30', '1993-08-31', '1993-09-01', '1993-09-02', '1993-09-03', '1993-09-06', '1993-09-07', '1993-09-08', '1993-09-09', '1993-09-10', '1993-09-13', '1993-09-14', '1993-09-15', '1993-09-16', '1993-09-17', '1993-09-20', '1993-09-21', '1993-09-22', '1993-09-23', '1993-09-24', '1993-09-27', '1993-09-28', '1993-09-29', '1993-09-30', '1993-10-04', '1993-10-05', '1993-10-06', '1993-10-07', '1993-10-08', '1993-10-11', '1993-10-12', '1993-10-13', '1993-10-14', '1993-10-15', '1993-10-18', '1993-10-19', '1993-10-20', '1993-10-21', '1993-10-22', '1993-10-25', '1993-10-26', '1993-10-27', '1993-10-28', '1993-10-29', '1993-11-01', '1993-11-02', '1993-11-03', '1993-11-04', '1993-11-05', '1993-11-08', '1993-11-09', '1993-11-10', '1993-11-11', '1993-11-12', '1993-11-15', '1993-11-16', '1993-11-17', '1993-11-18', '1993-11-19', '1993-11-22', '1993-11-23', '1993-11-24', '1993-11-25', '1993-11-26', '1993-11-29', '1993-11-30', '1993-12-01', '1993-12-02', '1993-12-03', '1993-12-06', '1993-12-07', '1993-12-08', '1993-12-09', '1993-12-10', '1993-12-13', '1993-12-14', '1993-12-15', '1993-12-16', '1993-12-17', '1993-12-20', '1993-12-21', '1993-12-22', '1993-12-23', '1993-12-24', '1993-12-27', '1993-12-28', '1993-12-29', '1993-12-30', '1993-12-31', '1994-01-03', '1994-01-04', '1994-01-05', '1994-01-06', '1994-01-07', '1994-01-10', '1994-01-11', '1994-01-12', '1994-01-13', '1994-01-14', '1994-01-17', '1994-01-18', '1994-01-19', '1994-01-20', '1994-01-21', '1994-01-24', '1994-01-25', '1994-01-26', '1994-01-27', '1994-01-28', '1994-01-31', '1994-02-01', '1994-02-02', '1994-02-03', '1994-02-04', '1994-02-14', '1994-02-15', '1994-02-16', '1994-02-17', '1994-02-18', '1994-02-21', '1994-02-22', '1994-02-23', '1994-02-24', '1994-02-25', '1994-02-28', '1994-03-01', '1994-03-02', '1994-03-03', '1994-03-04', '1994-03-07', '1994-03-08', '1994-03-09', '1994-03-10', '1994-03-11', '1994-03-14', '1994-03-15', '1994-03-16', '1994-03-17', '1994-03-18', '1994-03-21', '1994-03-22', '1994-03-23', '1994-03-24', '1994-03-25', '1994-03-28', '1994-03-29', '1994-03-30', '1994-03-31', '1994-04-01', '1994-04-04', '1994-04-05', '1994-04-06', '1994-04-07', '1994-04-08', '1994-04-11', '1994-04-12', '1994-04-13', '1994-04-14', '1994-04-15', '1994-04-18', '1994-04-19', '1994-04-20', '1994-04-21', '1994-04-22', '1994-04-25', '1994-04-26', '1994-04-27', '1994-04-28', '1994-04-29', '1994-05-03', '1994-05-04', '1994-05-05', '1994-05-06', '1994-05-09', '1994-05-10', '1994-05-11', '1994-05-12', '1994-05-13', '1994-05-16', '1994-05-17', '1994-05-18', '1994-05-19', '1994-05-20', '1994-05-23', '1994-05-24', '1994-05-25', '1994-05-26', '1994-05-27', '1994-05-30', '1994-05-31', '1994-06-01', '1994-06-02', '1994-06-03', '1994-06-06', '1994-06-07', '1994-06-08', '1994-06-09', '1994-06-10', '1994-06-13', '1994-06-14', '1994-06-15', '1994-06-16', '1994-06-17', '1994-06-20', '1994-06-21', '1994-06-22', '1994-06-23', '1994-06-24', '1994-06-27', '1994-06-28', '1994-06-29', '1994-06-30', '1994-07-01', '1994-07-04', '1994-07-05', '1994-07-06', '1994-07-07', '1994-07-08', '1994-07-11', '1994-07-12', '1994-07-13', '1994-07-14', '1994-07-15', '1994-07-18', '1994-07-19', '1994-07-20', '1994-07-21', '1994-07-22', '1994-07-25', '1994-07-26', '1994-07-27', '1994-07-28', '1994-07-29', '1994-08-01', '1994-08-02', '1994-08-03', '1994-08-04', '1994-08-05', '1994-08-08', '1994-08-09', '1994-08-10', '1994-08-11', '1994-08-12', '1994-08-15', '1994-08-16', '1994-08-17', '1994-08-18', '1994-08-19', '1994-08-22', '1994-08-23', '1994-08-24', '1994-08-25', '1994-08-26', '1994-08-29', '1994-08-30', '1994-08-31', '1994-09-01', '1994-09-02', '1994-09-05', '1994-09-06', '1994-09-07', '1994-09-08', '1994-09-09', '1994-09-12', '1994-09-13', '1994-09-14', '1994-09-15', '1994-09-16', '1994-09-19', '1994-09-20', '1994-09-21', '1994-09-22', '1994-09-23', '1994-09-26', '1994-09-27', '1994-09-28', '1994-09-29', '1994-09-30', '1994-10-05', '1994-10-06', '1994-10-07', '1994-10-10', '1994-10-11', '1994-10-12', '1994-10-13', '1994-10-14', '1994-10-17', '1994-10-18', '1994-10-19', '1994-10-20', '1994-10-21', '1994-10-24', '1994-10-25', '1994-10-26', '1994-10-27', '1994-10-28', '1994-10-31', '1994-11-01', '1994-11-02', '1994-11-03', '1994-11-04', '1994-11-07', '1994-11-08', '1994-11-09', '1994-11-10', '1994-11-11', '1994-11-14', '1994-11-15', '1994-11-16', '1994-11-17', '1994-11-18', '1994-11-21', '1994-11-22', '1994-11-23', '1994-11-24', '1994-11-25', '1994-11-28', '1994-11-29', '1994-11-30', '1994-12-01', '1994-12-02', '1994-12-05', '1994-12-06', '1994-12-07', '1994-12-08', '1994-12-09', '1994-12-12', '1994-12-13', '1994-12-14', '1994-12-15', '1994-12-16', '1994-12-19', '1994-12-20', '1994-12-21', '1994-12-22', '1994-12-23', '1994-12-26', '1994-12-27', '1994-12-28', '1994-12-29', '1994-12-30', '1995-01-03', '1995-01-04', '1995-01-05', '1995-01-06', '1995-01-09', '1995-01-10', '1995-01-11', '1995-01-12', '1995-01-13', '1995-01-16', '1995-01-17', '1995-01-18', '1995-01-19', '1995-01-20', '1995-01-23', '1995-01-24', '1995-01-25', '1995-01-26', '1995-01-27', '1995-02-06', '1995-02-07', '1995-02-08', '1995-02-09', '1995-02-10', '1995-02-13', '1995-02-14', '1995-02-15', '1995-02-16', '1995-02-17', '1995-02-20', '1995-02-21', '1995-02-22', '1995-02-23', '1995-02-24', '1995-02-27', '1995-02-28', '1995-03-01', '1995-03-02', '1995-03-03', '1995-03-06', '1995-03-07', '1995-03-08', '1995-03-09', '1995-03-10', '1995-03-13', '1995-03-14', '1995-03-15', '1995-03-16', '1995-03-17', '1995-03-20', '1995-03-21', '1995-03-22', '1995-03-23', '1995-03-24', '1995-03-27', '1995-03-28', '1995-03-29', '1995-03-30', '1995-03-31', '1995-04-03', '1995-04-04', '1995-04-05', '1995-04-06', '1995-04-07', '1995-04-10', '1995-04-11', '1995-04-12', '1995-04-13', '1995-04-14', '1995-04-17', '1995-04-18', '1995-04-19', '1995-04-20', '1995-04-21', '1995-04-24', '1995-04-25', '1995-04-26', '1995-04-27', '1995-04-28', '1995-05-02', '1995-05-03', '1995-05-04', '1995-05-05', '1995-05-08', '1995-05-09', '1995-05-10', '1995-05-11', '1995-05-12', '1995-05-15', '1995-05-16', '1995-05-17', '1995-05-18', '1995-05-19', '1995-05-22', '1995-05-23', '1995-05-24', '1995-05-25', '1995-05-26', '1995-05-29', '1995-05-30', '1995-05-31', '1995-06-01', '1995-06-02', '1995-06-05', '1995-06-06', '1995-06-07', '1995-06-08', '1995-06-09', '1995-06-12', '1995-06-13', '1995-06-14', '1995-06-15', '1995-06-16', '1995-06-19', '1995-06-20', '1995-06-21', '1995-06-22', '1995-06-23', '1995-06-26', '1995-06-27', '1995-06-28', '1995-06-29', '1995-06-30', '1995-07-03', '1995-07-04', '1995-07-05', '1995-07-06', '1995-07-07', '1995-07-10', '1995-07-11', '1995-07-12', '1995-07-13', '1995-07-14', '1995-07-17', '1995-07-18', '1995-07-19', '1995-07-20', '1995-07-21', '1995-07-24', '1995-07-25', '1995-07-26', '1995-07-27', '1995-07-28', '1995-07-31', '1995-08-01', '1995-08-02', '1995-08-03', '1995-08-04', '1995-08-07', '1995-08-08', '1995-08-09', '1995-08-10', '1995-08-11', '1995-08-14', '1995-08-15', '1995-08-16', '1995-08-17', '1995-08-18', '1995-08-21', '1995-08-22', '1995-08-23', '1995-08-24', '1995-08-25', '1995-08-28', '1995-08-29', '1995-08-30', '1995-08-31', '1995-09-01', '1995-09-04', '1995-09-05', '1995-09-06', '1995-09-07', '1995-09-08', '1995-09-11', '1995-09-12', '1995-09-13', '1995-09-14', '1995-09-15', '1995-09-18', '1995-09-19', '1995-09-20', '1995-09-21', '1995-09-22', '1995-09-25', '1995-09-26', '1995-09-27', '1995-09-28', '1995-09-29', '1995-10-04', '1995-10-05', '1995-10-06', '1995-10-09', '1995-10-10', '1995-10-11', '1995-10-12', '1995-10-13', '1995-10-16', '1995-10-17', '1995-10-18', '1995-10-19', '1995-10-20', '1995-10-23', '1995-10-24', '1995-10-25', '1995-10-26', '1995-10-27', '1995-10-30', '1995-10-31', '1995-11-01', '1995-11-02', '1995-11-03', '1995-11-06', '1995-11-07', '1995-11-08', '1995-11-09', '1995-11-10', '1995-11-13', '1995-11-14', '1995-11-15', '1995-11-16', '1995-11-17', '1995-11-20', '1995-11-21', '1995-11-22', '1995-11-23', '1995-11-24', '1995-11-27', '1995-11-28', '1995-11-29', '1995-11-30', '1995-12-01', '1995-12-04', '1995-12-05', '1995-12-06', '1995-12-07', '1995-12-08', '1995-12-11', '1995-12-12', '1995-12-13', '1995-12-14', '1995-12-15', '1995-12-18', '1995-12-19', '1995-12-20', '1995-12-21', '1995-12-22', '1995-12-25', '1995-12-26', '1995-12-27', '1995-12-28', '1995-12-29', '1996-01-02', '1996-01-03', '1996-01-04', '1996-01-05', '1996-01-08', '1996-01-09', '1996-01-10', '1996-01-11', '1996-01-12', '1996-01-15', '1996-01-16', '1996-01-17', '1996-01-18', '1996-01-19', '1996-01-22', '1996-01-23', '1996-01-24', '1996-01-25', '1996-01-26', '1996-01-29', '1996-01-30', '1996-01-31', '1996-02-01', '1996-02-02', '1996-02-05', '1996-02-06', '1996-02-07', '1996-02-08', '1996-02-09', '1996-02-12', '1996-02-13', '1996-02-14', '1996-02-15', '1996-02-16', '1996-03-04', '1996-03-05', '1996-03-06', '1996-03-07', '1996-03-08', '1996-03-11', '1996-03-12', '1996-03-13', '1996-03-14', '1996-03-15', '1996-03-18', '1996-03-19', '1996-03-20', '1996-03-21', '1996-03-22', '1996-03-25', '1996-03-26', '1996-03-27', '1996-03-28', '1996-03-29', '1996-04-01', '1996-04-02', '1996-04-03', '1996-04-04', '1996-04-05', '1996-04-08', '1996-04-09', '1996-04-10', '1996-04-11', '1996-04-12', '1996-04-15', '1996-04-16', '1996-04-17', '1996-04-18', '1996-04-19', '1996-04-22', '1996-04-23', '1996-04-24', '1996-04-25', '1996-04-26', '1996-04-29', '1996-04-30', '1996-05-02', '1996-05-03', '1996-05-06', '1996-05-07', '1996-05-08', '1996-05-09', '1996-05-10', '1996-05-13', '1996-05-14', '1996-05-15', '1996-05-16', '1996-05-17', '1996-05-20', '1996-05-21', '1996-05-22', '1996-05-23', '1996-05-24', '1996-05-27', '1996-05-28', '1996-05-29', '1996-05-30', '1996-05-31', '1996-06-03', '1996-06-04', '1996-06-05', '1996-06-06', '1996-06-07', '1996-06-10', '1996-06-11', '1996-06-12', '1996-06-13', '1996-06-14', '1996-06-17', '1996-06-18', '1996-06-19', '1996-06-20', '1996-06-21', '1996-06-24', '1996-06-25', '1996-06-26', '1996-06-27', '1996-06-28', '1996-07-01', '1996-07-02', '1996-07-03', '1996-07-04', '1996-07-05', '1996-07-08', '1996-07-09', '1996-07-10', '1996-07-11', '1996-07-12', '1996-07-15', '1996-07-16', '1996-07-17', '1996-07-18', '1996-07-19', '1996-07-22', '1996-07-23', '1996-07-24', '1996-07-25', '1996-07-26', '1996-07-29', '1996-07-30', '1996-07-31', '1996-08-01', '1996-08-02', '1996-08-05', '1996-08-06', '1996-08-07', '1996-08-08', '1996-08-09', '1996-08-12', '1996-08-13', '1996-08-14', '1996-08-15', '1996-08-16', '1996-08-19', '1996-08-20', '1996-08-21', '1996-08-22', '1996-08-23', '1996-08-26', '1996-08-27', '1996-08-28', '1996-08-29', '1996-08-30', '1996-09-02', '1996-09-03', '1996-09-04', '1996-09-05', '1996-09-06', '1996-09-09', '1996-09-10', '1996-09-11', '1996-09-12', '1996-09-13', '1996-09-16', '1996-09-17', '1996-09-18', '1996-09-19', '1996-09-20', '1996-09-23', '1996-09-24', '1996-09-25', '1996-09-26', '1996-09-27', '1996-10-03', '1996-10-04', '1996-10-07', '1996-10-08', '1996-10-09', '1996-10-10', '1996-10-11', '1996-10-14', '1996-10-15', '1996-10-16', '1996-10-17', '1996-10-18', '1996-10-21', '1996-10-22', '1996-10-23', '1996-10-24', '1996-10-25', '1996-10-28', '1996-10-29', '1996-10-30', '1996-10-31', '1996-11-01', '1996-11-04', '1996-11-05', '1996-11-06', '1996-11-07', '1996-11-08', '1996-11-11', '1996-11-12', '1996-11-13', '1996-11-14', '1996-11-15', '1996-11-18', '1996-11-19', '1996-11-20', '1996-11-21', '1996-11-22', '1996-11-25', '1996-11-26', '1996-11-27', '1996-11-28', '1996-11-29', '1996-12-02', '1996-12-03', '1996-12-04', '1996-12-05', '1996-12-06', '1996-12-09', '1996-12-10', '1996-12-11', '1996-12-12', '1996-12-13', '1996-12-16', '1996-12-17', '1996-12-18', '1996-12-19', '1996-12-20', '1996-12-23', '1996-12-24', '1996-12-25', '1996-12-26', '1996-12-27', '1996-12-30', '1996-12-31', '1997-01-02', '1997-01-03', '1997-01-06', '1997-01-07', '1997-01-08', '1997-01-09', '1997-01-10', '1997-01-13', '1997-01-14', '1997-01-15', '1997-01-16', '1997-01-17', '1997-01-20', '1997-01-21', '1997-01-22', '1997-01-23', '1997-01-24', '1997-01-27', '1997-01-28', '1997-01-29', '1997-01-30', '1997-01-31', '1997-02-17', '1997-02-18', '1997-02-19', '1997-02-20', '1997-02-21', '1997-02-24', '1997-02-25', '1997-02-26', '1997-02-27', '1997-02-28', '1997-03-03', '1997-03-04', '1997-03-05', '1997-03-06', '1997-03-07', '1997-03-10', '1997-03-11', '1997-03-12', '1997-03-13', '1997-03-14', '1997-03-17', '1997-03-18', '1997-03-19', '1997-03-20', '1997-03-21', '1997-03-24', '1997-03-25', '1997-03-26', '1997-03-27', '1997-03-28', '1997-03-31', '1997-04-01', '1997-04-02', '1997-04-03', '1997-04-04', '1997-04-07', '1997-04-08', '1997-04-09', '1997-04-10', '1997-04-11', '1997-04-14', '1997-04-15', '1997-04-16', '1997-04-17', '1997-04-18', '1997-04-21', '1997-04-22', '1997-04-23', '1997-04-24', '1997-04-25', '1997-04-28', '1997-04-29', '1997-04-30', '1997-05-05', '1997-05-06', '1997-05-07', '1997-05-08', '1997-05-09', '1997-05-12', '1997-05-13', '1997-05-14', '1997-05-15', '1997-05-16', '1997-05-19', '1997-05-20', '1997-05-21', '1997-05-22', '1997-05-23', '1997-05-26', '1997-05-27', '1997-05-28', '1997-05-29', '1997-05-30', '1997-06-02', '1997-06-03', '1997-06-04', '1997-06-05', '1997-06-06', '1997-06-09', '1997-06-10', '1997-06-11', '1997-06-12', '1997-06-13', '1997-06-16', '1997-06-17', '1997-06-18', '1997-06-19', '1997-06-20', '1997-06-23', '1997-06-24', '1997-06-25', '1997-06-26', '1997-06-27', '1997-07-02', '1997-07-03', '1997-07-04', '1997-07-07', '1997-07-08', '1997-07-09', '1997-07-10', '1997-07-11', '1997-07-14', '1997-07-15', '1997-07-16', '1997-07-17', '1997-07-18', '1997-07-21', '1997-07-22', '1997-07-23', '1997-07-24', '1997-07-25', '1997-07-28', '1997-07-29', '1997-07-30', '1997-07-31', '1997-08-01', '1997-08-04', '1997-08-05', '1997-08-06', '1997-08-07', '1997-08-08', '1997-08-11', '1997-08-12', '1997-08-13', '1997-08-14', '1997-08-15', '1997-08-18', '1997-08-19', '1997-08-20', '1997-08-21', '1997-08-22', '1997-08-25', '1997-08-26', '1997-08-27', '1997-08-28', '1997-08-29', '1997-09-01', '1997-09-02', '1997-09-03', '1997-09-04', '1997-09-05', '1997-09-08', '1997-09-09', '1997-09-10', '1997-09-11', '1997-09-12', '1997-09-15', '1997-09-16', '1997-09-17', '1997-09-18', '1997-09-19', '1997-09-22', '1997-09-23', '1997-09-24', '1997-09-25', '1997-09-26', '1997-09-29', '1997-09-30', '1997-10-06', '1997-10-07', '1997-10-08', '1997-10-09', '1997-10-10', '1997-10-13', '1997-10-14', '1997-10-15', '1997-10-16', '1997-10-17', '1997-10-20', '1997-10-21', '1997-10-22', '1997-10-23', '1997-10-24', '1997-10-27', '1997-10-28', '1997-10-29', '1997-10-30', '1997-10-31', '1997-11-03', '1997-11-04', '1997-11-05', '1997-11-06', '1997-11-07', '1997-11-10', '1997-11-11', '1997-11-12', '1997-11-13', '1997-11-14', '1997-11-17', '1997-11-18', '1997-11-19', '1997-11-20', '1997-11-21', '1997-11-24', '1997-11-25', '1997-11-26', '1997-11-27', '1997-11-28', '1997-12-01', '1997-12-02', '1997-12-03', '1997-12-04', '1997-12-05', '1997-12-08', '1997-12-09', '1997-12-10', '1997-12-11', '1997-12-12', '1997-12-15', '1997-12-16', '1997-12-17', '1997-12-18', '1997-12-19', '1997-12-22', '1997-12-23', '1997-12-24', '1997-12-25', '1997-12-26', '1997-12-29', '1997-12-30', '1997-12-31', '1998-01-05', '1998-01-06', '1998-01-07', '1998-01-08', '1998-01-09', '1998-01-12', '1998-01-13', '1998-01-14', '1998-01-15', '1998-01-16', '1998-01-19', '1998-01-20', '1998-01-21', '1998-01-22', '1998-01-23', '1998-02-09', '1998-02-10', '1998-02-11', '1998-02-12', '1998-02-13', '1998-02-16', '1998-02-17', '1998-02-18', '1998-02-19', '1998-02-20', '1998-02-23', '1998-02-24', '1998-02-25', '1998-02-26', '1998-02-27', '1998-03-02', '1998-03-03', '1998-03-04', '1998-03-05', '1998-03-06', '1998-03-09', '1998-03-10', '1998-03-11', '1998-03-12', '1998-03-13', '1998-03-16', '1998-03-17', '1998-03-18', '1998-03-19', '1998-03-20', '1998-03-23', '1998-03-24', '1998-03-25', '1998-03-26', '1998-03-27', '1998-03-30', '1998-03-31', '1998-04-01', '1998-04-02', '1998-04-03', '1998-04-06', '1998-04-07', '1998-04-08', '1998-04-09', '1998-04-10', '1998-04-13', '1998-04-14', '1998-04-15', '1998-04-16', '1998-04-17', '1998-04-20', '1998-04-21', '1998-04-22', '1998-04-23', '1998-04-24', '1998-04-27', '1998-04-28', '1998-04-29', '1998-04-30', '1998-05-04', '1998-05-05', '1998-05-06', '1998-05-07', '1998-05-08', '1998-05-11', '1998-05-12', '1998-05-13', '1998-05-14', '1998-05-15', '1998-05-18', '1998-05-19', '1998-05-20', '1998-05-21', '1998-05-22', '1998-05-25', '1998-05-26', '1998-05-27', '1998-05-28', '1998-05-29', '1998-06-01', '1998-06-02', '1998-06-03', '1998-06-04', '1998-06-05', '1998-06-08', '1998-06-09', '1998-06-10', '1998-06-11', '1998-06-12', '1998-06-15', '1998-06-16', '1998-06-17', '1998-06-18', '1998-06-19', '1998-06-22', '1998-06-23', '1998-06-24', '1998-06-25', '1998-06-26', '1998-06-29', '1998-06-30', '1998-07-01', '1998-07-02', '1998-07-03', '1998-07-06', '1998-07-07', '1998-07-08', '1998-07-09', '1998-07-10', '1998-07-13', '1998-07-14', '1998-07-15', '1998-07-16', '1998-07-17', '1998-07-20', '1998-07-21', '1998-07-22', '1998-07-23', '1998-07-24', '1998-07-27', '1998-07-28', '1998-07-29', '1998-07-30', '1998-07-31', '1998-08-03', '1998-08-04', '1998-08-05', '1998-08-06', '1998-08-07', '1998-08-10', '1998-08-11', '1998-08-12', '1998-08-13', '1998-08-14', '1998-08-17', '1998-08-18', '1998-08-19', '1998-08-20', '1998-08-21', '1998-08-24', '1998-08-25', '1998-08-26', '1998-08-27', '1998-08-28', '1998-08-31', '1998-09-01', '1998-09-02', '1998-09-03', '1998-09-04', '1998-09-07', '1998-09-08', '1998-09-09', '1998-09-10', '1998-09-11', '1998-09-14', '1998-09-15', '1998-09-16', '1998-09-17', '1998-09-18', '1998-09-21', '1998-09-22', '1998-09-23', '1998-09-24', '1998-09-25', '1998-09-28', '1998-09-29', '1998-09-30', '1998-10-05', '1998-10-06', '1998-10-07', '1998-10-08', '1998-10-09', '1998-10-12', '1998-10-13', '1998-10-14', '1998-10-15', '1998-10-16', '1998-10-19', '1998-10-20', '1998-10-21', '1998-10-22', '1998-10-23', '1998-10-26', '1998-10-27', '1998-10-28', '1998-10-29', '1998-10-30', '1998-11-02', '1998-11-03', '1998-11-04', '1998-11-05', '1998-11-06', '1998-11-09', '1998-11-10', '1998-11-11', '1998-11-12', '1998-11-13', '1998-11-16', '1998-11-17', '1998-11-18', '1998-11-19', '1998-11-20', '1998-11-23', '1998-11-24', '1998-11-25', '1998-11-26', '1998-11-27', '1998-11-30', '1998-12-01', '1998-12-02', '1998-12-03', '1998-12-04', '1998-12-07', '1998-12-08', '1998-12-09', '1998-12-10', '1998-12-11', '1998-12-14', '1998-12-15', '1998-12-16', '1998-12-17', '1998-12-18', '1998-12-21', '1998-12-22', '1998-12-23', '1998-12-24', '1998-12-25', '1998-12-28', '1998-12-29', '1998-12-30', '1998-12-31', '1999-01-04', '1999-01-05', '1999-01-06', '1999-01-07', '1999-01-08', '1999-01-11', '1999-01-12', '1999-01-13', '1999-01-14', '1999-01-15', '1999-01-18', '1999-01-19', '1999-01-20', '1999-01-21', '1999-01-22', '1999-01-25', '1999-01-26', '1999-01-27', '1999-01-28', '1999-01-29', '1999-02-01', '1999-02-02', '1999-02-03', '1999-02-04', '1999-02-05', '1999-02-08', '1999-02-09', '1999-03-01', '1999-03-02', '1999-03-03', '1999-03-04', '1999-03-05', '1999-03-08', '1999-03-09', '1999-03-10', '1999-03-11', '1999-03-12', '1999-03-15', '1999-03-16', '1999-03-17', '1999-03-18', '1999-03-19', '1999-03-22', '1999-03-23', '1999-03-24', '1999-03-25', '1999-03-26', '1999-03-29', '1999-03-30', '1999-03-31', '1999-04-01', '1999-04-02', '1999-04-05', '1999-04-06', '1999-04-07', '1999-04-08', '1999-04-09', '1999-04-12', '1999-04-13', '1999-04-14', '1999-04-15', '1999-04-16', '1999-04-19', '1999-04-20', '1999-04-21', '1999-04-22', '1999-04-23', '1999-04-26', '1999-04-27', '1999-04-28', '1999-04-29', '1999-04-30', '1999-05-04', '1999-05-05', '1999-05-06', '1999-05-07', '1999-05-10', '1999-05-11', '1999-05-12', '1999-05-13', '1999-05-14', '1999-05-17', '1999-05-18', '1999-05-19', '1999-05-20', '1999-05-21', '1999-05-24', '1999-05-25', '1999-05-26', '1999-05-27', '1999-05-28', '1999-05-31', '1999-06-01', '1999-06-02', '1999-06-03', '1999-06-04', '1999-06-07', '1999-06-08', '1999-06-09', '1999-06-10', '1999-06-11', '1999-06-14', '1999-06-15', '1999-06-16', '1999-06-17', '1999-06-18', '1999-06-21', '1999-06-22', '1999-06-23', '1999-06-24', '1999-06-25', '1999-06-28', '1999-06-29', '1999-06-30', '1999-07-01', '1999-07-02', '1999-07-05', '1999-07-06', '1999-07-07', '1999-07-08', '1999-07-09', '1999-07-12', '1999-07-13', '1999-07-14', '1999-07-15', '1999-07-16', '1999-07-19', '1999-07-20', '1999-07-21', '1999-07-22', '1999-07-23', '1999-07-26', '1999-07-27', '1999-07-28', '1999-07-29', '1999-07-30', '1999-08-02', '1999-08-03', '1999-08-04', '1999-08-05', '1999-08-06', '1999-08-09', '1999-08-10', '1999-08-11', '1999-08-12', '1999-08-13', '1999-08-16', '1999-08-17', '1999-08-18', '1999-08-19', '1999-08-20', '1999-08-23', '1999-08-24', '1999-08-25', '1999-08-26', '1999-08-27', '1999-08-30', '1999-08-31', '1999-09-01', '1999-09-02', '1999-09-03', '1999-09-06', '1999-09-07', '1999-09-08', '1999-09-09', '1999-09-10', '1999-09-13', '1999-09-14', '1999-09-15', '1999-09-16', '1999-09-17', '1999-09-20', '1999-09-21', '1999-09-22', '1999-09-23', '1999-09-24', '1999-09-27', '1999-09-28', '1999-09-29', '1999-09-30', '1999-10-08', '1999-10-11', '1999-10-12', '1999-10-13', '1999-10-14', '1999-10-15', '1999-10-18', '1999-10-19', '1999-10-20', '1999-10-21', '1999-10-22', '1999-10-25', '1999-10-26', '1999-10-27', '1999-10-28', '1999-10-29', '1999-11-01', '1999-11-02', '1999-11-03', '1999-11-04', '1999-11-05', '1999-11-08', '1999-11-09', '1999-11-10', '1999-11-11', '1999-11-12', '1999-11-15', '1999-11-16', '1999-11-17', '1999-11-18', '1999-11-19', '1999-11-22', '1999-11-23', '1999-11-24', '1999-11-25', '1999-11-26', '1999-11-29', '1999-11-30', '1999-12-01', '1999-12-02', '1999-12-03', '1999-12-06', '1999-12-07', '1999-12-08', '1999-12-09', '1999-12-10', '1999-12-13', '1999-12-14', '1999-12-15', '1999-12-16', '1999-12-17', '1999-12-21', '1999-12-22', '1999-12-23', '1999-12-24', '1999-12-27', '1999-12-28', '1999-12-29', '1999-12-30', '2000-01-04', '2000-01-05', '2000-01-06', '2000-01-07', '2000-01-10', '2000-01-11', '2000-01-12', '2000-01-13', '2000-01-14', '2000-01-17', '2000-01-18', '2000-01-19', '2000-01-20', '2000-01-21', '2000-01-24', '2000-01-25', '2000-01-26', '2000-01-27', '2000-01-28', '2000-02-14', '2000-02-15', '2000-02-16', '2000-02-17', '2000-02-18', '2000-02-21', '2000-02-22', '2000-02-23', '2000-02-24', '2000-02-25', '2000-02-28', '2000-02-29', '2000-03-01', '2000-03-02', '2000-03-03', '2000-03-06', '2000-03-07', '2000-03-08', '2000-03-09', '2000-03-10', '2000-03-13', '2000-03-14', '2000-03-15', '2000-03-16', '2000-03-17', '2000-03-20', '2000-03-21', '2000-03-22', '2000-03-23', '2000-03-24', '2000-03-27', '2000-03-28', '2000-03-29', '2000-03-30', '2000-03-31', '2000-04-03', '2000-04-04', '2000-04-05', '2000-04-06', '2000-04-07', '2000-04-10', '2000-04-11', '2000-04-12', '2000-04-13', '2000-04-14', '2000-04-17', '2000-04-18', '2000-04-19', '2000-04-20', '2000-04-21', '2000-04-24', '2000-04-25', '2000-04-26', '2000-04-27', '2000-04-28', '2000-05-08', '2000-05-09', '2000-05-10', '2000-05-11', '2000-05-12', '2000-05-15', '2000-05-16', '2000-05-17', '2000-05-18', '2000-05-19', '2000-05-22', '2000-05-23', '2000-05-24', '2000-05-25', '2000-05-26', '2000-05-29', '2000-05-30', '2000-05-31', '2000-06-01', '2000-06-02', '2000-06-05', '2000-06-06', '2000-06-07', '2000-06-08', '2000-06-09', '2000-06-12', '2000-06-13', '2000-06-14', '2000-06-15', '2000-06-16', '2000-06-19', '2000-06-20', '2000-06-21', '2000-06-22', '2000-06-23', '2000-06-26', '2000-06-27', '2000-06-28', '2000-06-29', '2000-06-30', '2000-07-03', '2000-07-04', '2000-07-05', '2000-07-06', '2000-07-07', '2000-07-10', '2000-07-11', '2000-07-12', '2000-07-13', '2000-07-14', '2000-07-17', '2000-07-18', '2000-07-19', '2000-07-20', '2000-07-21', '2000-07-24', '2000-07-25', '2000-07-26', '2000-07-27', '2000-07-28', '2000-07-31', '2000-08-01', '2000-08-02', '2000-08-03', '2000-08-04', '2000-08-07', '2000-08-08', '2000-08-09', '2000-08-10', '2000-08-11', '2000-08-14', '2000-08-15', '2000-08-16', '2000-08-17', '2000-08-18', '2000-08-21', '2000-08-22', '2000-08-23', '2000-08-24', '2000-08-25', '2000-08-28', '2000-08-29', '2000-08-30', '2000-08-31', '2000-09-01', '2000-09-04', '2000-09-05', '2000-09-06', '2000-09-07', '2000-09-08', '2000-09-11', '2000-09-12', '2000-09-13', '2000-09-14', '2000-09-15', '2000-09-18', '2000-09-19', '2000-09-20', '2000-09-21', '2000-09-22', '2000-09-25', '2000-09-26', '2000-09-27', '2000-09-28', '2000-09-29', '2000-10-09', '2000-10-10', '2000-10-11', '2000-10-12', '2000-10-13', '2000-10-16', '2000-10-17', '2000-10-18', '2000-10-19', '2000-10-20', '2000-10-23', '2000-10-24', '2000-10-25', '2000-10-26', '2000-10-27', '2000-10-30', '2000-10-31', '2000-11-01', '2000-11-02', '2000-11-03', '2000-11-06', '2000-11-07', '2000-11-08', '2000-11-09', '2000-11-10', '2000-11-13', '2000-11-14', '2000-11-15', '2000-11-16', '2000-11-17', '2000-11-20', '2000-11-21', '2000-11-22', '2000-11-23', '2000-11-24', '2000-11-27', '2000-11-28', '2000-11-29', '2000-11-30', '2000-12-01', '2000-12-04', '2000-12-05', '2000-12-06', '2000-12-07', '2000-12-08', '2000-12-11', '2000-12-12', '2000-12-13', '2000-12-14', '2000-12-15', '2000-12-18', '2000-12-19', '2000-12-20', '2000-12-21', '2000-12-22', '2000-12-25', '2000-12-26', '2000-12-27', '2000-12-28', '2000-12-29', '2001-01-02', '2001-01-03', '2001-01-04', '2001-01-05', '2001-01-08', '2001-01-09', '2001-01-10', '2001-01-11', '2001-01-12', '2001-01-15', '2001-01-16', '2001-01-17', '2001-01-18', '2001-01-19', '2001-02-05', '2001-02-06', '2001-02-07', '2001-02-08', '2001-02-09', '2001-02-12', '2001-02-13', '2001-02-14', '2001-02-15', '2001-02-16', '2001-02-19', '2001-02-20', '2001-02-21', '2001-02-22', '2001-02-23', '2001-02-26', '2001-02-27', '2001-02-28', '2001-03-01', '2001-03-02', '2001-03-05', '2001-03-06', '2001-03-07', '2001-03-08', '2001-03-09', '2001-03-12', '2001-03-13', '2001-03-14', '2001-03-15', '2001-03-16', '2001-03-19', '2001-03-20', '2001-03-21', '2001-03-22', '2001-03-23', '2001-03-26', '2001-03-27', '2001-03-28', '2001-03-29', '2001-03-30', '2001-04-02', '2001-04-03', '2001-04-04', '2001-04-05', '2001-04-06', '2001-04-09', '2001-04-10', '2001-04-11', '2001-04-12', '2001-04-13', '2001-04-16', '2001-04-17', '2001-04-18', '2001-04-19', '2001-04-20', '2001-04-23', '2001-04-24', '2001-04-25', '2001-04-26', '2001-04-27', '2001-04-30', '2001-05-08', '2001-05-09', '2001-05-10', '2001-05-11', '2001-05-14', '2001-05-15', '2001-05-16', '2001-05-17', '2001-05-18', '2001-05-21', '2001-05-22', '2001-05-23', '2001-05-24', '2001-05-25', '2001-05-28', '2001-05-29', '2001-05-30', '2001-05-31', '2001-06-01', '2001-06-04', '2001-06-05', '2001-06-06', '2001-06-07', '2001-06-08', '2001-06-11', '2001-06-12', '2001-06-13', '2001-06-14', '2001-06-15', '2001-06-18', '2001-06-19', '2001-06-20', '2001-06-21', '2001-06-22', '2001-06-25', '2001-06-26', '2001-06-27', '2001-06-28', '2001-06-29', '2001-07-02', '2001-07-03', '2001-07-04', '2001-07-05', '2001-07-06', '2001-07-09', '2001-07-10', '2001-07-11', '2001-07-12', '2001-07-13', '2001-07-16', '2001-07-17', '2001-07-18', '2001-07-19', '2001-07-20', '2001-07-23', '2001-07-24', '2001-07-25', '2001-07-26', '2001-07-27', '2001-07-30', '2001-07-31', '2001-08-01', '2001-08-02', '2001-08-03', '2001-08-06', '2001-08-07', '2001-08-08', '2001-08-09', '2001-08-10', '2001-08-13', '2001-08-14', '2001-08-15', '2001-08-16', '2001-08-17', '2001-08-20', '2001-08-21', '2001-08-22', '2001-08-23', '2001-08-24', '2001-08-27', '2001-08-28', '2001-08-29', '2001-08-30', '2001-08-31', '2001-09-03', '2001-09-04', '2001-09-05', '2001-09-06', '2001-09-07', '2001-09-10', '2001-09-11', '2001-09-12', '2001-09-13', '2001-09-14', '2001-09-17', '2001-09-18', '2001-09-19', '2001-09-20', '2001-09-21', '2001-09-24', '2001-09-25', '2001-09-26', '2001-09-27', '2001-09-28', '2001-10-08', '2001-10-09', '2001-10-10', '2001-10-11', '2001-10-12', '2001-10-15', '2001-10-16', '2001-10-17', '2001-10-18', '2001-10-19', '2001-10-22', '2001-10-23', '2001-10-24', '2001-10-25', '2001-10-26', '2001-10-29', '2001-10-30', '2001-10-31', '2001-11-01', '2001-11-02', '2001-11-05', '2001-11-06', '2001-11-07', '2001-11-08', '2001-11-09', '2001-11-12', '2001-11-13', '2001-11-14', '2001-11-15', '2001-11-16', '2001-11-19', '2001-11-20', '2001-11-21', '2001-11-22', '2001-11-23', '2001-11-26', '2001-11-27', '2001-11-28', '2001-11-29', '2001-11-30', '2001-12-03', '2001-12-04', '2001-12-05', '2001-12-06', '2001-12-07', '2001-12-10', '2001-12-11', '2001-12-12', '2001-12-13', '2001-12-14', '2001-12-17', '2001-12-18', '2001-12-19', '2001-12-20', '2001-12-21', '2001-12-24', '2001-12-25', '2001-12-26', '2001-12-27', '2001-12-28', '2001-12-31', '2002-01-04', '2002-01-07', '2002-01-08', '2002-01-09', '2002-01-10', '2002-01-11', '2002-01-14', '2002-01-15', '2002-01-16', '2002-01-17', '2002-01-18', '2002-01-21', '2002-01-22', '2002-01-23', '2002-01-24', '2002-01-25', '2002-01-28', '2002-01-29', '2002-01-30', '2002-01-31', '2002-02-01', '2002-02-04', '2002-02-05', '2002-02-06', '2002-02-07', '2002-02-08', '2002-02-25', '2002-02-26', '2002-02-27', '2002-02-28', '2002-03-01', '2002-03-04', '2002-03-05', '2002-03-06', '2002-03-07', '2002-03-08', '2002-03-11', '2002-03-12', '2002-03-13', '2002-03-14', '2002-03-15', '2002-03-18', '2002-03-19', '2002-03-20', '2002-03-21', '2002-03-22', '2002-03-25', '2002-03-26', '2002-03-27', '2002-03-28', '2002-03-29', '2002-04-01', '2002-04-02', '2002-04-03', '2002-04-04', '2002-04-05', '2002-04-08', '2002-04-09', '2002-04-10', '2002-04-11', '2002-04-12', '2002-04-15', '2002-04-16', '2002-04-17', '2002-04-18', '2002-04-19', '2002-04-22', '2002-04-23', '2002-04-24', '2002-04-25', '2002-04-26', '2002-04-29', '2002-04-30', '2002-05-08', '2002-05-09', '2002-05-10', '2002-05-13', '2002-05-14', '2002-05-15', '2002-05-16', '2002-05-17', '2002-05-20', '2002-05-21', '2002-05-22', '2002-05-23', '2002-05-24', '2002-05-27', '2002-05-28', '2002-05-29', '2002-05-30', '2002-05-31', '2002-06-03', '2002-06-04', '2002-06-05', '2002-06-06', '2002-06-07', '2002-06-10', '2002-06-11', '2002-06-12', '2002-06-13', '2002-06-14', '2002-06-17', '2002-06-18', '2002-06-19', '2002-06-20', '2002-06-21', '2002-06-24', '2002-06-25', '2002-06-26', '2002-06-27', '2002-06-28', '2002-07-01', '2002-07-02', '2002-07-03', '2002-07-04', '2002-07-05', '2002-07-08', '2002-07-09', '2002-07-10', '2002-07-11', '2002-07-12', '2002-07-15', '2002-07-16', '2002-07-17', '2002-07-18', '2002-07-19', '2002-07-22', '2002-07-23', '2002-07-24', '2002-07-25', '2002-07-26', '2002-07-29', '2002-07-30', '2002-07-31', '2002-08-01', '2002-08-02', '2002-08-05', '2002-08-06', '2002-08-07', '2002-08-08', '2002-08-09', '2002-08-12', '2002-08-13', '2002-08-14', '2002-08-15', '2002-08-16', '2002-08-19', '2002-08-20', '2002-08-21', '2002-08-22', '2002-08-23', '2002-08-26', '2002-08-27', '2002-08-28', '2002-08-29', '2002-08-30', '2002-09-02', '2002-09-03', '2002-09-04', '2002-09-05', '2002-09-06', '2002-09-09', '2002-09-10', '2002-09-11', '2002-09-12', '2002-09-13', '2002-09-16', '2002-09-17', '2002-09-18', '2002-09-19', '2002-09-20', '2002-09-23', '2002-09-24', '2002-09-25', '2002-09-26', '2002-09-27', '2002-10-08', '2002-10-09', '2002-10-10', '2002-10-11', '2002-10-14', '2002-10-15', '2002-10-16', '2002-10-17', '2002-10-18', '2002-10-21', '2002-10-22', '2002-10-23', '2002-10-24', '2002-10-25', '2002-10-28', '2002-10-29', '2002-10-30', '2002-10-31', '2002-11-01', '2002-11-04', '2002-11-05', '2002-11-06', '2002-11-07', '2002-11-08', '2002-11-11', '2002-11-12', '2002-11-13', '2002-11-14', '2002-11-15', '2002-11-18', '2002-11-19', '2002-11-20', '2002-11-21', '2002-11-22', '2002-11-25', '2002-11-26', '2002-11-27', '2002-11-28', '2002-11-29', '2002-12-02', '2002-12-03', '2002-12-04', '2002-12-05', '2002-12-06', '2002-12-09', '2002-12-10', '2002-12-11', '2002-12-12', '2002-12-13', '2002-12-16', '2002-12-17', '2002-12-18', '2002-12-19', '2002-12-20', '2002-12-23', '2002-12-24', '2002-12-25', '2002-12-26', '2002-12-27', '2002-12-30', '2002-12-31', '2003-01-02', '2003-01-03', '2003-01-06', '2003-01-07', '2003-01-08', '2003-01-09', '2003-01-10', '2003-01-13', '2003-01-14', '2003-01-15', '2003-01-16', '2003-01-17', '2003-01-20', '2003-01-21', '2003-01-22', '2003-01-23', '2003-01-24', '2003-01-27', '2003-01-28', '2003-01-29', '2003-02-10', '2003-02-11', '2003-02-12', '2003-02-13', '2003-02-14', '2003-02-17', '2003-02-18', '2003-02-19', '2003-02-20', '2003-02-21', '2003-02-24', '2003-02-25', '2003-02-26', '2003-02-27', '2003-02-28', '2003-03-03', '2003-03-04', '2003-03-05', '2003-03-06', '2003-03-07', '2003-03-10', '2003-03-11', '2003-03-12', '2003-03-13', '2003-03-14', '2003-03-17', '2003-03-18', '2003-03-19', '2003-03-20', '2003-03-21', '2003-03-24', '2003-03-25', '2003-03-26', '2003-03-27', '2003-03-28', '2003-03-31', '2003-04-01', '2003-04-02', '2003-04-03', '2003-04-04', '2003-04-07', '2003-04-08', '2003-04-09', '2003-04-10', '2003-04-11', '2003-04-14', '2003-04-15', '2003-04-16', '2003-04-17', '2003-04-18', '2003-04-21', '2003-04-22', '2003-04-23', '2003-04-24', '2003-04-25', '2003-04-28', '2003-04-29', '2003-04-30', '2003-05-12', '2003-05-13', '2003-05-14', '2003-05-15', '2003-05-16', '2003-05-19', '2003-05-20', '2003-05-21', '2003-05-22', '2003-05-23', '2003-05-26', '2003-05-27', '2003-05-28', '2003-05-29', '2003-05-30', '2003-06-02', '2003-06-03', '2003-06-04', '2003-06-05', '2003-06-06', '2003-06-09', '2003-06-10', '2003-06-11', '2003-06-12', '2003-06-13', '2003-06-16', '2003-06-17', '2003-06-18', '2003-06-19', '2003-06-20', '2003-06-23', '2003-06-24', '2003-06-25', '2003-06-26', '2003-06-27', '2003-06-30', '2003-07-01', '2003-07-02', '2003-07-03', '2003-07-04', '2003-07-07', '2003-07-08', '2003-07-09', '2003-07-10', '2003-07-11', '2003-07-14', '2003-07-15', '2003-07-16', '2003-07-17', '2003-07-18', '2003-07-21', '2003-07-22', '2003-07-23', '2003-07-24', '2003-07-25', '2003-07-28', '2003-07-29', '2003-07-30', '2003-07-31', '2003-08-01', '2003-08-04', '2003-08-05', '2003-08-06', '2003-08-07', '2003-08-08', '2003-08-11', '2003-08-12', '2003-08-13', '2003-08-14', '2003-08-15', '2003-08-18', '2003-08-19', '2003-08-20', '2003-08-21', '2003-08-22', '2003-08-25', '2003-08-26', '2003-08-27', '2003-08-28', '2003-08-29', '2003-09-01', '2003-09-02', '2003-09-03', '2003-09-04', '2003-09-05', '2003-09-08', '2003-09-09', '2003-09-10', '2003-09-11', '2003-09-12', '2003-09-15', '2003-09-16', '2003-09-17', '2003-09-18', '2003-09-19', '2003-09-22', '2003-09-23', '2003-09-24', '2003-09-25', '2003-09-26', '2003-09-29', '2003-09-30', '2003-10-08', '2003-10-09', '2003-10-10', '2003-10-13', '2003-10-14', '2003-10-15', '2003-10-16', '2003-10-17', '2003-10-20', '2003-10-21', '2003-10-22', '2003-10-23', '2003-10-24', '2003-10-27', '2003-10-28', '2003-10-29', '2003-10-30', '2003-10-31', '2003-11-03', '2003-11-04', '2003-11-05', '2003-11-06', '2003-11-07', '2003-11-10', '2003-11-11', '2003-11-12', '2003-11-13', '2003-11-14', '2003-11-17', '2003-11-18', '2003-11-19', '2003-11-20', '2003-11-21', '2003-11-24', '2003-11-25', '2003-11-26', '2003-11-27', '2003-11-28', '2003-12-01', '2003-12-02', '2003-12-03', '2003-12-04', '2003-12-05', '2003-12-08', '2003-12-09', '2003-12-10', '2003-12-11', '2003-12-12', '2003-12-15', '2003-12-16', '2003-12-17', '2003-12-18', '2003-12-19', '2003-12-22', '2003-12-23', '2003-12-24', '2003-12-25', '2003-12-26', '2003-12-29', '2003-12-30', '2003-12-31', '2004-01-02', '2004-01-05', '2004-01-06', '2004-01-07', '2004-01-08', '2004-01-09', '2004-01-12', '2004-01-13', '2004-01-14', '2004-01-15', '2004-01-16', '2004-01-29', '2004-01-30', '2004-02-02', '2004-02-03', '2004-02-04', '2004-02-05', '2004-02-06', '2004-02-09', '2004-02-10', '2004-02-11', '2004-02-12', '2004-02-13', '2004-02-16', '2004-02-17', '2004-02-18', '2004-02-19', '2004-02-20', '2004-02-23', '2004-02-24', '2004-02-25', '2004-02-26', '2004-02-27', '2004-03-01', '2004-03-02', '2004-03-03', '2004-03-04', '2004-03-05', '2004-03-08', '2004-03-09', '2004-03-10', '2004-03-11', '2004-03-12', '2004-03-15', '2004-03-16', '2004-03-17', '2004-03-18', '2004-03-19', '2004-03-22', '2004-03-23', '2004-03-24', '2004-03-25', '2004-03-26', '2004-03-29', '2004-03-30', '2004-03-31', '2004-04-01', '2004-04-02', '2004-04-05', '2004-04-06', '2004-04-07', '2004-04-08', '2004-04-09', '2004-04-12', '2004-04-13', '2004-04-14', '2004-04-15', '2004-04-16', '2004-04-19', '2004-04-20', '2004-04-21', '2004-04-22', '2004-04-23', '2004-04-26', '2004-04-27', '2004-04-28', '2004-04-29', '2004-04-30', '2004-05-10', '2004-05-11', '2004-05-12', '2004-05-13', '2004-05-14', '2004-05-17', '2004-05-18', '2004-05-19', '2004-05-20', '2004-05-21', '2004-05-24', '2004-05-25', '2004-05-26', '2004-05-27', '2004-05-28', '2004-05-31',
+                  '2004-06-01', '2004-06-02', '2004-06-03', '2004-06-04', '2004-06-07', '2004-06-08', '2004-06-09', '2004-06-10', '2004-06-11', '2004-06-14', '2004-06-15', '2004-06-16', '2004-06-17', '2004-06-18', '2004-06-21', '2004-06-22', '2004-06-23', '2004-06-24', '2004-06-25', '2004-06-28', '2004-06-29', '2004-06-30', '2004-07-01', '2004-07-02', '2004-07-05', '2004-07-06', '2004-07-07', '2004-07-08', '2004-07-09', '2004-07-12', '2004-07-13', '2004-07-14', '2004-07-15', '2004-07-16', '2004-07-19', '2004-07-20', '2004-07-21', '2004-07-22', '2004-07-23', '2004-07-26', '2004-07-27', '2004-07-28', '2004-07-29', '2004-07-30', '2004-08-02', '2004-08-03', '2004-08-04', '2004-08-05', '2004-08-06', '2004-08-09', '2004-08-10', '2004-08-11', '2004-08-12', '2004-08-13', '2004-08-16', '2004-08-17', '2004-08-18', '2004-08-19', '2004-08-20', '2004-08-23', '2004-08-24', '2004-08-25', '2004-08-26', '2004-08-27', '2004-08-30', '2004-08-31', '2004-09-01', '2004-09-02', '2004-09-03', '2004-09-06', '2004-09-07', '2004-09-08', '2004-09-09', '2004-09-10', '2004-09-13', '2004-09-14', '2004-09-15', '2004-09-16', '2004-09-17', '2004-09-20', '2004-09-21', '2004-09-22', '2004-09-23', '2004-09-24', '2004-09-27', '2004-09-28', '2004-09-29', '2004-09-30', '2004-10-08', '2004-10-11', '2004-10-12', '2004-10-13', '2004-10-14', '2004-10-15', '2004-10-18', '2004-10-19', '2004-10-20', '2004-10-21', '2004-10-22', '2004-10-25', '2004-10-26', '2004-10-27', '2004-10-28', '2004-10-29', '2004-11-01', '2004-11-02', '2004-11-03', '2004-11-04', '2004-11-05', '2004-11-08', '2004-11-09', '2004-11-10', '2004-11-11', '2004-11-12', '2004-11-15', '2004-11-16', '2004-11-17', '2004-11-18', '2004-11-19', '2004-11-22', '2004-11-23', '2004-11-24', '2004-11-25', '2004-11-26', '2004-11-29', '2004-11-30', '2004-12-01', '2004-12-02', '2004-12-03', '2004-12-06', '2004-12-07', '2004-12-08', '2004-12-09', '2004-12-10', '2004-12-13', '2004-12-14', '2004-12-15', '2004-12-16', '2004-12-17', '2004-12-20', '2004-12-21', '2004-12-22', '2004-12-23', '2004-12-24', '2004-12-27', '2004-12-28', '2004-12-29', '2004-12-30', '2004-12-31', '2005-01-04', '2005-01-05', '2005-01-06', '2005-01-07', '2005-01-10', '2005-01-11', '2005-01-12', '2005-01-13', '2005-01-14', '2005-01-17', '2005-01-18', '2005-01-19', '2005-01-20', '2005-01-21', '2005-01-24', '2005-01-25', '2005-01-26', '2005-01-27', '2005-01-28', '2005-01-31', '2005-02-01', '2005-02-02', '2005-02-03', '2005-02-04', '2005-02-16', '2005-02-17', '2005-02-18', '2005-02-21', '2005-02-22', '2005-02-23', '2005-02-24', '2005-02-25', '2005-02-28', '2005-03-01', '2005-03-02', '2005-03-03', '2005-03-04', '2005-03-07', '2005-03-08', '2005-03-09', '2005-03-10', '2005-03-11', '2005-03-14', '2005-03-15', '2005-03-16', '2005-03-17', '2005-03-18', '2005-03-21', '2005-03-22', '2005-03-23', '2005-03-24', '2005-03-25', '2005-03-28', '2005-03-29', '2005-03-30', '2005-03-31', '2005-04-01', '2005-04-04', '2005-04-05', '2005-04-06', '2005-04-07', '2005-04-08', '2005-04-11', '2005-04-12', '2005-04-13', '2005-04-14', '2005-04-15', '2005-04-18', '2005-04-19', '2005-04-20', '2005-04-21', '2005-04-22', '2005-04-25', '2005-04-26', '2005-04-27', '2005-04-28', '2005-04-29', '2005-05-09', '2005-05-10', '2005-05-11', '2005-05-12', '2005-05-13', '2005-05-16', '2005-05-17', '2005-05-18', '2005-05-19', '2005-05-20', '2005-05-23', '2005-05-24', '2005-05-25', '2005-05-26', '2005-05-27', '2005-05-30', '2005-05-31', '2005-06-01', '2005-06-02', '2005-06-03', '2005-06-06', '2005-06-07', '2005-06-08', '2005-06-09', '2005-06-10', '2005-06-13', '2005-06-14', '2005-06-15', '2005-06-16', '2005-06-17', '2005-06-20', '2005-06-21', '2005-06-22', '2005-06-23', '2005-06-24', '2005-06-27', '2005-06-28', '2005-06-29', '2005-06-30', '2005-07-01', '2005-07-04', '2005-07-05', '2005-07-06', '2005-07-07', '2005-07-08', '2005-07-11', '2005-07-12', '2005-07-13', '2005-07-14', '2005-07-15', '2005-07-18', '2005-07-19', '2005-07-20', '2005-07-21', '2005-07-22', '2005-07-25', '2005-07-26', '2005-07-27', '2005-07-28', '2005-07-29', '2005-08-01', '2005-08-02', '2005-08-03', '2005-08-04', '2005-08-05', '2005-08-08', '2005-08-09', '2005-08-10', '2005-08-11', '2005-08-12', '2005-08-15', '2005-08-16', '2005-08-17', '2005-08-18', '2005-08-19', '2005-08-22', '2005-08-23', '2005-08-24', '2005-08-25', '2005-08-26', '2005-08-29', '2005-08-30', '2005-08-31', '2005-09-01', '2005-09-02', '2005-09-05', '2005-09-06', '2005-09-07', '2005-09-08', '2005-09-09', '2005-09-12', '2005-09-13', '2005-09-14', '2005-09-15', '2005-09-16', '2005-09-19', '2005-09-20', '2005-09-21', '2005-09-22', '2005-09-23', '2005-09-26', '2005-09-27', '2005-09-28', '2005-09-29', '2005-09-30', '2005-10-10', '2005-10-11', '2005-10-12', '2005-10-13', '2005-10-14', '2005-10-17', '2005-10-18', '2005-10-19', '2005-10-20', '2005-10-21', '2005-10-24', '2005-10-25', '2005-10-26', '2005-10-27', '2005-10-28', '2005-10-31', '2005-11-01', '2005-11-02', '2005-11-03', '2005-11-04', '2005-11-07', '2005-11-08', '2005-11-09', '2005-11-10', '2005-11-11', '2005-11-14', '2005-11-15', '2005-11-16', '2005-11-17', '2005-11-18', '2005-11-21', '2005-11-22', '2005-11-23', '2005-11-24', '2005-11-25', '2005-11-28', '2005-11-29', '2005-11-30', '2005-12-01', '2005-12-02', '2005-12-05', '2005-12-06', '2005-12-07', '2005-12-08', '2005-12-09', '2005-12-12', '2005-12-13', '2005-12-14', '2005-12-15', '2005-12-16', '2005-12-19', '2005-12-20', '2005-12-21', '2005-12-22', '2005-12-23', '2005-12-26', '2005-12-27', '2005-12-28', '2005-12-29', '2005-12-30', '2006-01-04', '2006-01-05', '2006-01-06', '2006-01-09', '2006-01-10', '2006-01-11', '2006-01-12', '2006-01-13', '2006-01-16', '2006-01-17', '2006-01-18', '2006-01-19', '2006-01-20', '2006-01-23', '2006-01-24', '2006-01-25', '2006-02-06', '2006-02-07', '2006-02-08', '2006-02-09', '2006-02-10', '2006-02-13', '2006-02-14', '2006-02-15', '2006-02-16', '2006-02-17', '2006-02-20', '2006-02-21', '2006-02-22', '2006-02-23', '2006-02-24', '2006-02-27', '2006-02-28', '2006-03-01', '2006-03-02', '2006-03-03', '2006-03-06', '2006-03-07', '2006-03-08', '2006-03-09', '2006-03-10', '2006-03-13', '2006-03-14', '2006-03-15', '2006-03-16', '2006-03-17', '2006-03-20', '2006-03-21', '2006-03-22', '2006-03-23', '2006-03-24', '2006-03-27', '2006-03-28', '2006-03-29', '2006-03-30', '2006-03-31', '2006-04-03', '2006-04-04', '2006-04-05', '2006-04-06', '2006-04-07', '2006-04-10', '2006-04-11', '2006-04-12', '2006-04-13', '2006-04-14', '2006-04-17', '2006-04-18', '2006-04-19', '2006-04-20', '2006-04-21', '2006-04-24', '2006-04-25', '2006-04-26', '2006-04-27', '2006-04-28', '2006-05-08', '2006-05-09', '2006-05-10', '2006-05-11', '2006-05-12', '2006-05-15', '2006-05-16', '2006-05-17', '2006-05-18', '2006-05-19', '2006-05-22', '2006-05-23', '2006-05-24', '2006-05-25', '2006-05-26', '2006-05-29', '2006-05-30', '2006-05-31', '2006-06-01', '2006-06-02', '2006-06-05', '2006-06-06', '2006-06-07', '2006-06-08', '2006-06-09', '2006-06-12', '2006-06-13', '2006-06-14', '2006-06-15', '2006-06-16', '2006-06-19', '2006-06-20', '2006-06-21', '2006-06-22', '2006-06-23', '2006-06-26', '2006-06-27', '2006-06-28', '2006-06-29', '2006-06-30', '2006-07-03', '2006-07-04', '2006-07-05', '2006-07-06', '2006-07-07', '2006-07-10', '2006-07-11', '2006-07-12', '2006-07-13', '2006-07-14', '2006-07-17', '2006-07-18', '2006-07-19', '2006-07-20', '2006-07-21', '2006-07-24', '2006-07-25', '2006-07-26', '2006-07-27', '2006-07-28', '2006-07-31', '2006-08-01', '2006-08-02', '2006-08-03', '2006-08-04', '2006-08-07', '2006-08-08', '2006-08-09', '2006-08-10', '2006-08-11', '2006-08-14', '2006-08-15', '2006-08-16', '2006-08-17', '2006-08-18', '2006-08-21', '2006-08-22', '2006-08-23', '2006-08-24', '2006-08-25', '2006-08-28', '2006-08-29', '2006-08-30', '2006-08-31', '2006-09-01', '2006-09-04', '2006-09-05', '2006-09-06', '2006-09-07', '2006-09-08', '2006-09-11', '2006-09-12', '2006-09-13', '2006-09-14', '2006-09-15', '2006-09-18', '2006-09-19', '2006-09-20', '2006-09-21', '2006-09-22', '2006-09-25', '2006-09-26', '2006-09-27', '2006-09-28', '2006-09-29', '2006-10-09', '2006-10-10', '2006-10-11', '2006-10-12', '2006-10-13', '2006-10-16', '2006-10-17', '2006-10-18', '2006-10-19', '2006-10-20', '2006-10-23', '2006-10-24', '2006-10-25', '2006-10-26', '2006-10-27', '2006-10-30', '2006-10-31', '2006-11-01', '2006-11-02', '2006-11-03', '2006-11-06', '2006-11-07', '2006-11-08', '2006-11-09', '2006-11-10', '2006-11-13', '2006-11-14', '2006-11-15', '2006-11-16', '2006-11-17', '2006-11-20', '2006-11-21', '2006-11-22', '2006-11-23', '2006-11-24', '2006-11-27', '2006-11-28', '2006-11-29', '2006-11-30', '2006-12-01', '2006-12-04', '2006-12-05', '2006-12-06', '2006-12-07', '2006-12-08', '2006-12-11', '2006-12-12', '2006-12-13', '2006-12-14', '2006-12-15', '2006-12-18', '2006-12-19', '2006-12-20', '2006-12-21', '2006-12-22', '2006-12-25', '2006-12-26', '2006-12-27', '2006-12-28', '2006-12-29', '2007-01-04', '2007-01-05', '2007-01-08', '2007-01-09', '2007-01-10', '2007-01-11', '2007-01-12', '2007-01-15', '2007-01-16', '2007-01-17', '2007-01-18', '2007-01-19', '2007-01-22', '2007-01-23', '2007-01-24', '2007-01-25', '2007-01-26', '2007-01-29', '2007-01-30', '2007-01-31', '2007-02-01', '2007-02-02', '2007-02-05', '2007-02-06', '2007-02-07', '2007-02-08', '2007-02-09', '2007-02-12', '2007-02-13', '2007-02-14', '2007-02-15', '2007-02-16', '2007-02-26', '2007-02-27', '2007-02-28', '2007-03-01', '2007-03-02', '2007-03-05', '2007-03-06', '2007-03-07', '2007-03-08', '2007-03-09', '2007-03-12', '2007-03-13', '2007-03-14', '2007-03-15', '2007-03-16', '2007-03-19', '2007-03-20', '2007-03-21', '2007-03-22', '2007-03-23', '2007-03-26', '2007-03-27', '2007-03-28', '2007-03-29', '2007-03-30', '2007-04-02', '2007-04-03', '2007-04-04', '2007-04-05', '2007-04-06', '2007-04-09', '2007-04-10', '2007-04-11', '2007-04-12', '2007-04-13', '2007-04-16', '2007-04-17', '2007-04-18', '2007-04-19', '2007-04-20', '2007-04-23', '2007-04-24', '2007-04-25', '2007-04-26', '2007-04-27', '2007-04-30', '2007-05-08', '2007-05-09', '2007-05-10', '2007-05-11', '2007-05-14', '2007-05-15', '2007-05-16', '2007-05-17', '2007-05-18', '2007-05-21', '2007-05-22', '2007-05-23', '2007-05-24', '2007-05-25', '2007-05-28', '2007-05-29', '2007-05-30', '2007-05-31', '2007-06-01', '2007-06-04', '2007-06-05', '2007-06-06', '2007-06-07', '2007-06-08', '2007-06-11', '2007-06-12', '2007-06-13', '2007-06-14', '2007-06-15', '2007-06-18', '2007-06-19', '2007-06-20', '2007-06-21', '2007-06-22', '2007-06-25', '2007-06-26', '2007-06-27', '2007-06-28', '2007-06-29', '2007-07-02', '2007-07-03', '2007-07-04', '2007-07-05', '2007-07-06', '2007-07-09', '2007-07-10', '2007-07-11', '2007-07-12', '2007-07-13', '2007-07-16', '2007-07-17', '2007-07-18', '2007-07-19', '2007-07-20', '2007-07-23', '2007-07-24', '2007-07-25', '2007-07-26', '2007-07-27', '2007-07-30', '2007-07-31', '2007-08-01', '2007-08-02', '2007-08-03', '2007-08-06', '2007-08-07', '2007-08-08', '2007-08-09', '2007-08-10', '2007-08-13', '2007-08-14', '2007-08-15', '2007-08-16', '2007-08-17', '2007-08-20', '2007-08-21', '2007-08-22', '2007-08-23', '2007-08-24', '2007-08-27', '2007-08-28', '2007-08-29', '2007-08-30', '2007-08-31', '2007-09-03', '2007-09-04', '2007-09-05', '2007-09-06', '2007-09-07', '2007-09-10', '2007-09-11', '2007-09-12', '2007-09-13', '2007-09-14', '2007-09-17', '2007-09-18', '2007-09-19', '2007-09-20', '2007-09-21', '2007-09-24', '2007-09-25', '2007-09-26', '2007-09-27', '2007-09-28', '2007-10-08', '2007-10-09', '2007-10-10', '2007-10-11', '2007-10-12', '2007-10-15', '2007-10-16', '2007-10-17', '2007-10-18', '2007-10-19', '2007-10-22', '2007-10-23', '2007-10-24', '2007-10-25', '2007-10-26', '2007-10-29', '2007-10-30', '2007-10-31', '2007-11-01', '2007-11-02', '2007-11-05', '2007-11-06', '2007-11-07', '2007-11-08', '2007-11-09', '2007-11-12', '2007-11-13', '2007-11-14', '2007-11-15', '2007-11-16', '2007-11-19', '2007-11-20', '2007-11-21', '2007-11-22', '2007-11-23', '2007-11-26', '2007-11-27', '2007-11-28', '2007-11-29', '2007-11-30', '2007-12-03', '2007-12-04', '2007-12-05', '2007-12-06', '2007-12-07', '2007-12-10', '2007-12-11', '2007-12-12', '2007-12-13', '2007-12-14', '2007-12-17', '2007-12-18', '2007-12-19', '2007-12-20', '2007-12-21', '2007-12-24', '2007-12-25', '2007-12-26', '2007-12-27', '2007-12-28', '2008-01-02', '2008-01-03', '2008-01-04', '2008-01-07', '2008-01-08', '2008-01-09', '2008-01-10', '2008-01-11', '2008-01-14', '2008-01-15', '2008-01-16', '2008-01-17', '2008-01-18', '2008-01-21', '2008-01-22', '2008-01-23', '2008-01-24', '2008-01-25', '2008-01-28', '2008-01-29', '2008-01-30', '2008-01-31', '2008-02-01', '2008-02-04', '2008-02-05', '2008-02-13', '2008-02-14', '2008-02-15', '2008-02-18', '2008-02-19', '2008-02-20', '2008-02-21', '2008-02-22', '2008-02-25', '2008-02-26', '2008-02-27', '2008-02-28', '2008-02-29', '2008-03-03', '2008-03-04', '2008-03-05', '2008-03-06', '2008-03-07', '2008-03-10', '2008-03-11', '2008-03-12', '2008-03-13', '2008-03-14', '2008-03-17', '2008-03-18', '2008-03-19', '2008-03-20', '2008-03-21', '2008-03-24', '2008-03-25', '2008-03-26', '2008-03-27', '2008-03-28', '2008-03-31', '2008-04-01', '2008-04-02', '2008-04-03', '2008-04-07', '2008-04-08', '2008-04-09', '2008-04-10', '2008-04-11', '2008-04-14', '2008-04-15', '2008-04-16', '2008-04-17', '2008-04-18', '2008-04-21', '2008-04-22', '2008-04-23', '2008-04-24', '2008-04-25', '2008-04-28', '2008-04-29', '2008-04-30', '2008-05-05', '2008-05-06', '2008-05-07', '2008-05-08', '2008-05-09', '2008-05-12', '2008-05-13', '2008-05-14', '2008-05-15', '2008-05-16', '2008-05-19', '2008-05-20', '2008-05-21', '2008-05-22', '2008-05-23', '2008-05-26', '2008-05-27', '2008-05-28', '2008-05-29', '2008-05-30', '2008-06-02', '2008-06-03', '2008-06-04', '2008-06-05', '2008-06-06', '2008-06-10', '2008-06-11', '2008-06-12', '2008-06-13', '2008-06-16', '2008-06-17', '2008-06-18', '2008-06-19', '2008-06-20', '2008-06-23', '2008-06-24', '2008-06-25', '2008-06-26', '2008-06-27', '2008-06-30', '2008-07-01', '2008-07-02', '2008-07-03', '2008-07-04', '2008-07-07', '2008-07-08', '2008-07-09', '2008-07-10', '2008-07-11', '2008-07-14', '2008-07-15', '2008-07-16', '2008-07-17', '2008-07-18', '2008-07-21', '2008-07-22', '2008-07-23', '2008-07-24', '2008-07-25', '2008-07-28', '2008-07-29', '2008-07-30', '2008-07-31', '2008-08-01', '2008-08-04', '2008-08-05', '2008-08-06', '2008-08-07', '2008-08-08', '2008-08-11', '2008-08-12', '2008-08-13', '2008-08-14', '2008-08-15', '2008-08-18', '2008-08-19', '2008-08-20', '2008-08-21', '2008-08-22', '2008-08-25', '2008-08-26', '2008-08-27', '2008-08-28', '2008-08-29', '2008-09-01', '2008-09-02', '2008-09-03', '2008-09-04', '2008-09-05', '2008-09-08', '2008-09-09', '2008-09-10', '2008-09-11', '2008-09-12', '2008-09-16', '2008-09-17', '2008-09-18', '2008-09-19', '2008-09-22', '2008-09-23', '2008-09-24', '2008-09-25', '2008-09-26', '2008-10-06', '2008-10-07', '2008-10-08', '2008-10-09', '2008-10-10', '2008-10-13', '2008-10-14', '2008-10-15', '2008-10-16', '2008-10-17', '2008-10-20', '2008-10-21', '2008-10-22', '2008-10-23', '2008-10-24', '2008-10-27', '2008-10-28', '2008-10-29', '2008-10-30', '2008-10-31', '2008-11-03', '2008-11-04', '2008-11-05', '2008-11-06', '2008-11-07', '2008-11-10', '2008-11-11', '2008-11-12', '2008-11-13', '2008-11-14', '2008-11-17', '2008-11-18', '2008-11-19', '2008-11-20', '2008-11-21', '2008-11-24', '2008-11-25', '2008-11-26', '2008-11-27', '2008-11-28', '2008-12-01', '2008-12-02', '2008-12-03', '2008-12-04', '2008-12-05', '2008-12-08', '2008-12-09', '2008-12-10', '2008-12-11', '2008-12-12', '2008-12-15', '2008-12-16', '2008-12-17', '2008-12-18', '2008-12-19', '2008-12-22', '2008-12-23', '2008-12-24', '2008-12-25', '2008-12-26', '2008-12-29', '2008-12-30', '2008-12-31', '2009-01-05', '2009-01-06', '2009-01-07', '2009-01-08', '2009-01-09', '2009-01-12', '2009-01-13', '2009-01-14', '2009-01-15', '2009-01-16', '2009-01-19', '2009-01-20', '2009-01-21', '2009-01-22', '2009-01-23', '2009-02-02', '2009-02-03', '2009-02-04', '2009-02-05', '2009-02-06', '2009-02-09', '2009-02-10', '2009-02-11', '2009-02-12', '2009-02-13', '2009-02-16', '2009-02-17', '2009-02-18', '2009-02-19', '2009-02-20', '2009-02-23', '2009-02-24', '2009-02-25', '2009-02-26', '2009-02-27', '2009-03-02', '2009-03-03', '2009-03-04', '2009-03-05', '2009-03-06', '2009-03-09', '2009-03-10', '2009-03-11', '2009-03-12', '2009-03-13', '2009-03-16', '2009-03-17', '2009-03-18', '2009-03-19', '2009-03-20', '2009-03-23', '2009-03-24', '2009-03-25', '2009-03-26', '2009-03-27', '2009-03-30', '2009-03-31', '2009-04-01', '2009-04-02', '2009-04-03', '2009-04-07', '2009-04-08', '2009-04-09', '2009-04-10', '2009-04-13', '2009-04-14', '2009-04-15', '2009-04-16', '2009-04-17', '2009-04-20', '2009-04-21', '2009-04-22', '2009-04-23', '2009-04-24', '2009-04-27', '2009-04-28', '2009-04-29', '2009-04-30', '2009-05-04', '2009-05-05', '2009-05-06', '2009-05-07', '2009-05-08', '2009-05-11', '2009-05-12', '2009-05-13', '2009-05-14', '2009-05-15', '2009-05-18', '2009-05-19', '2009-05-20', '2009-05-21', '2009-05-22', '2009-05-25', '2009-05-26', '2009-05-27', '2009-06-01', '2009-06-02', '2009-06-03', '2009-06-04', '2009-06-05', '2009-06-08', '2009-06-09', '2009-06-10', '2009-06-11', '2009-06-12', '2009-06-15', '2009-06-16', '2009-06-17', '2009-06-18', '2009-06-19', '2009-06-22', '2009-06-23', '2009-06-24', '2009-06-25', '2009-06-26', '2009-06-29', '2009-06-30', '2009-07-01', '2009-07-02', '2009-07-03', '2009-07-06', '2009-07-07', '2009-07-08', '2009-07-09', '2009-07-10', '2009-07-13', '2009-07-14', '2009-07-15', '2009-07-16', '2009-07-17', '2009-07-20', '2009-07-21', '2009-07-22', '2009-07-23', '2009-07-24', '2009-07-27', '2009-07-28', '2009-07-29', '2009-07-30', '2009-07-31', '2009-08-03', '2009-08-04', '2009-08-05', '2009-08-06', '2009-08-07', '2009-08-10', '2009-08-11', '2009-08-12', '2009-08-13', '2009-08-14', '2009-08-17', '2009-08-18', '2009-08-19', '2009-08-20', '2009-08-21', '2009-08-24', '2009-08-25', '2009-08-26', '2009-08-27', '2009-08-28', '2009-08-31', '2009-09-01', '2009-09-02', '2009-09-03', '2009-09-04', '2009-09-07', '2009-09-08', '2009-09-09', '2009-09-10', '2009-09-11', '2009-09-14', '2009-09-15', '2009-09-16', '2009-09-17', '2009-09-18', '2009-09-21', '2009-09-22', '2009-09-23', '2009-09-24', '2009-09-25', '2009-09-28', '2009-09-29', '2009-09-30', '2009-10-09', '2009-10-12', '2009-10-13', '2009-10-14', '2009-10-15', '2009-10-16', '2009-10-19', '2009-10-20', '2009-10-21', '2009-10-22', '2009-10-23', '2009-10-26', '2009-10-27', '2009-10-28', '2009-10-29', '2009-10-30', '2009-11-02', '2009-11-03', '2009-11-04', '2009-11-05', '2009-11-06', '2009-11-09', '2009-11-10', '2009-11-11', '2009-11-12', '2009-11-13', '2009-11-16', '2009-11-17', '2009-11-18', '2009-11-19', '2009-11-20', '2009-11-23', '2009-11-24', '2009-11-25', '2009-11-26', '2009-11-27', '2009-11-30', '2009-12-01', '2009-12-02', '2009-12-03', '2009-12-04', '2009-12-07', '2009-12-08', '2009-12-09', '2009-12-10', '2009-12-11', '2009-12-14', '2009-12-15', '2009-12-16', '2009-12-17', '2009-12-18', '2009-12-21', '2009-12-22', '2009-12-23', '2009-12-24', '2009-12-25', '2009-12-28', '2009-12-29', '2009-12-30', '2009-12-31', '2010-01-04', '2010-01-05', '2010-01-06', '2010-01-07', '2010-01-08', '2010-01-11', '2010-01-12', '2010-01-13', '2010-01-14', '2010-01-15', '2010-01-18', '2010-01-19', '2010-01-20', '2010-01-21', '2010-01-22', '2010-01-25', '2010-01-26', '2010-01-27', '2010-01-28', '2010-01-29', '2010-02-01', '2010-02-02', '2010-02-03', '2010-02-04', '2010-02-05', '2010-02-08', '2010-02-09', '2010-02-10', '2010-02-11', '2010-02-12', '2010-02-22', '2010-02-23', '2010-02-24', '2010-02-25', '2010-02-26', '2010-03-01', '2010-03-02', '2010-03-03', '2010-03-04', '2010-03-05', '2010-03-08', '2010-03-09', '2010-03-10', '2010-03-11', '2010-03-12', '2010-03-15', '2010-03-16', '2010-03-17', '2010-03-18', '2010-03-19', '2010-03-22', '2010-03-23', '2010-03-24', '2010-03-25', '2010-03-26', '2010-03-29', '2010-03-30', '2010-03-31', '2010-04-01', '2010-04-02', '2010-04-06', '2010-04-07', '2010-04-08', '2010-04-09', '2010-04-12', '2010-04-13', '2010-04-14', '2010-04-15', '2010-04-16', '2010-04-19', '2010-04-20', '2010-04-21', '2010-04-22', '2010-04-23', '2010-04-26', '2010-04-27', '2010-04-28', '2010-04-29', '2010-04-30', '2010-05-04', '2010-05-05', '2010-05-06', '2010-05-07', '2010-05-10', '2010-05-11', '2010-05-12', '2010-05-13', '2010-05-14', '2010-05-17', '2010-05-18', '2010-05-19', '2010-05-20', '2010-05-21', '2010-05-24', '2010-05-25', '2010-05-26', '2010-05-27', '2010-05-28', '2010-05-31', '2010-06-01', '2010-06-02', '2010-06-03', '2010-06-04', '2010-06-07', '2010-06-08', '2010-06-09', '2010-06-10', '2010-06-11', '2010-06-17', '2010-06-18', '2010-06-21', '2010-06-22', '2010-06-23', '2010-06-24', '2010-06-25', '2010-06-28', '2010-06-29', '2010-06-30', '2010-07-01', '2010-07-02', '2010-07-05', '2010-07-06', '2010-07-07', '2010-07-08', '2010-07-09', '2010-07-12', '2010-07-13', '2010-07-14', '2010-07-15', '2010-07-16', '2010-07-19', '2010-07-20', '2010-07-21', '2010-07-22', '2010-07-23', '2010-07-26', '2010-07-27', '2010-07-28', '2010-07-29', '2010-07-30', '2010-08-02', '2010-08-03', '2010-08-04', '2010-08-05', '2010-08-06', '2010-08-09', '2010-08-10', '2010-08-11', '2010-08-12', '2010-08-13', '2010-08-16', '2010-08-17', '2010-08-18', '2010-08-19', '2010-08-20', '2010-08-23', '2010-08-24', '2010-08-25', '2010-08-26', '2010-08-27', '2010-08-30', '2010-08-31', '2010-09-01', '2010-09-02', '2010-09-03', '2010-09-06', '2010-09-07', '2010-09-08', '2010-09-09', '2010-09-10', '2010-09-13', '2010-09-14', '2010-09-15', '2010-09-16', '2010-09-17', '2010-09-20', '2010-09-21', '2010-09-27', '2010-09-28', '2010-09-29', '2010-09-30', '2010-10-08', '2010-10-11', '2010-10-12', '2010-10-13', '2010-10-14', '2010-10-15', '2010-10-18', '2010-10-19', '2010-10-20', '2010-10-21', '2010-10-22', '2010-10-25', '2010-10-26', '2010-10-27', '2010-10-28', '2010-10-29', '2010-11-01', '2010-11-02', '2010-11-03', '2010-11-04', '2010-11-05', '2010-11-08', '2010-11-09', '2010-11-10', '2010-11-11', '2010-11-12', '2010-11-15', '2010-11-16', '2010-11-17', '2010-11-18', '2010-11-19', '2010-11-22', '2010-11-23', '2010-11-24', '2010-11-25', '2010-11-26', '2010-11-29', '2010-11-30', '2010-12-01', '2010-12-02', '2010-12-03', '2010-12-06', '2010-12-07', '2010-12-08', '2010-12-09', '2010-12-10', '2010-12-13', '2010-12-14', '2010-12-15', '2010-12-16', '2010-12-17', '2010-12-20', '2010-12-21', '2010-12-22', '2010-12-23', '2010-12-24', '2010-12-27', '2010-12-28', '2010-12-29', '2010-12-30', '2010-12-31', '2011-01-04', '2011-01-05', '2011-01-06', '2011-01-07', '2011-01-10', '2011-01-11', '2011-01-12', '2011-01-13', '2011-01-14', '2011-01-17', '2011-01-18', '2011-01-19', '2011-01-20', '2011-01-21', '2011-01-24', '2011-01-25', '2011-01-26', '2011-01-27', '2011-01-28', '2011-01-31', '2011-02-01', '2011-02-09', '2011-02-10', '2011-02-11', '2011-02-14', '2011-02-15', '2011-02-16', '2011-02-17', '2011-02-18', '2011-02-21', '2011-02-22', '2011-02-23', '2011-02-24', '2011-02-25', '2011-02-28', '2011-03-01', '2011-03-02', '2011-03-03', '2011-03-04', '2011-03-07', '2011-03-08', '2011-03-09', '2011-03-10', '2011-03-11', '2011-03-14', '2011-03-15', '2011-03-16', '2011-03-17', '2011-03-18', '2011-03-21', '2011-03-22', '2011-03-23', '2011-03-24', '2011-03-25', '2011-03-28', '2011-03-29', '2011-03-30', '2011-03-31', '2011-04-01', '2011-04-06', '2011-04-07', '2011-04-08', '2011-04-11', '2011-04-12', '2011-04-13', '2011-04-14', '2011-04-15', '2011-04-18', '2011-04-19', '2011-04-20', '2011-04-21', '2011-04-22', '2011-04-25', '2011-04-26', '2011-04-27', '2011-04-28', '2011-04-29', '2011-05-03', '2011-05-04', '2011-05-05', '2011-05-06', '2011-05-09', '2011-05-10', '2011-05-11', '2011-05-12', '2011-05-13', '2011-05-16', '2011-05-17', '2011-05-18', '2011-05-19', '2011-05-20', '2011-05-23', '2011-05-24', '2011-05-25', '2011-05-26', '2011-05-27', '2011-05-30', '2011-05-31', '2011-06-01', '2011-06-02', '2011-06-03', '2011-06-07', '2011-06-08', '2011-06-09', '2011-06-10', '2011-06-13', '2011-06-14', '2011-06-15', '2011-06-16', '2011-06-17', '2011-06-20', '2011-06-21', '2011-06-22', '2011-06-23', '2011-06-24', '2011-06-27', '2011-06-28', '2011-06-29', '2011-06-30', '2011-07-01', '2011-07-04', '2011-07-05', '2011-07-06', '2011-07-07', '2011-07-08', '2011-07-11', '2011-07-12', '2011-07-13', '2011-07-14', '2011-07-15', '2011-07-18', '2011-07-19', '2011-07-20', '2011-07-21', '2011-07-22', '2011-07-25', '2011-07-26', '2011-07-27', '2011-07-28', '2011-07-29', '2011-08-01', '2011-08-02', '2011-08-03', '2011-08-04', '2011-08-05', '2011-08-08', '2011-08-09', '2011-08-10', '2011-08-11', '2011-08-12', '2011-08-15', '2011-08-16', '2011-08-17', '2011-08-18', '2011-08-19', '2011-08-22', '2011-08-23', '2011-08-24', '2011-08-25', '2011-08-26', '2011-08-29', '2011-08-30', '2011-08-31', '2011-09-01', '2011-09-02', '2011-09-05', '2011-09-06', '2011-09-07', '2011-09-08', '2011-09-09', '2011-09-13', '2011-09-14', '2011-09-15', '2011-09-16', '2011-09-19', '2011-09-20', '2011-09-21', '2011-09-22', '2011-09-23', '2011-09-26', '2011-09-27', '2011-09-28', '2011-09-29', '2011-09-30', '2011-10-10', '2011-10-11', '2011-10-12', '2011-10-13', '2011-10-14', '2011-10-17', '2011-10-18', '2011-10-19', '2011-10-20', '2011-10-21', '2011-10-24', '2011-10-25', '2011-10-26', '2011-10-27', '2011-10-28', '2011-10-31', '2011-11-01', '2011-11-02', '2011-11-03', '2011-11-04', '2011-11-07', '2011-11-08', '2011-11-09', '2011-11-10', '2011-11-11', '2011-11-14', '2011-11-15', '2011-11-16', '2011-11-17', '2011-11-18', '2011-11-21', '2011-11-22', '2011-11-23', '2011-11-24', '2011-11-25', '2011-11-28', '2011-11-29', '2011-11-30', '2011-12-01', '2011-12-02', '2011-12-05', '2011-12-06', '2011-12-07', '2011-12-08', '2011-12-09', '2011-12-12', '2011-12-13', '2011-12-14', '2011-12-15', '2011-12-16', '2011-12-19', '2011-12-20', '2011-12-21', '2011-12-22', '2011-12-23', '2011-12-26', '2011-12-27', '2011-12-28', '2011-12-29', '2011-12-30', '2012-01-04', '2012-01-05', '2012-01-06', '2012-01-09', '2012-01-10', '2012-01-11', '2012-01-12', '2012-01-13', '2012-01-16', '2012-01-17', '2012-01-18', '2012-01-19', '2012-01-20', '2012-01-30', '2012-01-31', '2012-02-01', '2012-02-02', '2012-02-03', '2012-02-06', '2012-02-07', '2012-02-08', '2012-02-09', '2012-02-10', '2012-02-13', '2012-02-14', '2012-02-15', '2012-02-16', '2012-02-17', '2012-02-20', '2012-02-21', '2012-02-22', '2012-02-23', '2012-02-24', '2012-02-27', '2012-02-28', '2012-02-29', '2012-03-01', '2012-03-02', '2012-03-05', '2012-03-06', '2012-03-07', '2012-03-08', '2012-03-09', '2012-03-12', '2012-03-13', '2012-03-14', '2012-03-15', '2012-03-16', '2012-03-19', '2012-03-20', '2012-03-21', '2012-03-22', '2012-03-23', '2012-03-26', '2012-03-27', '2012-03-28', '2012-03-29', '2012-03-30', '2012-04-05', '2012-04-06', '2012-04-09', '2012-04-10', '2012-04-11', '2012-04-12', '2012-04-13', '2012-04-16', '2012-04-17', '2012-04-18', '2012-04-19', '2012-04-20', '2012-04-23', '2012-04-24', '2012-04-25', '2012-04-26', '2012-04-27', '2012-05-02', '2012-05-03', '2012-05-04', '2012-05-07', '2012-05-08', '2012-05-09', '2012-05-10', '2012-05-11', '2012-05-14', '2012-05-15', '2012-05-16', '2012-05-17', '2012-05-18', '2012-05-21', '2012-05-22', '2012-05-23', '2012-05-24', '2012-05-25', '2012-05-28', '2012-05-29', '2012-05-30', '2012-05-31', '2012-06-01', '2012-06-04', '2012-06-05', '2012-06-06', '2012-06-07', '2012-06-08', '2012-06-11', '2012-06-12', '2012-06-13', '2012-06-14', '2012-06-15', '2012-06-18', '2012-06-19', '2012-06-20', '2012-06-21', '2012-06-25', '2012-06-26', '2012-06-27', '2012-06-28', '2012-06-29', '2012-07-02', '2012-07-03', '2012-07-04', '2012-07-05', '2012-07-06', '2012-07-09', '2012-07-10', '2012-07-11', '2012-07-12', '2012-07-13', '2012-07-16', '2012-07-17', '2012-07-18', '2012-07-19', '2012-07-20', '2012-07-23', '2012-07-24', '2012-07-25', '2012-07-26', '2012-07-27', '2012-07-30', '2012-07-31', '2012-08-01', '2012-08-02', '2012-08-03', '2012-08-06', '2012-08-07', '2012-08-08', '2012-08-09', '2012-08-10', '2012-08-13', '2012-08-14', '2012-08-15', '2012-08-16', '2012-08-17', '2012-08-20', '2012-08-21', '2012-08-22', '2012-08-23', '2012-08-24', '2012-08-27', '2012-08-28', '2012-08-29', '2012-08-30', '2012-08-31', '2012-09-03', '2012-09-04', '2012-09-05', '2012-09-06', '2012-09-07', '2012-09-10', '2012-09-11', '2012-09-12', '2012-09-13', '2012-09-14', '2012-09-17', '2012-09-18', '2012-09-19', '2012-09-20', '2012-09-21', '2012-09-24', '2012-09-25', '2012-09-26', '2012-09-27', '2012-09-28', '2012-10-08', '2012-10-09', '2012-10-10', '2012-10-11', '2012-10-12', '2012-10-15', '2012-10-16', '2012-10-17', '2012-10-18', '2012-10-19', '2012-10-22', '2012-10-23', '2012-10-24', '2012-10-25', '2012-10-26', '2012-10-29', '2012-10-30', '2012-10-31', '2012-11-01', '2012-11-02', '2012-11-05', '2012-11-06', '2012-11-07', '2012-11-08', '2012-11-09', '2012-11-12', '2012-11-13', '2012-11-14', '2012-11-15', '2012-11-16', '2012-11-19', '2012-11-20', '2012-11-21', '2012-11-22', '2012-11-23', '2012-11-26', '2012-11-27', '2012-11-28', '2012-11-29', '2012-11-30', '2012-12-03', '2012-12-04', '2012-12-05', '2012-12-06', '2012-12-07', '2012-12-10', '2012-12-11', '2012-12-12', '2012-12-13', '2012-12-14', '2012-12-17', '2012-12-18', '2012-12-19', '2012-12-20', '2012-12-21', '2012-12-24', '2012-12-25', '2012-12-26', '2012-12-27', '2012-12-28', '2012-12-31', '2013-01-04', '2013-01-07', '2013-01-08', '2013-01-09', '2013-01-10', '2013-01-11', '2013-01-14', '2013-01-15', '2013-01-16', '2013-01-17', '2013-01-18', '2013-01-21', '2013-01-22', '2013-01-23', '2013-01-24', '2013-01-25', '2013-01-28', '2013-01-29', '2013-01-30', '2013-01-31', '2013-02-01', '2013-02-04', '2013-02-05', '2013-02-06', '2013-02-07', '2013-02-08', '2013-02-18', '2013-02-19', '2013-02-20', '2013-02-21', '2013-02-22', '2013-02-25', '2013-02-26', '2013-02-27', '2013-02-28', '2013-03-01', '2013-03-04', '2013-03-05', '2013-03-06', '2013-03-07', '2013-03-08', '2013-03-11', '2013-03-12', '2013-03-13', '2013-03-14', '2013-03-15', '2013-03-18', '2013-03-19', '2013-03-20', '2013-03-21', '2013-03-22', '2013-03-25', '2013-03-26', '2013-03-27', '2013-03-28', '2013-03-29', '2013-04-01', '2013-04-02', '2013-04-03', '2013-04-08', '2013-04-09', '2013-04-10', '2013-04-11', '2013-04-12', '2013-04-15', '2013-04-16', '2013-04-17', '2013-04-18', '2013-04-19', '2013-04-22', '2013-04-23', '2013-04-24', '2013-04-25', '2013-04-26', '2013-05-02', '2013-05-03', '2013-05-06', '2013-05-07', '2013-05-08', '2013-05-09', '2013-05-10', '2013-05-13', '2013-05-14', '2013-05-15', '2013-05-16', '2013-05-17', '2013-05-20', '2013-05-21', '2013-05-22', '2013-05-23', '2013-05-24', '2013-05-27', '2013-05-28', '2013-05-29', '2013-05-30', '2013-05-31', '2013-06-03', '2013-06-04', '2013-06-05', '2013-06-06', '2013-06-07', '2013-06-13', '2013-06-14', '2013-06-17', '2013-06-18', '2013-06-19', '2013-06-20', '2013-06-21', '2013-06-24', '2013-06-25', '2013-06-26', '2013-06-27', '2013-06-28', '2013-07-01', '2013-07-02', '2013-07-03', '2013-07-04', '2013-07-05', '2013-07-08', '2013-07-09', '2013-07-10', '2013-07-11', '2013-07-12', '2013-07-15', '2013-07-16', '2013-07-17', '2013-07-18', '2013-07-19', '2013-07-22', '2013-07-23', '2013-07-24', '2013-07-25', '2013-07-26', '2013-07-29', '2013-07-30', '2013-07-31', '2013-08-01', '2013-08-02', '2013-08-05', '2013-08-06', '2013-08-07', '2013-08-08', '2013-08-09', '2013-08-12', '2013-08-13', '2013-08-14', '2013-08-15', '2013-08-16', '2013-08-19', '2013-08-20', '2013-08-21', '2013-08-22', '2013-08-23', '2013-08-26', '2013-08-27', '2013-08-28', '2013-08-29', '2013-08-30', '2013-09-02', '2013-09-03', '2013-09-04', '2013-09-05', '2013-09-06', '2013-09-09', '2013-09-10', '2013-09-11', '2013-09-12', '2013-09-13', '2013-09-16', '2013-09-17', '2013-09-18', '2013-09-23', '2013-09-24', '2013-09-25', '2013-09-26', '2013-09-27', '2013-09-30', '2013-10-08', '2013-10-09', '2013-10-10', '2013-10-11', '2013-10-14', '2013-10-15', '2013-10-16', '2013-10-17', '2013-10-18', '2013-10-21', '2013-10-22', '2013-10-23', '2013-10-24', '2013-10-25', '2013-10-28', '2013-10-29', '2013-10-30', '2013-10-31', '2013-11-01', '2013-11-04', '2013-11-05', '2013-11-06', '2013-11-07', '2013-11-08', '2013-11-11', '2013-11-12', '2013-11-13', '2013-11-14', '2013-11-15', '2013-11-18', '2013-11-19', '2013-11-20', '2013-11-21', '2013-11-22', '2013-11-25', '2013-11-26', '2013-11-27', '2013-11-28', '2013-11-29', '2013-12-02', '2013-12-03', '2013-12-04', '2013-12-05', '2013-12-06', '2013-12-09', '2013-12-10', '2013-12-11', '2013-12-12', '2013-12-13', '2013-12-16', '2013-12-17', '2013-12-18', '2013-12-19', '2013-12-20', '2013-12-23', '2013-12-24', '2013-12-25', '2013-12-26', '2013-12-27', '2013-12-30', '2013-12-31', '2014-01-02', '2014-01-03', '2014-01-06', '2014-01-07', '2014-01-08', '2014-01-09', '2014-01-10', '2014-01-13', '2014-01-14', '2014-01-15', '2014-01-16', '2014-01-17', '2014-01-20', '2014-01-21', '2014-01-22', '2014-01-23', '2014-01-24', '2014-01-27', '2014-01-28', '2014-01-29', '2014-01-30', '2014-02-07', '2014-02-10', '2014-02-11', '2014-02-12', '2014-02-13', '2014-02-14', '2014-02-17', '2014-02-18', '2014-02-19', '2014-02-20', '2014-02-21', '2014-02-24', '2014-02-25', '2014-02-26', '2014-02-27', '2014-02-28', '2014-03-03', '2014-03-04', '2014-03-05', '2014-03-06', '2014-03-07', '2014-03-10', '2014-03-11', '2014-03-12', '2014-03-13', '2014-03-14', '2014-03-17', '2014-03-18', '2014-03-19', '2014-03-20', '2014-03-21', '2014-03-24', '2014-03-25', '2014-03-26', '2014-03-27', '2014-03-28', '2014-03-31', '2014-04-01', '2014-04-02', '2014-04-03', '2014-04-04', '2014-04-08', '2014-04-09', '2014-04-10', '2014-04-11', '2014-04-14', '2014-04-15', '2014-04-16', '2014-04-17', '2014-04-18', '2014-04-21', '2014-04-22', '2014-04-23', '2014-04-24', '2014-04-25', '2014-04-28', '2014-04-29', '2014-04-30', '2014-05-05', '2014-05-06', '2014-05-07', '2014-05-08', '2014-05-09', '2014-05-12', '2014-05-13', '2014-05-14', '2014-05-15', '2014-05-16', '2014-05-19', '2014-05-20', '2014-05-21', '2014-05-22', '2014-05-23', '2014-05-26', '2014-05-27', '2014-05-28', '2014-05-29', '2014-05-30', '2014-06-03', '2014-06-04', '2014-06-05', '2014-06-06', '2014-06-09', '2014-06-10', '2014-06-11', '2014-06-12', '2014-06-13', '2014-06-16', '2014-06-17', '2014-06-18', '2014-06-19', '2014-06-20', '2014-06-23', '2014-06-24', '2014-06-25', '2014-06-26', '2014-06-27', '2014-06-30', '2014-07-01', '2014-07-02', '2014-07-03', '2014-07-04', '2014-07-07', '2014-07-08', '2014-07-09', '2014-07-10', '2014-07-11', '2014-07-14', '2014-07-15', '2014-07-16', '2014-07-17', '2014-07-18', '2014-07-21', '2014-07-22', '2014-07-23', '2014-07-24', '2014-07-25', '2014-07-28', '2014-07-29', '2014-07-30', '2014-07-31', '2014-08-01', '2014-08-04', '2014-08-05', '2014-08-06', '2014-08-07', '2014-08-08', '2014-08-11', '2014-08-12', '2014-08-13', '2014-08-14', '2014-08-15', '2014-08-18', '2014-08-19', '2014-08-20', '2014-08-21', '2014-08-22', '2014-08-25', '2014-08-26', '2014-08-27', '2014-08-28', '2014-08-29', '2014-09-01', '2014-09-02', '2014-09-03', '2014-09-04', '2014-09-05', '2014-09-09', '2014-09-10', '2014-09-11', '2014-09-12', '2014-09-15', '2014-09-16', '2014-09-17', '2014-09-18', '2014-09-19', '2014-09-22', '2014-09-23', '2014-09-24', '2014-09-25', '2014-09-26', '2014-09-29', '2014-09-30', '2014-10-08', '2014-10-09', '2014-10-10', '2014-10-13', '2014-10-14', '2014-10-15', '2014-10-16', '2014-10-17', '2014-10-20', '2014-10-21', '2014-10-22', '2014-10-23', '2014-10-24', '2014-10-27', '2014-10-28', '2014-10-29', '2014-10-30', '2014-10-31', '2014-11-03', '2014-11-04', '2014-11-05', '2014-11-06', '2014-11-07', '2014-11-10', '2014-11-11', '2014-11-12', '2014-11-13', '2014-11-14', '2014-11-17', '2014-11-18', '2014-11-19', '2014-11-20', '2014-11-21', '2014-11-24', '2014-11-25', '2014-11-26', '2014-11-27', '2014-11-28', '2014-12-01', '2014-12-02', '2014-12-03', '2014-12-04', '2014-12-05', '2014-12-08', '2014-12-09', '2014-12-10', '2014-12-11', '2014-12-12', '2014-12-15', '2014-12-16', '2014-12-17', '2014-12-18', '2014-12-19', '2014-12-22', '2014-12-23', '2014-12-24', '2014-12-25', '2014-12-26', '2014-12-29', '2014-12-30', '2014-12-31', '2015-01-05', '2015-01-06', '2015-01-07', '2015-01-08', '2015-01-09', '2015-01-12', '2015-01-13', '2015-01-14', '2015-01-15', '2015-01-16', '2015-01-19', '2015-01-20', '2015-01-21', '2015-01-22', '2015-01-23', '2015-01-26', '2015-01-27', '2015-01-28', '2015-01-29', '2015-01-30', '2015-02-02', '2015-02-03', '2015-02-04', '2015-02-05', '2015-02-06', '2015-02-09', '2015-02-10', '2015-02-11', '2015-02-12', '2015-02-13', '2015-02-16', '2015-02-17', '2015-02-25', '2015-02-26', '2015-02-27', '2015-03-02', '2015-03-03', '2015-03-04', '2015-03-05', '2015-03-06', '2015-03-09', '2015-03-10', '2015-03-11', '2015-03-12', '2015-03-13', '2015-03-16', '2015-03-17', '2015-03-18', '2015-03-19', '2015-03-20', '2015-03-23', '2015-03-24', '2015-03-25', '2015-03-26', '2015-03-27', '2015-03-30', '2015-03-31', '2015-04-01', '2015-04-02', '2015-04-03', '2015-04-07', '2015-04-08', '2015-04-09', '2015-04-10', '2015-04-13', '2015-04-14', '2015-04-15', '2015-04-16', '2015-04-17', '2015-04-20', '2015-04-21', '2015-04-22', '2015-04-23', '2015-04-24', '2015-04-27', '2015-04-28', '2015-04-29', '2015-04-30', '2015-05-04', '2015-05-05', '2015-05-06', '2015-05-07', '2015-05-08', '2015-05-11', '2015-05-12', '2015-05-13', '2015-05-14', '2015-05-15', '2015-05-18', '2015-05-19', '2015-05-20', '2015-05-21', '2015-05-22', '2015-05-25', '2015-05-26', '2015-05-27', '2015-05-28', '2015-05-29', '2015-06-01', '2015-06-02', '2015-06-03', '2015-06-04', '2015-06-05', '2015-06-08', '2015-06-09', '2015-06-10', '2015-06-11', '2015-06-12', '2015-06-15', '2015-06-16', '2015-06-17', '2015-06-18', '2015-06-19', '2015-06-23', '2015-06-24', '2015-06-25', '2015-06-26', '2015-06-29', '2015-06-30', '2015-07-01', '2015-07-02', '2015-07-03', '2015-07-06', '2015-07-07', '2015-07-08', '2015-07-09', '2015-07-10', '2015-07-13', '2015-07-14', '2015-07-15', '2015-07-16', '2015-07-17', '2015-07-20', '2015-07-21', '2015-07-22', '2015-07-23', '2015-07-24', '2015-07-27', '2015-07-28', '2015-07-29', '2015-07-30', '2015-07-31', '2015-08-03', '2015-08-04', '2015-08-05', '2015-08-06', '2015-08-07', '2015-08-10', '2015-08-11', '2015-08-12', '2015-08-13', '2015-08-14', '2015-08-17', '2015-08-18', '2015-08-19', '2015-08-20', '2015-08-21', '2015-08-24', '2015-08-25', '2015-08-26', '2015-08-27', '2015-08-28', '2015-08-31', '2015-09-01', '2015-09-02', '2015-09-07', '2015-09-08', '2015-09-09', '2015-09-10', '2015-09-11', '2015-09-14', '2015-09-15', '2015-09-16', '2015-09-17', '2015-09-18', '2015-09-21', '2015-09-22', '2015-09-23', '2015-09-24', '2015-09-25', '2015-09-28', '2015-09-29', '2015-09-30', '2015-10-08', '2015-10-09', '2015-10-12', '2015-10-13', '2015-10-14', '2015-10-15', '2015-10-16', '2015-10-19', '2015-10-20', '2015-10-21', '2015-10-22', '2015-10-23', '2015-10-26', '2015-10-27', '2015-10-28', '2015-10-29', '2015-10-30', '2015-11-02', '2015-11-03', '2015-11-04', '2015-11-05', '2015-11-06', '2015-11-09', '2015-11-10', '2015-11-11', '2015-11-12', '2015-11-13', '2015-11-16', '2015-11-17', '2015-11-18', '2015-11-19', '2015-11-20', '2015-11-23', '2015-11-24', '2015-11-25', '2015-11-26', '2015-11-27', '2015-11-30', '2015-12-01', '2015-12-02', '2015-12-03', '2015-12-04', '2015-12-07', '2015-12-08', '2015-12-09', '2015-12-10', '2015-12-11', '2015-12-14', '2015-12-15', '2015-12-16', '2015-12-17', '2015-12-18', '2015-12-21', '2015-12-22', '2015-12-23', '2015-12-24', '2015-12-25', '2015-12-28', '2015-12-29', '2015-12-30', '2015-12-31', '2016-01-04', '2016-01-05', '2016-01-06', '2016-01-07', '2016-01-08', '2016-01-11', '2016-01-12', '2016-01-13', '2016-01-14', '2016-01-15', '2016-01-18', '2016-01-19', '2016-01-20', '2016-01-21', '2016-01-22', '2016-01-25', '2016-01-26', '2016-01-27', '2016-01-28', '2016-01-29', '2016-02-01', '2016-02-02', '2016-02-03', '2016-02-04', '2016-02-05', '2016-02-15', '2016-02-16', '2016-02-17', '2016-02-18', '2016-02-19', '2016-02-22', '2016-02-23', '2016-02-24', '2016-02-25', '2016-02-26', '2016-02-29', '2016-03-01', '2016-03-02', '2016-03-03', '2016-03-04', '2016-03-07', '2016-03-08', '2016-03-09', '2016-03-10', '2016-03-11', '2016-03-14', '2016-03-15', '2016-03-16', '2016-03-17', '2016-03-18', '2016-03-21', '2016-03-22', '2016-03-23', '2016-03-24', '2016-03-25', '2016-03-28', '2016-03-29', '2016-03-30', '2016-03-31', '2016-04-01', '2016-04-05', '2016-04-06', '2016-04-07', '2016-04-08', '2016-04-11', '2016-04-12', '2016-04-13', '2016-04-14', '2016-04-15', '2016-04-18', '2016-04-19', '2016-04-20', '2016-04-21', '2016-04-22', '2016-04-25', '2016-04-26', '2016-04-27', '2016-04-28', '2016-04-29', '2016-05-03', '2016-05-04', '2016-05-05', '2016-05-06', '2016-05-09', '2016-05-10', '2016-05-11', '2016-05-12', '2016-05-13', '2016-05-16', '2016-05-17', '2016-05-18', '2016-05-19', '2016-05-20', '2016-05-23', '2016-05-24', '2016-05-25', '2016-05-26', '2016-05-27', '2016-05-30', '2016-05-31', '2016-06-01', '2016-06-02', '2016-06-03', '2016-06-06', '2016-06-07', '2016-06-08', '2016-06-13', '2016-06-14', '2016-06-15', '2016-06-16', '2016-06-17', '2016-06-20', '2016-06-21', '2016-06-22', '2016-06-23', '2016-06-24', '2016-06-27', '2016-06-28', '2016-06-29', '2016-06-30', '2016-07-01', '2016-07-04', '2016-07-05', '2016-07-06', '2016-07-07', '2016-07-08', '2016-07-11', '2016-07-12', '2016-07-13', '2016-07-14', '2016-07-15', '2016-07-18', '2016-07-19', '2016-07-20', '2016-07-21', '2016-07-22', '2016-07-25', '2016-07-26', '2016-07-27', '2016-07-28', '2016-07-29', '2016-08-01', '2016-08-02', '2016-08-03', '2016-08-04', '2016-08-05', '2016-08-08', '2016-08-09', '2016-08-10', '2016-08-11', '2016-08-12', '2016-08-15', '2016-08-16', '2016-08-17', '2016-08-18', '2016-08-19', '2016-08-22', '2016-08-23', '2016-08-24', '2016-08-25', '2016-08-26', '2016-08-29', '2016-08-30', '2016-08-31', '2016-09-01', '2016-09-02', '2016-09-05', '2016-09-06', '2016-09-07', '2016-09-08', '2016-09-09', '2016-09-12', '2016-09-13', '2016-09-14', '2016-09-19', '2016-09-20', '2016-09-21', '2016-09-22', '2016-09-23', '2016-09-26', '2016-09-27', '2016-09-28', '2016-09-29', '2016-09-30', '2016-10-10', '2016-10-11', '2016-10-12', '2016-10-13', '2016-10-14', '2016-10-17', '2016-10-18', '2016-10-19', '2016-10-20', '2016-10-21', '2016-10-24', '2016-10-25', '2016-10-26', '2016-10-27', '2016-10-28', '2016-10-31', '2016-11-01', '2016-11-02', '2016-11-03', '2016-11-04', '2016-11-07', '2016-11-08', '2016-11-09', '2016-11-10', '2016-11-11', '2016-11-14', '2016-11-15', '2016-11-16', '2016-11-17', '2016-11-18', '2016-11-21', '2016-11-22', '2016-11-23', '2016-11-24', '2016-11-25', '2016-11-28', '2016-11-29', '2016-11-30', '2016-12-01', '2016-12-02', '2016-12-05', '2016-12-06', '2016-12-07', '2016-12-08', '2016-12-09', '2016-12-12', '2016-12-13', '2016-12-14', '2016-12-15', '2016-12-16', '2016-12-19', '2016-12-20', '2016-12-21', '2016-12-22', '2016-12-23', '2016-12-26', '2016-12-27', '2016-12-28', '2016-12-29', '2016-12-30', '2017-01-03', '2017-01-04', '2017-01-05', '2017-01-06', '2017-01-09', '2017-01-10', '2017-01-11', '2017-01-12', '2017-01-13', '2017-01-16', '2017-01-17', '2017-01-18', '2017-01-19', '2017-01-20', '2017-01-23', '2017-01-24', '2017-01-25', '2017-01-26', '2017-02-03', '2017-02-06', '2017-02-07', '2017-02-08', '2017-02-09', '2017-02-10', '2017-02-13', '2017-02-14', '2017-02-15', '2017-02-16', '2017-02-17', '2017-02-20', '2017-02-21', '2017-02-22', '2017-02-23', '2017-02-24', '2017-02-27', '2017-02-28', '2017-03-01', '2017-03-02', '2017-03-03', '2017-03-06', '2017-03-07', '2017-03-08', '2017-03-09', '2017-03-10', '2017-03-13', '2017-03-14', '2017-03-15', '2017-03-16', '2017-03-17', '2017-03-20', '2017-03-21', '2017-03-22', '2017-03-23', '2017-03-24', '2017-03-27', '2017-03-28', '2017-03-29', '2017-03-30', '2017-03-31', '2017-04-05', '2017-04-06', '2017-04-07', '2017-04-10', '2017-04-11', '2017-04-12', '2017-04-13', '2017-04-14', '2017-04-17', '2017-04-18', '2017-04-19', '2017-04-20', '2017-04-21', '2017-04-24', '2017-04-25', '2017-04-26', '2017-04-27', '2017-04-28', '2017-05-02', '2017-05-03', '2017-05-04', '2017-05-05', '2017-05-08', '2017-05-09', '2017-05-10', '2017-05-11', '2017-05-12', '2017-05-15', '2017-05-16', '2017-05-17', '2017-05-18', '2017-05-19', '2017-05-22', '2017-05-23', '2017-05-24', '2017-05-25', '2017-05-26', '2017-05-31', '2017-06-01', '2017-06-02', '2017-06-05', '2017-06-06', '2017-06-07', '2017-06-08', '2017-06-09', '2017-06-12', '2017-06-13', '2017-06-14', '2017-06-15', '2017-06-16', '2017-06-19', '2017-06-20', '2017-06-21', '2017-06-22', '2017-06-23', '2017-06-26', '2017-06-27', '2017-06-28', '2017-06-29', '2017-06-30', '2017-07-03', '2017-07-04', '2017-07-05', '2017-07-06', '2017-07-07', '2017-07-10', '2017-07-11', '2017-07-12', '2017-07-13', '2017-07-14', '2017-07-17', '2017-07-18', '2017-07-19', '2017-07-20', '2017-07-21', '2017-07-24', '2017-07-25', '2017-07-26', '2017-07-27', '2017-07-28', '2017-07-31', '2017-08-01', '2017-08-02', '2017-08-03', '2017-08-04', '2017-08-07', '2017-08-08', '2017-08-09', '2017-08-10', '2017-08-11', '2017-08-14', '2017-08-15', '2017-08-16', '2017-08-17', '2017-08-18', '2017-08-21', '2017-08-22', '2017-08-23', '2017-08-24', '2017-08-25', '2017-08-28', '2017-08-29', '2017-08-30', '2017-08-31', '2017-09-01', '2017-09-04', '2017-09-05', '2017-09-06', '2017-09-07', '2017-09-08', '2017-09-11', '2017-09-12', '2017-09-13', '2017-09-14', '2017-09-15', '2017-09-18', '2017-09-19', '2017-09-20', '2017-09-21', '2017-09-22', '2017-09-25', '2017-09-26', '2017-09-27', '2017-09-28', '2017-09-29', '2017-10-09', '2017-10-10', '2017-10-11', '2017-10-12', '2017-10-13', '2017-10-16', '2017-10-17', '2017-10-18', '2017-10-19', '2017-10-20', '2017-10-23', '2017-10-24', '2017-10-25', '2017-10-26', '2017-10-27', '2017-10-30', '2017-10-31', '2017-11-01', '2017-11-02', '2017-11-03', '2017-11-06', '2017-11-07', '2017-11-08', '2017-11-09', '2017-11-10', '2017-11-13', '2017-11-14', '2017-11-15', '2017-11-16', '2017-11-17', '2017-11-20', '2017-11-21', '2017-11-22', '2017-11-23', '2017-11-24', '2017-11-27', '2017-11-28', '2017-11-29', '2017-11-30', '2017-12-01', '2017-12-04', '2017-12-05', '2017-12-06', '2017-12-07', '2017-12-08', '2017-12-11', '2017-12-12', '2017-12-13', '2017-12-14', '2017-12-15', '2017-12-18', '2017-12-19', '2017-12-20', '2017-12-21', '2017-12-22', '2017-12-25', '2017-12-26', '2017-12-27', '2017-12-28', '2017-12-29', '2018-01-02', '2018-01-03', '2018-01-04', '2018-01-05', '2018-01-08', '2018-01-09', '2018-01-10', '2018-01-11', '2018-01-12', '2018-01-15', '2018-01-16', '2018-01-17', '2018-01-18', '2018-01-19', '2018-01-22', '2018-01-23', '2018-01-24', '2018-01-25', '2018-01-26', '2018-01-29', '2018-01-30', '2018-01-31', '2018-02-01', '2018-02-02', '2018-02-05', '2018-02-06', '2018-02-07', '2018-02-08', '2018-02-09', '2018-02-12', '2018-02-13', '2018-02-14', '2018-02-22', '2018-02-23', '2018-02-26', '2018-02-27', '2018-02-28', '2018-03-01', '2018-03-02', '2018-03-05', '2018-03-06', '2018-03-07', '2018-03-08', '2018-03-09', '2018-03-12', '2018-03-13', '2018-03-14', '2018-03-15', '2018-03-16', '2018-03-19', '2018-03-20', '2018-03-21', '2018-03-22', '2018-03-23', '2018-03-26', '2018-03-27', '2018-03-28', '2018-03-29', '2018-03-30', '2018-04-02', '2018-04-03', '2018-04-04', '2018-04-09', '2018-04-10', '2018-04-11', '2018-04-12', '2018-04-13', '2018-04-16', '2018-04-17', '2018-04-18', '2018-04-19', '2018-04-20', '2018-04-23', '2018-04-24', '2018-04-25', '2018-04-26', '2018-04-27', '2018-05-02', '2018-05-03', '2018-05-04', '2018-05-07', '2018-05-08', '2018-05-09', '2018-05-10', '2018-05-11', '2018-05-14', '2018-05-15', '2018-05-16', '2018-05-17', '2018-05-18', '2018-05-21', '2018-05-22', '2018-05-23', '2018-05-24', '2018-05-25', '2018-05-28', '2018-05-29', '2018-05-30', '2018-05-31', '2018-06-01', '2018-06-04', '2018-06-05', '2018-06-06', '2018-06-07', '2018-06-08', '2018-06-11', '2018-06-12', '2018-06-13', '2018-06-14', '2018-06-15', '2018-06-19', '2018-06-20', '2018-06-21', '2018-06-22', '2018-06-25', '2018-06-26', '2018-06-27', '2018-06-28', '2018-06-29', '2018-07-02', '2018-07-03', '2018-07-04', '2018-07-05', '2018-07-06', '2018-07-09', '2018-07-10', '2018-07-11', '2018-07-12', '2018-07-13', '2018-07-16', '2018-07-17', '2018-07-18', '2018-07-19', '2018-07-20', '2018-07-23', '2018-07-24', '2018-07-25', '2018-07-26', '2018-07-27', '2018-07-30', '2018-07-31', '2018-08-01', '2018-08-02', '2018-08-03', '2018-08-06', '2018-08-07', '2018-08-08', '2018-08-09', '2018-08-10', '2018-08-13', '2018-08-14', '2018-08-15', '2018-08-16', '2018-08-17', '2018-08-20', '2018-08-21', '2018-08-22', '2018-08-23', '2018-08-24', '2018-08-27', '2018-08-28', '2018-08-29', '2018-08-30', '2018-08-31', '2018-09-03', '2018-09-04', '2018-09-05', '2018-09-06', '2018-09-07', '2018-09-10', '2018-09-11', '2018-09-12', '2018-09-13', '2018-09-14', '2018-09-17', '2018-09-18', '2018-09-19', '2018-09-20', '2018-09-21', '2018-09-25', '2018-09-26', '2018-09-27', '2018-09-28', '2018-10-08', '2018-10-09', '2018-10-10', '2018-10-11', '2018-10-12', '2018-10-15', '2018-10-16', '2018-10-17', '2018-10-18', '2018-10-19', '2018-10-22', '2018-10-23', '2018-10-24', '2018-10-25', '2018-10-26', '2018-10-29', '2018-10-30', '2018-10-31', '2018-11-01', '2018-11-02', '2018-11-05', '2018-11-06', '2018-11-07', '2018-11-08', '2018-11-09', '2018-11-12', '2018-11-13', '2018-11-14', '2018-11-15', '2018-11-16', '2018-11-19', '2018-11-20', '2018-11-21', '2018-11-22', '2018-11-23', '2018-11-26', '2018-11-27', '2018-11-28', '2018-11-29', '2018-11-30', '2018-12-03', '2018-12-04', '2018-12-05', '2018-12-06', '2018-12-07', '2018-12-10', '2018-12-11', '2018-12-12', '2018-12-13', '2018-12-14', '2018-12-17', '2018-12-18', '2018-12-19', '2018-12-20', '2018-12-21', '2018-12-24', '2018-12-25', '2018-12-26', '2018-12-27', '2018-12-28', '2018-12-31']
+
+
[docs]def QA_util_if_trade(day): + '日期是否交易' + if day in trade_date_sse: + return True + else: + return False
+ + +
[docs]def QA_util_if_tradetime(_time,market=MARKET_TYPE.STOCK_CN,code=None): + '时间是否交易' + _time = datetime.datetime.strptime(str(_time)[0:19], '%Y-%m-%d %H:%M:%S') + if market is MARKET_TYPE.STOCK_CN: + if QA_util_if_trade(str(_time.date())[0:10]): + if _time.hour in [10, 13, 14]: + return True + elif _time.hour in [9] and _time.minute >= 30: + return True + elif _time.hour in [11] and _time.minute <= 30: + return True + else: + return False + else: + return False + elif market is MARKET_TYPE.FUTURE_CN: + # 暂时用螺纹 + if code[0:2] in ['rb','RB']: + if QA_util_if_trade(str(_time.date())[0:10]): + if _time.hour in [9, 10, 14, 21, 22]: + return True + elif _time.hour in [13] and _time.minute >= 30: + return True + elif _time.hour in [11] and _time.minute <= 30: + return True + else: + return False + else: + return False
+ +
[docs]def QA_util_get_next_day(date,n=1): + """ + 得到下一个(n)交易日 + """ + return QA_util_date_gap(date,n,'gt')
+ +
[docs]def QA_util_get_last_day(date,n=1): + """ + 得到上一个(n)交易日 + """ + return QA_util_date_gap(date,n,'lt')
+ +
[docs]def QA_util_get_real_date(date, trade_list=trade_date_sse, towards=-1): + """ + 获取真实的交易日期,其中,第三个参数towards是表示向前/向后推 + towards=1 日期向后迭代 + towards=-1 日期向前迭代 + @ yutiansut + + """ + if towards == 1: + while date not in trade_list: + date = str(datetime.datetime.strptime( + str(date)[0:10], '%Y-%m-%d') + datetime.timedelta(days=1))[0:10] + else: + return str(date)[0:10] + elif towards == -1: + while date not in trade_list: + date = str(datetime.datetime.strptime( + str(date)[0:10], '%Y-%m-%d') - datetime.timedelta(days=1))[0:10] + else: + return str(date)[0:10]
+ + +
[docs]def QA_util_get_real_datelist(start, end): + """ + 取数据的真实区间,返回的时候用 start,end=QA_util_get_real_datelist + @yutiansut + 2017/8/10 + + 当start end中间没有交易日 返回None, None + @yutiansut/ 2017-12-19 + """ + real_start = QA_util_get_real_date(start, trade_date_sse, 1) + real_end = QA_util_get_real_date(end, trade_date_sse, -1) + if trade_date_sse.index(real_start) > trade_date_sse.index(real_end): + return None, None + else: + return (real_start, real_end)
+ + +
[docs]def QA_util_get_trade_range(start, end): + '给出交易具体时间' + start, end = QA_util_get_real_datelist(start, end) + if start is not None: + return trade_date_sse[trade_date_sse.index(start):trade_date_sse.index(end) + 1:1] + else: + return None
+ + +
[docs]def QA_util_get_trade_gap(start, end): + '返回start_day到end_day中间有多少个交易天 算首尾' + start, end = QA_util_get_real_datelist(start, end) + if start is not None: + return trade_date_sse.index(end) + 1 - trade_date_sse.index(start) + else: + return 0
+ + +
[docs]def QA_util_date_gap(date, gap, methods): + """[summary] + + Arguments: + date {[type]} -- [description] + gap {[type]} -- [description] + methods {[type]} -- [description] + + Returns: + [type] -- [description] + """ + + try: + if methods in ['>', 'gt']: + return trade_date_sse[trade_date_sse.index(date) + gap] + elif methods in ['>=', 'gte']: + return trade_date_sse[trade_date_sse.index(date) + gap - 1] + elif methods in ['<', 'lt']: + return trade_date_sse[trade_date_sse.index(date) - gap] + elif methods in ['<=', 'lte']: + return trade_date_sse[trade_date_sse.index(date) - gap + 1] + elif methods in ['==', '=', 'eq']: + return date + + except: + return 'wrong date'
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAUtil/QADict.html b/_build/html/_modules/QUANTAXIS/QAUtil/QADict.html new file mode 100644 index 000000000..7a0c0305f --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAUtil/QADict.html @@ -0,0 +1,120 @@ + + + + + + + + QUANTAXIS.QAUtil.QADict — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAUtil.QADict

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+
+
[docs]def QA_util_dict_remove_key(dicts, key): + """ + 输入一个dict 返回删除后的 + """ + + if isinstance(key, list): + for item in key: + try: + dicts.pop(item) + except: + pass + else: + try: + dicts.pop(key) + except: + pass + return dicts
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAUtil/QAList.html b/_build/html/_modules/QUANTAXIS/QAUtil/QAList.html new file mode 100644 index 000000000..d17cea7a2 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAUtil/QAList.html @@ -0,0 +1,115 @@ + + + + + + + + QUANTAXIS.QAUtil.QAList — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAUtil.QAList

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+import numpy as np
+
+
+
[docs]def QA_util_multi_demension_list(row_, col_=0): + # row_ 是行, col_ 是列 + """ + 如果需要创建一个[[],[]], 那就用 row_=2,col=0 + 其他时候,返回的都是[[None]] + """ + return [[None for col in range(col_)] for row in range(row_)]
+ + +
[docs]def QA_util_diff_list(datastruct): + return (np.array(datastruct[1:]) - np.array(datastruct[:-1])).tolist()
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAUtil/QALogs.html b/_build/html/_modules/QUANTAXIS/QAUtil/QALogs.html new file mode 100644 index 000000000..828790986 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAUtil/QALogs.html @@ -0,0 +1,161 @@ + + + + + + + + QUANTAXIS.QAUtil.QALogs — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAUtil.QALogs

+# Coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+"""
+QUANTAXIS Log Module
+@yutiansut
+
+QA_util_log_x is under [QAStandard#0.0.2@602-x] Protocol
+QA_util_log_info()
+QA_util_log_debug()
+QA_util_log_expection()
+"""
+
+import datetime
+
+from zenlog import logging
+
+logging.basicConfig(level=logging.DEBUG,
+                    format='%(asctime)s QUANTAXIS>>> %(message)s',
+                    datefmt='%H:%M:%S',
+                    filename='quantaxis-' +
+                    str(datetime.datetime.now().strftime(
+                        '%Y-%m-%d-%H-%M-%S')) + '-.log',
+                    filemode='w')
+console = logging.StreamHandler()
+console.setLevel(logging.INFO)
+formatter = logging.Formatter('QUANTAXIS>> %(message)s')
+console.setFormatter(formatter)
+logging.getLogger('').addHandler(console)
+
+
+logging.info('start QUANTAXIS')
+
+
+
[docs]def QA_util_log_debug(logs): + """ + QUANTAXIS Log Module + @yutiansut + + QA_util_log_x is under [QAStandard#0.0.2@602-x] Protocol + """ + logging.debug(logs)
+ + +
[docs]def QA_util_log_info(logs): + """ + QUANTAXIS Log Module + @yutiansut + + QA_util_log_x is under [QAStandard#0.0.2@602-x] Protocol + """ + logging.info(logs)
+ + +
[docs]def QA_util_log_expection(logs): + """ + QUANTAXIS Log Module + @yutiansut + + QA_util_log_x is under [QAStandard#0.0.2@602-x] Protocol + """ + logging.exception(logs)
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAUtil/QAMail.html b/_build/html/_modules/QUANTAXIS/QAUtil/QAMail.html new file mode 100644 index 000000000..315e53f5f --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAUtil/QAMail.html @@ -0,0 +1,131 @@ + + + + + + + + QUANTAXIS.QAUtil.QAMail — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAUtil.QAMail

+# coding=utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+from email import encoders
+from email.header import Header
+from email.mime.text import MIMEText
+from email.utils import parseaddr, formataddr
+import smtplib
+
+
+
[docs]def QA_util_send_mail(msg, title, from_user, from_password, to_addr, smtp): + """邮件发送 + + Arguments: + msg {[type]} -- [description] + title {[type]} -- [description] + from_user {[type]} -- [description] + from_password {[type]} -- [description] + to_addr {[type]} -- [description] + smtp {[type]} -- [description] + """ + + msg = MIMEText(msg, 'plain', 'utf-8') + msg['Subject'] = Header(title, 'utf-8').encode() + + server = smtplib.SMTP(smtp, 25) # SMTP协议默认端口是25 + server.set_debuglevel(1) + server.login(from_user, from_password) + server.sendmail(from_user, [to_addr], msg.as_string())
+ + + +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAUtil/QAMongo.html b/_build/html/_modules/QUANTAXIS/QAUtil/QAMongo.html new file mode 100644 index 000000000..12435d639 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAUtil/QAMongo.html @@ -0,0 +1,147 @@ + + + + + + + + QUANTAXIS.QAUtil.QAMongo — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAUtil.QAMongo

+# coding=utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+
+import subprocess
+
+import pandas as pd
+
+from QUANTAXIS.QAUtil.QASetting import DATABASE
+from QUANTAXIS.QAUtil.QALogs import QA_util_log_info
+
+
+
[docs]def QA_util_mongo_initial(db=DATABASE): + + db.drop_collection('stock_day') + db.drop_collection('stock_list') + db.drop_collection('stock_info') + db.drop_collection('trade_date') + db.drop_collection('stock_min') + db.drop_collection('stock_transaction') + db.drop_collection('stock_xdxr')
+ + + + + +
[docs]def QA_util_mongo_status(db=DATABASE): + QA_util_log_info(db.collection_names()) + QA_util_log_info(db.last_status()) + QA_util_log_info(subprocess.call('mongostat', shell=True))
+ + +
[docs]def QA_util_mongo_infos(db=DATABASE): + + data_struct = [] + + for item in db.collection_names(): + value = [] + value.append(item) + value.append(eval('db.' + str(item) + '.find({}).count()')) + value.append(list(eval('db.' + str(item) + '.find_one()').keys())) + data_struct.append(value) + return pd.DataFrame(data_struct, columns=['collection_name', 'counts', 'columns']).set_index('collection_name')
+ + +if __name__ == '__main__': + print(QA_util_mongo_infos()) + QA_util_mongo_status() +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAUtil/QAParameter.html b/_build/html/_modules/QUANTAXIS/QAUtil/QAParameter.html new file mode 100644 index 000000000..facda7b25 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAUtil/QAParameter.html @@ -0,0 +1,423 @@ + + + + + + + + QUANTAXIS.QAUtil.QAParameter — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAUtil.QAParameter

+# -* coding: utf-8 -*-
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+
+"""
+这里定义的是一些常用常量
+"""
+
+
+
[docs]class ORDER_DIRECTION(): + """订单的买卖方向 + + BUY 股票 买入 + SELL 股票 卖出 + BUY_OPEN 期货 多开 + BUY_CLOSE 期货 空平(多头平旧仓) + SELL_OPEN 期货 空开 + SELL_CLOSE 期货 多平(空头平旧仓) + + + """ + + BUY = 1 + SELL = -1 + BUY_OPEN = 1 + BUY_CLOSE = 1 + SELL_OPEN = -1 + SELL_CLOSE = -1
+ + +
[docs]class ORDER_MODEL(): + """订单的成交模式 + + LIMIT 限价模式 + MARKET 市价单 # 目前市价单在回测中是bar的开盘价 /实盘里面是五档剩余最优成交价 + CLOSE 收盘单 # 及在bar的收盘时的价格 + NEXT_OPEN 下一个bar的开盘价成交 + STRICT 严格订单 不推荐/仅限回测/是在当前bar的最高价买入/当前bar的最低价卖出 + + @yutiansut/2017-12-18 + """ + + LIMIT = 'limit' # 限价 + MARKET = 'market' # 市价/在回测里是下个bar的开盘价买入/实盘就是五档剩余最优成交价 + CLOSE = 'close' # 当前bar的收盘价买入 + NEXT_OPEN = 'next_open' # 下个bar的开盘价买入 + STRICT = 'strict' # 严格模式/不推荐(仅限回测测试用)
+ + +
[docs]class ORDER_STATUS(): + """订单状态 + + status1xx 订单待生成 + status3xx 初始化订单 临时扣除资产(可用现金/可卖股份) + status3xx 订单存活(等待交易) + status2xx 订单完全交易/未完全交易 + status4xx 主动撤单 + status500 订单死亡(每日结算) 恢复临时资产 + + 200 委托成功,完全交易 + 203 委托成功,未完全成功 + 300 刚创建订单的时候 + 400 已撤单 + 500 服务器撤单/每日结算 + + 订单生成(100) -- 进入待成交队列(300) -- 完全成交(200) -- 每日结算(500)-- 死亡 + 订单生成(100) -- 进入待成交队列(300) -- 部分成交(203) -- 未成交(300) -- 每日结算(500) -- 死亡 + 订单生成(100) -- 进入待成交队列(300) -- 主动撤单(400) -- 每日结算(500) -- 死亡 + """ + + NEW = 100 + SUCCESS_ALL = 200 + SUCCESS_PART = 203 + QUEUED = 300 # queued 用于表示在order_queue中 实际表达的意思是订单存活 待成交 + CANCEL_ALL = 400 + SETTLED = 500
+ + +
[docs]class AMOUNT_MODEL(): + """订单的成交量 + + by_price是按固定成交总额下单,动态计算成交量 + by_amount 按固定成家量下单 + """ + + BY_PRICE = 'by_price' + BY_AMOUNT = 'by_amount'
+ + +
[docs]class RUNNING_ENVIRONMENT(): + """执行环境 + + 回测 + 模拟 + 实盘 + 随机(按算法/分布随机生成行情)/仅用于训练测试 + """ + + BACKETEST = 'backtest' + SIMULATION = 'simulation' + REAL = 'real' + RANODM = 'random'
+ + +
[docs]class TRADE_STATUS(): + """交易状态返回值 + + 涨跌停限制: 202 + 成功交易 : 200 + 当天无交易数据: 500 + 订单失败(比如买卖价格超过涨跌停价格范围,交易量过大等等):400 + """ + + SUCCESS = 200 + PRICE_LIMIT = 202 + NO_MARKET_DATA = 500 + FAILED = 400
+ + +
[docs]class MARKET_ERROR(): + ACCOUNT_EXIST = 'Account has already exist'
+ + +
[docs]class MARKET_TYPE(): + """市场种类 + + 日线 尾数01 + 分钟线 尾数02 + tick 尾数03 + + 市场: + 股票 0 + 指数/基金 1 + 期货 2 + 港股 3 + 美股 4 + 比特币/加密货币市场 5 + """ + STOCK_CN = 'stock_cn' # 中国A股 + STOCK_HK = 'stock_hk' # 港股 + STOCK_US = 'stock_us' # 美股 + FUTURE_CN = 'future_cn' # 国内期货 + OPTION_CN = 'option_cn' # 国内期权 + STOCKOPTION_CN = 'stockoption_cn' # 个股期权 + # BITCOIN = 'bitcoin' # 比特币 + CRYPTOCURRENCY = 'cryptocurrency' # 加密货币(衍生货币) + INDEX_CN = 'index_cn' # 中国指数 + FUND_CN = 'fund_cn' # 中国基金 + BOND_CN = 'bond_cn' # 中国债券
+ + +
[docs]class BROKER_TYPE(): + """执行环境 + + 回测 + 模拟 + 实盘 + 随机(按算法/分布随机生成行情)/仅用于训练测试 + """ + + BACKETEST = 'backtest' + SIMULATION = 'simulation' + REAL = 'real' + RANODM = 'random'
+ + +
[docs]class EVENT_TYPE(): + BROKER_EVENT = 'broker_event' + ACCOUNT_EVENT = 'account_event' + MARKET_EVENT = 'market_event' + TRADE_EVENT = 'trade_event' + ENGINE_EVENT = 'engine_event' + ORDER_EVENT = 'order_event'
+ + +
[docs]class MARKET_EVENT(): + """交易前置事件""" + QUERY_ORDER = 'query_order' + QUERY_ASSETS = 'query_assets' + QUERY_ACCOUNT = 'query_account' + QUERY_CASH = 'query_cash' + QUERY_DATA = 'query_data'
+ + +
[docs]class ENGINE_EVENT(): + """引擎事件""" + MARKET_INIT = 'market_init' + UPCOMING_DATA = 'upcoming_data' + BAR_SETTLE = 'bar_settle' + DAILY_SETTLE = 'daily_settle' + UPDATE = 'update'
+ + +
[docs]class ACCOUNT_EVENT(): + """账户事件""" + UPDATE = 'account_update' + SETTLE = 'account_settle' + MAKE_ORDER = 'account_make_order'
+ + +
[docs]class BROKER_EVENT(): + """BROKER事件 + BROKER + 有加载数据的任务 load data + 撮合成交的任务 broker_trade + + + """ + LOAD_DATA = 'load_data' + TRADE = 'broker_trade' + SETTLE = 'broker_settle' + DAILY_SETTLE = 'broker_dailysettle' + RECEIVE_ORDER = 'receive_order'
+ + +
[docs]class ORDER_EVENT(): + """订单事件 + + 创建订单 create + 交易 trade + 撤单 cancel + + """ + CREATE = 'create' + TRADE = 'trade' + CANCEL = 'cancel'
+ + +
[docs]class FREQUENCE(): + """查询的级别 + + [description] + """ + + YEAR = 'year' # 年bar + QUARTER = 'quarter' # 季度bar + MONTH = 'month' # 月bar + WEEK = 'week' # 周bar + DAY = 'day' # 日bar + ONE_MIN = '1min' # 1min bar + FIVE_MIN = '5min' # 5min bar + FIFTEEN_MIN = '15min' # 15min bar + THIRTY_MIN = '30min' # 30min bar + HOUR = '60min' # 60min bar + SIXTY_MIN = '60min' # 60min bar + CURRENT = 'current' # 当前bar + TICK = 'tick' # transaction
+ + +
[docs]class CURRENCY_TYPE(): + """货币种类""" + RMB = 'rmb' # 人民币 + USD = 'usd' # 美元 + EUR = 'eur' # 欧元 + HKD = 'hkd' # 港币 + GBP = 'GBP' # 英镑 + BTC = 'btc' # 比特币 + JPY = 'jpy' # 日元 + AUD = 'aud' # 澳元 + CAD = 'cad' # 加拿大元
+ + +
[docs]class DATASOURCE(): + """数据来源 + """ + + WIND = 'wind' # wind金融终端 + TDB = 'tdb' # wind tdb + THS = 'ths' # 同花顺网页 + TUSHARE = 'tushare' # tushare + TDX = 'tdx' # 通达信 + MONGO = 'mongo' # 本地/远程Mongodb + EASTMONEY = 'eastmoney' # 东方财富网 + CHOICE = 'choice' # choice金融终端 + CCXT = 'ccxt' # github/ccxt 虚拟货币 + LOCALFILE = 'localfile' # 本地文件
+ + +
[docs]class OUTPUT_FORMAT(): + """输出格式 + """ + + DATASTRUCT = 'datastruct' + DATAFRAME = 'dataframe' + SERIES = 'series' + NDARRAY = 'ndarray' + LIST = 'list' + JSON = 'json'
+ + +DATABASE_TABLE = { + (MARKET_TYPE.STOCK_CN, FREQUENCE.DAY): 'stock_day', + (MARKET_TYPE.STOCK_CN, FREQUENCE.ONE_MIN): 'stock_min', + (MARKET_TYPE.STOCK_CN, FREQUENCE.FIVE_MIN): 'stock_min', + (MARKET_TYPE.STOCK_CN, FREQUENCE.FIFTEEN_MIN): 'stock_min', + (MARKET_TYPE.STOCK_CN, FREQUENCE.THIRTY_MIN): 'stock_min', + (MARKET_TYPE.STOCK_CN, FREQUENCE.SIXTY_MIN): 'stock_min', + (MARKET_TYPE.STOCK_CN, FREQUENCE.HOUR): 'stock_min', + (MARKET_TYPE.STOCK_CN, FREQUENCE.TICK): 'stock_transaction', + (MARKET_TYPE.INDEX_CN, FREQUENCE.DAY): 'index_day', + (MARKET_TYPE.INDEX_CN, FREQUENCE.ONE_MIN): 'index_min', + (MARKET_TYPE.INDEX_CN, FREQUENCE.FIVE_MIN): 'index_min', + (MARKET_TYPE.INDEX_CN, FREQUENCE.FIFTEEN_MIN): 'index_min', + (MARKET_TYPE.INDEX_CN, FREQUENCE.THIRTY_MIN): 'index_min', + (MARKET_TYPE.INDEX_CN, FREQUENCE.SIXTY_MIN): 'index_min', + (MARKET_TYPE.INDEX_CN, FREQUENCE.HOUR): 'index_min', + (MARKET_TYPE.INDEX_CN, FREQUENCE.TICK): 'index_transaction', + (MARKET_TYPE.FUND_CN, FREQUENCE.DAY): 'index_day', + (MARKET_TYPE.FUND_CN, FREQUENCE.ONE_MIN): 'index_min', + (MARKET_TYPE.FUND_CN, FREQUENCE.FIVE_MIN): 'index_min', + (MARKET_TYPE.FUND_CN, FREQUENCE.FIFTEEN_MIN): 'index_min', + (MARKET_TYPE.FUND_CN, FREQUENCE.THIRTY_MIN): 'index_min', + (MARKET_TYPE.FUND_CN, FREQUENCE.SIXTY_MIN): 'index_min', + (MARKET_TYPE.FUND_CN, FREQUENCE.HOUR): 'index_min', + (MARKET_TYPE.FUND_CN, FREQUENCE.TICK): 'index_transaction', + (MARKET_TYPE.FUTURE_CN, FREQUENCE.DAY): 'future_day', + (MARKET_TYPE.FUTURE_CN, FREQUENCE.ONE_MIN): 'future_min', + (MARKET_TYPE.FUTURE_CN, FREQUENCE.FIVE_MIN): 'future_min', + (MARKET_TYPE.FUTURE_CN, FREQUENCE.FIFTEEN_MIN): 'future_min', + (MARKET_TYPE.FUTURE_CN, FREQUENCE.THIRTY_MIN): 'future_min', + (MARKET_TYPE.FUTURE_CN, FREQUENCE.SIXTY_MIN): 'future_min', + (MARKET_TYPE.FUTURE_CN, FREQUENCE.HOUR): 'future_min', + (MARKET_TYPE.FUTURE_CN, FREQUENCE.TICK): 'future_transaction' +} +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAUtil/QAPlot.html b/_build/html/_modules/QUANTAXIS/QAUtil/QAPlot.html new file mode 100644 index 000000000..eeb8a7855 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAUtil/QAPlot.html @@ -0,0 +1,170 @@ + + + + + + + + QUANTAXIS.QAUtil.QAPlot — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAUtil.QAPlot

+# coding=utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+import os
+import webbrowser
+
+from pyecharts import Kline
+
+from QUANTAXIS.QAUtil.QALogs import QA_util_log_info
+
+
+"""
+0.5.1预计新增内容:
+
+
+维护一个画图方法,之后可能会做成抽象基类
+
+
+主要是画DataStruct的k线图, DataStruct加指标的图,以及回测框架的回测结果的图
+"""
+
+
+
[docs]def plot_datastruct(_quotation_base, code=None): + if code is None: + path_name = '.' + os.sep + 'QA_' + _quotation_base.type + \ + '_codepackage_' + _quotation_base.if_fq + '.html' + kline = Kline('CodePackage_' + _quotation_base.if_fq + '_' + _quotation_base.type, + width=1360, height=700, page_title='QUANTAXIS') + + data_splits = _quotation_base.splits() + + for i_ in range(len(data_splits)): + data = [] + axis = [] + for dates, row in data_splits[i_].data.iterrows(): + open, high, low, close = row[1:5] + datas = [open, close, low, high] + axis.append(dates[0]) + data.append(datas) + + kline.add(_quotation_base.code[i_], axis, data, mark_point=[ + "max", "min"], is_datazoom_show=True, datazoom_orient='horizontal') + kline.render(path_name) + webbrowser.open(path_name) + QA_util_log_info('The Pic has been saved to your path: %s' % path_name) + else: + data = [] + axis = [] + for dates, row in _quotation_base.select_code(code).data.iterrows(): + open, high, low, close = row[1:5] + datas = [open, close, low, high] + axis.append(dates[0]) + data.append(datas) + + path_name = '.' + os.sep + 'QA_' + _quotation_base.type + \ + '_' + code + '_' + _quotation_base.if_fq + '.html' + kline = Kline(code + '__' + _quotation_base.if_fq + '__' + _quotation_base.type, + width=1360, height=700, page_title='QUANTAXIS') + kline.add(code, axis, data, mark_point=[ + "max", "min"], is_datazoom_show=True, datazoom_orient='horizontal') + kline.render(path_name) + webbrowser.open(path_name) + QA_util_log_info('The Pic has been saved to your path: %s' % path_name)
+ + +
[docs]def QA_plot_save_html(pic_handle, path, if_open_web): + pic_handle.render(path) + if if_open_web: + webbrowser.open(path) + else: + pass + QA_util_log_info('The Pic has been saved to your path: %s' % path)
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAUtil/QARandom.html b/_build/html/_modules/QUANTAXIS/QAUtil/QARandom.html new file mode 100644 index 000000000..99f094890 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAUtil/QARandom.html @@ -0,0 +1,121 @@ + + + + + + + + QUANTAXIS.QAUtil.QARandom — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAUtil.QARandom

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+import random
+
+
+
[docs]def QA_util_random_with_topic(topic='Acc', lens=8): + """ + 生成account随机值 + + Acc+4数字id+4位大小写随机 + + """ + _list = [chr(i) for i in range(65, 91)] + [chr(i) + for i in range(97, 123)] + [str(i) for i in range(10)] + + num = random.sample(_list, lens) + return '{}_{}'.format(topic, ''.join(num))
+ + +if __name__ == '__main__': + print(QA_util_random_with_topic(input())) +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAUtil/QASetting.html b/_build/html/_modules/QUANTAXIS/QAUtil/QASetting.html new file mode 100644 index 000000000..0cdebd46d --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAUtil/QASetting.html @@ -0,0 +1,159 @@ + + + + + + + + QUANTAXIS.QAUtil.QASetting — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAUtil.QASetting

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+
+from QUANTAXIS.QASU.user import QA_user_sign_in
+from QUANTAXIS.QAUtil.QASql import QA_util_sql_mongo_setting
+
+
+
[docs]class QA_Setting(): + def __init__(self, ip='127.0.0.1', port=27017): + self.ip = ip + self.port = port + self.username = None + self.password = None + + @property + def client(self): + return QA_util_sql_mongo_setting(self.ip, self.port) + +
[docs] def change(self, ip, port): + self.ip = ip + self.port = port + global DATABASE + DATABASE = self.client.quantaxis + return self
+ +
[docs] def login(self, user_name, password): + user = QA_user_sign_in(user_name, password, self.client) + if user is not None: + self.user_name = user_name + self.password = password + self.user = user + return self.user + else: + return False
+ + +DATABASE = QA_Setting().client.quantaxis + + +info_ip_list = [{'ip': '101.227.73.20', 'port': 7709}, {'ip': '101.227.77.254', 'port': 7709}, {'ip': '114.80.63.12', 'port': 7709}, {'ip': '114.80.63.35', 'port': 7709}, {'ip': '115.238.56.198', 'port': 7709}, {'ip': '115.238.90.165', 'port': 7709}, {'ip': '124.160.88.183', 'port': 7709}, {'ip': '60.28.23.80', 'port': 7709}, {'ip': '14.215.128.18', 'port': 7709}, {'ip': '180.153.18.170', 'port': 7709}, { + 'ip': '180.153.18.171', 'port': 7709}, {'ip': '180.153.39.51', 'port': 7709}, {'ip': '202.108.253.130', 'port': 7709}, {'ip': '202.108.253.131', 'port': 7709}, {'ip': '218.108.47.69', 'port': 7709}, {'ip': '218.108.98.244', 'port': 7709}, {'ip': '218.75.126.9', 'port': 7709}, {'ip': '221.231.141.60', 'port': 7709}, {'ip': '59.173.18.140', 'port': 7709}, {'ip': '60.12.136.250', 'port': 7709}] + + +stock_ip_list = [{'ip': '218.75.126.9', 'port': 7709}, {'ip': '115.238.90.165', 'port': 7709}, {'ip': '124.160.88.183', 'port': 7709}, {'ip': '60.12.136.250', 'port': 7709}, {'ip': '218.108.98.244', 'port': 7709}, {'ip': '218.108.47.69', 'port': 7709}, {'ip': '180.153.39.51', 'port': 7709}, {'ip': '121.14.2.7', 'port': 7709}, {'ip': '60.28.29.69', 'port': 7709}, {'ip': '180.153.18.170', 'port': 7709}, {'ip': '180.153.18.171', 'port': 7709}, {'ip': '180.153.18.17', 'port': 7709}, { + 'ip': '61.135.142.73', 'port': 7709}, {'ip': '115.238.56.198', 'port': 7709}, {'ip': '60.191.117.167', 'port': 7709}, {'ip': 'hq.cjis.cn', 'port': 7709}, {'ip': '59.173.18.69', 'port': 7709}, {'ip': 'sztdx.gtjas.com', 'port': 7709}, {'ip': 'jstdx.gtjas.com', 'port': 7709}, {'ip': 'shtdx.gtjas.com', 'port': 7709}, {'ip': '218.9.148.108', 'port': 7709}, {'ip': '61.153.144.179', 'port': 7709}, {'ip': '61.153.209.138', 'port': 7709}, {'ip': '61.153.209.139', 'port': 7709}, {'ip': 'hq1.daton.com.cn', 'port': 7709}] + +future_ip_list = [{'ip': '112.74.214.43', 'port': 7727}, + {'ip': '59.175.238.38', 'port': 7727}, + {'ip': '124.74.236.94', 'port': 7721}, + {'ip': '218.80.248.229', 'port': 7721}, + {'ip': '124.74.236.94', 'port': 7721}, + {'ip': '58.246.109.27', 'port': 7721} + ] + + +""" +['121.14.110.210', '119.147.212.76', '113.105.73.86', '119.147.171.211', '119.147.164.57', '119.147.164.58', '61.49.50.180', '61.49.50.181', +'61.135.142.85', '61.135.149.181', '114.80.80.210', '222.73.49.15', '221.194.181.176'] +""" +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAUtil/QASql.html b/_build/html/_modules/QUANTAXIS/QAUtil/QASql.html new file mode 100644 index 000000000..68cd27795 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAUtil/QASql.html @@ -0,0 +1,129 @@ + + + + + + + + QUANTAXIS.QAUtil.QASql — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAUtil.QASql

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+import pymongo
+from motor.motor_asyncio import AsyncIOMotorClient
+
+from QUANTAXIS.QAUtil.QALogs import QA_util_log_info
+
+
+
[docs]def QA_util_sql_mongo_setting(ip='127.0.0.1', port=27017): + client = pymongo.MongoClient(ip, int(port)) + #QA_util_log_info('ip:{},port:{}'.format(str(ip), str(port))) + return client
+ +# async + + +
[docs]def QA_util_sql_async_mongo_setting(ip='127.0.0.1', port=27017): + client = AsyncIOMotorClient(ip, int(port)) + QA_util_log_info('ip:{},port{}'.format(str(ip), str(port))) + return client
+ + +QA_util_sql_mongo_sort_ASCENDING = pymongo.ASCENDING +QA_util_sql_mongo_sort_DESCENDING = pymongo.DESCENDING + +if __name__ == '__main__': + # test async_mongo + client = QA_util_sql_async_mongo_setting().quantaxis.stock_day + print(client) +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAUtil/QAText.html b/_build/html/_modules/QUANTAXIS/QAUtil/QAText.html new file mode 100644 index 000000000..7accaa118 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAUtil/QAText.html @@ -0,0 +1,124 @@ + + + + + + + + QUANTAXIS.QAUtil.QAText — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAUtil.QAText

+# coding=utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+"""
+这里主要是一些关于文本的代码
+
+文本分词
+模糊查询
+正则匹配
+"""
+
+import jieba
+import re
+import fuzzyfinder
+
+# TODO: stock_list中有股票的中文/stock_block中有版块的中文 需要将他们做一些模糊查询
+
+
+
+
[docs]def split_word(input_text,cutall=False): + """ + 使用jieba分词 将输入的语句分词 + """ + + return jieba.cut(input_text,cut_all=cutall)
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAUtil/QATransform.html b/_build/html/_modules/QUANTAXIS/QAUtil/QATransform.html new file mode 100644 index 000000000..b91b153ee --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAUtil/QATransform.html @@ -0,0 +1,145 @@ + + + + + + + + QUANTAXIS.QAUtil.QATransform — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAUtil.QATransform

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+import csv
+import json
+
+import numpy as np
+import pandas as pd
+
+
+
[docs]def QA_util_to_json_from_pandas(data): + """需要对于datetime 和date 进行转换, 以免直接被变成了时间戳""" + if 'datetime' in data.columns: + data.datetime = data.datetime.apply(str) + if 'date' in data.columns: + data.date = data.date.apply(str) + return json.loads(data.to_json(orient='records'))
+ + +
[docs]def QA_util_to_json_from_numpy(data): + pass
+ + +
[docs]def QA_util_to_json_from_list(data): + pass
+ + +
[docs]def QA_util_to_list_from_pandas(data): + return np.asarray(data).tolist()
+ + +
[docs]def QA_util_to_list_from_numpy(data): + return data.tolist()
+ + +
[docs]def QA_util_to_pandas_from_json(data): + + if isinstance(data, dict): + return pd.DataFrame(data=[data, ]) + else: + return pd.DataFrame(data=[{'value': data}])
+ + +
[docs]def QA_util_to_pandas_from_list(data): + if isinstance(data, list): + return pd.DataFrame(data=data)
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAUtil/QAWeb.html b/_build/html/_modules/QUANTAXIS/QAUtil/QAWeb.html new file mode 100644 index 000000000..192246807 --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAUtil/QAWeb.html @@ -0,0 +1,142 @@ + + + + + + + + QUANTAXIS.QAUtil.QAWeb — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAUtil.QAWeb

+# coding:utf-8
+#
+# The MIT License (MIT)
+#
+# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+import datetime
+from subprocess import PIPE, Popen
+
+
+
[docs]def QA_util_web_ping(url): + ms_list = [] + p = Popen(["ping", url], + stdin=PIPE, stdout=PIPE, stderr=PIPE, + shell=True) + out = p.stdout.read() + list_ = str(out).split('=') + # print(list) + for item in list_: + if 'ms' in item: + ms_list.append(int(item.split('ms')[0])) + + if len(ms_list) < 1: + # Bad Request: + ms_list.append(9999999) + return ms_list[-1]
+ + +
[docs]class QA_Util_web_pool(): + def __init__(self): + pass + +
[docs] def hot_update(self): + pass
+ +
[docs] def dynamic_optimics(self): + pass
+ +
[docs] def task_queue(self): + pass
+ + +if __name__ == "__main__": + print(datetime.datetime.now()) + print(QA_util_web_ping('www.baidu.com')) + print(datetime.datetime.now()) +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/QUANTAXIS/QAWeb/chain.html b/_build/html/_modules/QUANTAXIS/QAWeb/chain.html new file mode 100644 index 000000000..5665fe56a --- /dev/null +++ b/_build/html/_modules/QUANTAXIS/QAWeb/chain.html @@ -0,0 +1,358 @@ + + + + + + + + QUANTAXIS.QAWeb.chain — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for QUANTAXIS.QAWeb.chain

+import hashlib
+import json
+from time import time
+from typing import Any, Dict, List, Optional
+from urllib.parse import urlparse
+from uuid import uuid4
+
+import requests
+from flask import Flask, jsonify, request
+
+#from https://github.com/xilibi2003/blockchain/blob/master/blockchain.py
+
+
+
[docs]class Blockchain: + def __init__(self): + self.current_transactions = [] + self.chain = [] + self.nodes = set() + + # 创建创世块 + self.new_block(previous_hash='1', proof=100) + +
[docs] def register_node(self, address: str) -> None: + """ + Add a new node to the list of nodes + :param address: Address of node. Eg. 'http://192.168.0.5:5000' + """ + + parsed_url = urlparse(address) + self.nodes.add(parsed_url.netloc)
+ +
[docs] def valid_chain(self, chain: List[Dict[str, Any]]) -> bool: + """ + Determine if a given blockchain is valid + :param chain: A blockchain + :return: True if valid, False if not + """ + + last_block = chain[0] + current_index = 1 + + while current_index < len(chain): + block = chain[current_index] + print(f'{last_block}') + print(f'{block}') + print("\n-----------\n") + # Check that the hash of the block is correct + if block['previous_hash'] != self.hash(last_block): + return False + + # Check that the Proof of Work is correct + if not self.valid_proof(last_block['proof'], block['proof']): + return False + + last_block = block + current_index += 1 + + return True
+ +
[docs] def resolve_conflicts(self) -> bool: + """ + 共识算法解决冲突 + 使用网络中最长的链. + :return: 如果链被取代返回 True, 否则为False + """ + + neighbours = self.nodes + new_chain = None + + # We're only looking for chains longer than ours + max_length = len(self.chain) + + # Grab and verify the chains from all the nodes in our network + for node in neighbours: + response = requests.get(f'http://{node}/chain') + + if response.status_code == 200: + length = response.json()['length'] + chain = response.json()['chain'] + + # Check if the length is longer and the chain is valid + if length > max_length and self.valid_chain(chain): + max_length = length + new_chain = chain + + # Replace our chain if we discovered a new, valid chain longer than ours + if new_chain: + self.chain = new_chain + return True + + return False
+ +
[docs] def new_block(self, proof: int, previous_hash: Optional[str]) -> Dict[str, Any]: + """ + 生成新块 + :param proof: The proof given by the Proof of Work algorithm + :param previous_hash: Hash of previous Block + :return: New Block + """ + + block = { + 'index': len(self.chain) + 1, + 'timestamp': time(), + 'transactions': self.current_transactions, + 'proof': proof, + 'previous_hash': previous_hash or self.hash(self.chain[-1]), + } + + # Reset the current list of transactions + self.current_transactions = [] + + self.chain.append(block) + return block
+ +
[docs] def new_transaction(self, sender: str, recipient: str, amount: int) -> int: + """ + 生成新交易信息,信息将加入到下一个待挖的区块中 + :param sender: Address of the Sender + :param recipient: Address of the Recipient + :param amount: Amount + :return: The index of the Block that will hold this transaction + """ + self.current_transactions.append({ + 'sender': sender, + 'recipient': recipient, + 'amount': amount, + }) + + return self.last_block['index'] + 1
+ + @property + def last_block(self) -> Dict[str, Any]: + return self.chain[-1] + +
[docs] @staticmethod + def hash(block: Dict[str, Any]) -> str: + """ + 生成块的 SHA-256 hash值 + :param block: Block + """ + + # We must make sure that the Dictionary is Ordered, or we'll have inconsistent hashes + block_string = json.dumps(block, sort_keys=True).encode() + return hashlib.sha256(block_string).hexdigest()
+ +
[docs] def proof_of_work(self, last_proof: int) -> int: + """ + 简单的工作量证明: + - 查找一个 p' 使得 hash(pp') 以4个0开头 + - p 是上一个块的证明, p' 是当前的证明 + """ + + proof = 0 + while self.valid_proof(last_proof, proof) is False: + proof += 1 + + return proof
+ +
[docs] @staticmethod + def valid_proof(last_proof: int, proof: int) -> bool: + """ + 验证证明: 是否hash(last_proof, proof)以4个0开头 + :param last_proof: Previous Proof + :param proof: Current Proof + :return: True if correct, False if not. + """ + + guess = f'{last_proof}{proof}'.encode() + guess_hash = hashlib.sha256(guess).hexdigest() + return guess_hash[:4] == "0000"
+ + +# Instantiate the Node +app = Flask(__name__) + +# Generate a globally unique address for this node +node_identifier = str(uuid4()).replace('-', '') + +# Instantiate the Blockchain +blockchain = Blockchain() + + +
[docs]@app.route('/mine', methods=['GET']) +def mine(): + # We run the proof of work algorithm to get the next proof... + last_block = blockchain.last_block + last_proof = last_block['proof'] + proof = blockchain.proof_of_work(last_proof) + + # 给工作量证明的节点提供奖励. + # 发送者为 "0" 表明是新挖出的币 + blockchain.new_transaction( + sender="0", + recipient=node_identifier, + amount=1, + ) + + # Forge the new Block by adding it to the chain + block = blockchain.new_block(proof, None) + + response = { + 'message': "New Block Forged", + 'index': block['index'], + 'transactions': block['transactions'], + 'proof': block['proof'], + 'previous_hash': block['previous_hash'], + } + return jsonify(response), 200
+ + +
[docs]@app.route('/transactions/new', methods=['POST']) +def new_transaction(): + values = request.get_json() + + # 检查POST数据 + required = ['sender', 'recipient', 'amount'] + if not all(k in values for k in required): + return 'Missing values', 400 + + # Create a new Transaction + index = blockchain.new_transaction(values['sender'], values['recipient'], values['amount']) + + response = {'message': f'Transaction will be added to Block {index}'} + return jsonify(response), 201
+ + +
[docs]@app.route('/chain', methods=['GET']) +def full_chain(): + response = { + 'chain': blockchain.chain, + 'length': len(blockchain.chain), + } + return jsonify(response), 200
+ + +
[docs]@app.route('/nodes/register', methods=['POST']) +def register_nodes(): + values = request.get_json() + + nodes = values.get('nodes') + if nodes is None: + return "Error: Please supply a valid list of nodes", 400 + + for node in nodes: + blockchain.register_node(node) + + response = { + 'message': 'New nodes have been added', + 'total_nodes': list(blockchain.nodes), + } + return jsonify(response), 201
+ + +
[docs]@app.route('/nodes/resolve', methods=['GET']) +def consensus(): + replaced = blockchain.resolve_conflicts() + + if replaced: + response = { + 'message': 'Our chain was replaced', + 'new_chain': blockchain.chain + } + else: + response = { + 'message': 'Our chain is authoritative', + 'chain': blockchain.chain + } + + return jsonify(response), 200
+ + +if __name__ == '__main__': + from argparse import ArgumentParser + + parser = ArgumentParser() + parser.add_argument('-p', '--port', default=5000, type=int, help='port to listen on') + args = parser.parse_args() + port = args.port + + app.run(host='127.0.0.1', port=port) +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/index.html b/_build/html/_modules/index.html new file mode 100644 index 000000000..f3224bdf8 --- /dev/null +++ b/_build/html/_modules/index.html @@ -0,0 +1,158 @@ + + + + + + + + Overview: module code — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

All modules for which code is available

+ + +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_modules/sqlalchemy/orm/attributes.html b/_build/html/_modules/sqlalchemy/orm/attributes.html new file mode 100644 index 000000000..a04f3cb0d --- /dev/null +++ b/_build/html/_modules/sqlalchemy/orm/attributes.html @@ -0,0 +1,1774 @@ + + + + + + + + sqlalchemy.orm.attributes — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for sqlalchemy.orm.attributes

+# orm/attributes.py
+# Copyright (C) 2005-2018 the SQLAlchemy authors and contributors
+# <see AUTHORS file>
+#
+# This module is part of SQLAlchemy and is released under
+# the MIT License: http://www.opensource.org/licenses/mit-license.php
+
+"""Defines instrumentation for class attributes and their interaction
+with instances.
+
+This module is usually not directly visible to user applications, but
+defines a large part of the ORM's interactivity.
+
+
+"""
+
+import operator
+from .. import util, event, inspection
+from . import interfaces, collections, exc as orm_exc
+
+from .base import instance_state, instance_dict, manager_of_class
+
+from .base import PASSIVE_NO_RESULT, ATTR_WAS_SET, ATTR_EMPTY, NO_VALUE,\
+    NEVER_SET, NO_CHANGE, CALLABLES_OK, SQL_OK, RELATED_OBJECT_OK,\
+    INIT_OK, NON_PERSISTENT_OK, LOAD_AGAINST_COMMITTED, PASSIVE_OFF,\
+    PASSIVE_RETURN_NEVER_SET, PASSIVE_NO_INITIALIZE, PASSIVE_NO_FETCH,\
+    PASSIVE_NO_FETCH_RELATED, PASSIVE_ONLY_PERSISTENT, NO_AUTOFLUSH
+from .base import state_str, instance_str
+
+
+@inspection._self_inspects
+class QueryableAttribute(interfaces._MappedAttribute,
+                         interfaces.InspectionAttr,
+                         interfaces.PropComparator):
+    """Base class for :term:`descriptor` objects that intercept
+    attribute events on behalf of a :class:`.MapperProperty`
+    object.  The actual :class:`.MapperProperty` is accessible
+    via the :attr:`.QueryableAttribute.property`
+    attribute.
+
+
+    .. seealso::
+
+        :class:`.InstrumentedAttribute`
+
+        :class:`.MapperProperty`
+
+        :attr:`.Mapper.all_orm_descriptors`
+
+        :attr:`.Mapper.attrs`
+    """
+
+    is_attribute = True
+
+    def __init__(self, class_, key, impl=None,
+                 comparator=None, parententity=None,
+                 of_type=None):
+        self.class_ = class_
+        self.key = key
+        self.impl = impl
+        self.comparator = comparator
+        self._parententity = parententity
+        self._of_type = of_type
+
+        manager = manager_of_class(class_)
+        # manager is None in the case of AliasedClass
+        if manager:
+            # propagate existing event listeners from
+            # immediate superclass
+            for base in manager._bases:
+                if key in base:
+                    self.dispatch._update(base[key].dispatch)
+
+    @util.memoized_property
+    def _supports_population(self):
+        return self.impl.supports_population
+
+    def get_history(self, instance, passive=PASSIVE_OFF):
+        return self.impl.get_history(instance_state(instance),
+                                     instance_dict(instance), passive)
+
+    def __selectable__(self):
+        # TODO: conditionally attach this method based on clause_element ?
+        return self
+
+    @util.memoized_property
+    def info(self):
+        """Return the 'info' dictionary for the underlying SQL element.
+
+        The behavior here is as follows:
+
+        * If the attribute is a column-mapped property, i.e.
+          :class:`.ColumnProperty`, which is mapped directly
+          to a schema-level :class:`.Column` object, this attribute
+          will return the :attr:`.SchemaItem.info` dictionary associated
+          with the core-level :class:`.Column` object.
+
+        * If the attribute is a :class:`.ColumnProperty` but is mapped to
+          any other kind of SQL expression other than a :class:`.Column`,
+          the attribute will refer to the :attr:`.MapperProperty.info`
+          dictionary associated directly with the :class:`.ColumnProperty`,
+          assuming the SQL expression itself does not have its own ``.info``
+          attribute (which should be the case, unless a user-defined SQL
+          construct has defined one).
+
+        * If the attribute refers to any other kind of
+          :class:`.MapperProperty`, including :class:`.RelationshipProperty`,
+          the attribute will refer to the :attr:`.MapperProperty.info`
+          dictionary associated with that :class:`.MapperProperty`.
+
+        * To access the :attr:`.MapperProperty.info` dictionary of the
+          :class:`.MapperProperty` unconditionally, including for a
+          :class:`.ColumnProperty` that's associated directly with a
+          :class:`.schema.Column`, the attribute can be referred to using
+          :attr:`.QueryableAttribute.property` attribute, as
+          ``MyClass.someattribute.property.info``.
+
+        .. versionadded:: 0.8.0
+
+        .. seealso::
+
+            :attr:`.SchemaItem.info`
+
+            :attr:`.MapperProperty.info`
+
+        """
+        return self.comparator.info
+
+    @util.memoized_property
+    def parent(self):
+        """Return an inspection instance representing the parent.
+
+        This will be either an instance of :class:`.Mapper`
+        or :class:`.AliasedInsp`, depending upon the nature
+        of the parent entity which this attribute is associated
+        with.
+
+        """
+        return inspection.inspect(self._parententity)
+
+    @property
+    def expression(self):
+        return self.comparator.__clause_element__()
+
+    def __clause_element__(self):
+        return self.comparator.__clause_element__()
+
+    def _query_clause_element(self):
+        """like __clause_element__(), but called specifically
+        by :class:`.Query` to allow special behavior."""
+
+        return self.comparator._query_clause_element()
+
+    def _bulk_update_tuples(self, value):
+        """Return setter tuples for a bulk UPDATE."""
+
+        return self.comparator._bulk_update_tuples(value)
+
+    def adapt_to_entity(self, adapt_to_entity):
+        assert not self._of_type
+        return self.__class__(adapt_to_entity.entity,
+                              self.key, impl=self.impl,
+                              comparator=self.comparator.adapt_to_entity(
+                                  adapt_to_entity),
+                              parententity=adapt_to_entity)
+
+    def of_type(self, cls):
+        return QueryableAttribute(
+            self.class_,
+            self.key,
+            self.impl,
+            self.comparator.of_type(cls),
+            self._parententity,
+            of_type=cls)
+
+    def label(self, name):
+        return self._query_clause_element().label(name)
+
+    def operate(self, op, *other, **kwargs):
+        return op(self.comparator, *other, **kwargs)
+
+    def reverse_operate(self, op, other, **kwargs):
+        return op(other, self.comparator, **kwargs)
+
+    def hasparent(self, state, optimistic=False):
+        return self.impl.hasparent(state, optimistic=optimistic) is not False
+
+    def __getattr__(self, key):
+        try:
+            return getattr(self.comparator, key)
+        except AttributeError:
+            raise AttributeError(
+                'Neither %r object nor %r object associated with %s '
+                'has an attribute %r' % (
+                    type(self).__name__,
+                    type(self.comparator).__name__,
+                    self,
+                    key)
+            )
+
+    def __str__(self):
+        return "%s.%s" % (self.class_.__name__, self.key)
+
+    @util.memoized_property
+    def property(self):
+        """Return the :class:`.MapperProperty` associated with this
+        :class:`.QueryableAttribute`.
+
+
+        Return values here will commonly be instances of
+        :class:`.ColumnProperty` or :class:`.RelationshipProperty`.
+
+
+        """
+        return self.comparator.property
+
+
+class InstrumentedAttribute(QueryableAttribute):
+    """Class bound instrumented attribute which adds basic
+    :term:`descriptor` methods.
+
+    See :class:`.QueryableAttribute` for a description of most features.
+
+
+    """
+
+    def __set__(self, instance, value):
+        self.impl.set(instance_state(instance),
+                      instance_dict(instance), value, None)
+
+    def __delete__(self, instance):
+        self.impl.delete(instance_state(instance), instance_dict(instance))
+
+    def __get__(self, instance, owner):
+        if instance is None:
+            return self
+
+        dict_ = instance_dict(instance)
+        if self._supports_population and self.key in dict_:
+            return dict_[self.key]
+        else:
+            return self.impl.get(instance_state(instance), dict_)
+
+
+def create_proxied_attribute(descriptor):
+    """Create an QueryableAttribute / user descriptor hybrid.
+
+    Returns a new QueryableAttribute type that delegates descriptor
+    behavior and getattr() to the given descriptor.
+    """
+
+    # TODO: can move this to descriptor_props if the need for this
+    # function is removed from ext/hybrid.py
+
+    class Proxy(QueryableAttribute):
+        """Presents the :class:`.QueryableAttribute` interface as a
+        proxy on top of a Python descriptor / :class:`.PropComparator`
+        combination.
+
+        """
+
+        def __init__(self, class_, key, descriptor,
+                     comparator,
+                     adapt_to_entity=None, doc=None,
+                     original_property=None):
+            self.class_ = class_
+            self.key = key
+            self.descriptor = descriptor
+            self.original_property = original_property
+            self._comparator = comparator
+            self._adapt_to_entity = adapt_to_entity
+            self.__doc__ = doc
+
+        @property
+        def property(self):
+            return self.comparator.property
+
+        @util.memoized_property
+        def comparator(self):
+            if util.callable(self._comparator):
+                self._comparator = self._comparator()
+            if self._adapt_to_entity:
+                self._comparator = self._comparator.adapt_to_entity(
+                    self._adapt_to_entity)
+            return self._comparator
+
+        def adapt_to_entity(self, adapt_to_entity):
+            return self.__class__(adapt_to_entity.entity,
+                                  self.key,
+                                  self.descriptor,
+                                  self._comparator,
+                                  adapt_to_entity)
+
+        def __get__(self, instance, owner):
+            if instance is None:
+                return self
+            else:
+                return self.descriptor.__get__(instance, owner)
+
+        def __str__(self):
+            return "%s.%s" % (self.class_.__name__, self.key)
+
+        def __getattr__(self, attribute):
+            """Delegate __getattr__ to the original descriptor and/or
+            comparator."""
+
+            try:
+                return getattr(descriptor, attribute)
+            except AttributeError:
+                try:
+                    return getattr(self.comparator, attribute)
+                except AttributeError:
+                    raise AttributeError(
+                        'Neither %r object nor %r object associated with %s '
+                        'has an attribute %r' % (
+                            type(descriptor).__name__,
+                            type(self.comparator).__name__,
+                            self,
+                            attribute)
+                    )
+
+    Proxy.__name__ = type(descriptor).__name__ + 'Proxy'
+
+    util.monkeypatch_proxied_specials(Proxy, type(descriptor),
+                                      name='descriptor',
+                                      from_instance=descriptor)
+    return Proxy
+
+OP_REMOVE = util.symbol("REMOVE")
+OP_APPEND = util.symbol("APPEND")
+OP_REPLACE = util.symbol("REPLACE")
+OP_BULK_REPLACE = util.symbol("BULK_REPLACE")
+OP_MODIFIED = util.symbol("MODIFIED")
+
+
+class Event(object):
+    """A token propagated throughout the course of a chain of attribute
+    events.
+
+    Serves as an indicator of the source of the event and also provides
+    a means of controlling propagation across a chain of attribute
+    operations.
+
+    The :class:`.Event` object is sent as the ``initiator`` argument
+    when dealing with events such as :meth:`.AttributeEvents.append`,
+    :meth:`.AttributeEvents.set`,
+    and :meth:`.AttributeEvents.remove`.
+
+    The :class:`.Event` object is currently interpreted by the backref
+    event handlers, and is used to control the propagation of operations
+    across two mutually-dependent attributes.
+
+    .. versionadded:: 0.9.0
+
+    :var impl: The :class:`.AttributeImpl` which is the current event
+     initiator.
+
+    :var op: The symbol :attr:`.OP_APPEND`, :attr:`.OP_REMOVE`,
+     :attr:`.OP_REPLACE`, or :attr:`.OP_BULK_REPLACE`, indicating the
+     source operation.
+
+    """
+
+    __slots__ = 'impl', 'op', 'parent_token'
+
+    def __init__(self, attribute_impl, op):
+        self.impl = attribute_impl
+        self.op = op
+        self.parent_token = self.impl.parent_token
+
+    def __eq__(self, other):
+        return isinstance(other, Event) and \
+            other.impl is self.impl and \
+            other.op == self.op
+
+    @property
+    def key(self):
+        return self.impl.key
+
+    def hasparent(self, state):
+        return self.impl.hasparent(state)
+
+
+class AttributeImpl(object):
+    """internal implementation for instrumented attributes."""
+
+    def __init__(self, class_, key,
+                 callable_, dispatch, trackparent=False, extension=None,
+                 compare_function=None, active_history=False,
+                 parent_token=None, expire_missing=True,
+                 send_modified_events=True, accepts_scalar_loader=None,
+                 **kwargs):
+        r"""Construct an AttributeImpl.
+
+        \class_
+          associated class
+
+        key
+          string name of the attribute
+
+        \callable_
+          optional function which generates a callable based on a parent
+          instance, which produces the "default" values for a scalar or
+          collection attribute when it's first accessed, if not present
+          already.
+
+        trackparent
+          if True, attempt to track if an instance has a parent attached
+          to it via this attribute.
+
+        extension
+          a single or list of AttributeExtension object(s) which will
+          receive set/delete/append/remove/etc. events.  Deprecated.
+          The event package is now used.
+
+        compare_function
+          a function that compares two values which are normally
+          assignable to this attribute.
+
+        active_history
+          indicates that get_history() should always return the "old" value,
+          even if it means executing a lazy callable upon attribute change.
+
+        parent_token
+          Usually references the MapperProperty, used as a key for
+          the hasparent() function to identify an "owning" attribute.
+          Allows multiple AttributeImpls to all match a single
+          owner attribute.
+
+        expire_missing
+          if False, don't add an "expiry" callable to this attribute
+          during state.expire_attributes(None), if no value is present
+          for this key.
+
+        send_modified_events
+          if False, the InstanceState._modified_event method will have no
+          effect; this means the attribute will never show up as changed in a
+          history entry.
+        """
+        self.class_ = class_
+        self.key = key
+        self.callable_ = callable_
+        self.dispatch = dispatch
+        self.trackparent = trackparent
+        self.parent_token = parent_token or self
+        self.send_modified_events = send_modified_events
+        if compare_function is None:
+            self.is_equal = operator.eq
+        else:
+            self.is_equal = compare_function
+
+        if accepts_scalar_loader is not None:
+            self.accepts_scalar_loader = accepts_scalar_loader
+        else:
+            self.accepts_scalar_loader = self.default_accepts_scalar_loader
+
+        # TODO: pass in the manager here
+        # instead of doing a lookup
+        attr = manager_of_class(class_)[key]
+
+        for ext in util.to_list(extension or []):
+            ext._adapt_listener(attr, ext)
+
+        if active_history:
+            self.dispatch._active_history = True
+
+        self.expire_missing = expire_missing
+        self._modified_token = Event(self, OP_MODIFIED)
+
+    __slots__ = (
+        'class_', 'key', 'callable_', 'dispatch', 'trackparent',
+        'parent_token', 'send_modified_events', 'is_equal', 'expire_missing',
+        '_modified_token', 'accepts_scalar_loader'
+    )
+
+    def __str__(self):
+        return "%s.%s" % (self.class_.__name__, self.key)
+
+    def _get_active_history(self):
+        """Backwards compat for impl.active_history"""
+
+        return self.dispatch._active_history
+
+    def _set_active_history(self, value):
+        self.dispatch._active_history = value
+
+    active_history = property(_get_active_history, _set_active_history)
+
+    def hasparent(self, state, optimistic=False):
+        """Return the boolean value of a `hasparent` flag attached to
+        the given state.
+
+        The `optimistic` flag determines what the default return value
+        should be if no `hasparent` flag can be located.
+
+        As this function is used to determine if an instance is an
+        *orphan*, instances that were loaded from storage should be
+        assumed to not be orphans, until a True/False value for this
+        flag is set.
+
+        An instance attribute that is loaded by a callable function
+        will also not have a `hasparent` flag.
+
+        """
+        msg = "This AttributeImpl is not configured to track parents."
+        assert self.trackparent, msg
+
+        return state.parents.get(id(self.parent_token), optimistic) \
+            is not False
+
+    def sethasparent(self, state, parent_state, value):
+        """Set a boolean flag on the given item corresponding to
+        whether or not it is attached to a parent object via the
+        attribute represented by this ``InstrumentedAttribute``.
+
+        """
+        msg = "This AttributeImpl is not configured to track parents."
+        assert self.trackparent, msg
+
+        id_ = id(self.parent_token)
+        if value:
+            state.parents[id_] = parent_state
+        else:
+            if id_ in state.parents:
+                last_parent = state.parents[id_]
+
+                if last_parent is not False and \
+                        last_parent.key != parent_state.key:
+
+                    if last_parent.obj() is None:
+                        raise orm_exc.StaleDataError(
+                            "Removing state %s from parent "
+                            "state %s along attribute '%s', "
+                            "but the parent record "
+                            "has gone stale, can't be sure this "
+                            "is the most recent parent." %
+                            (state_str(state),
+                             state_str(parent_state),
+                             self.key))
+
+                    return
+
+            state.parents[id_] = False
+
+    def get_history(self, state, dict_, passive=PASSIVE_OFF):
+        raise NotImplementedError()
+
+    def get_all_pending(self, state, dict_, passive=PASSIVE_NO_INITIALIZE):
+        """Return a list of tuples of (state, obj)
+        for all objects in this attribute's current state
+        + history.
+
+        Only applies to object-based attributes.
+
+        This is an inlining of existing functionality
+        which roughly corresponds to:
+
+            get_state_history(
+                        state,
+                        key,
+                        passive=PASSIVE_NO_INITIALIZE).sum()
+
+        """
+        raise NotImplementedError()
+
+    def initialize(self, state, dict_):
+        """Initialize the given state's attribute with an empty value."""
+
+        value = None
+        for fn in self.dispatch.init_scalar:
+            ret = fn(state, value, dict_)
+            if ret is not ATTR_EMPTY:
+                value = ret
+
+        return value
+
+    def get(self, state, dict_, passive=PASSIVE_OFF):
+        """Retrieve a value from the given object.
+        If a callable is assembled on this object's attribute, and
+        passive is False, the callable will be executed and the
+        resulting value will be set as the new value for this attribute.
+        """
+        if self.key in dict_:
+            return dict_[self.key]
+        else:
+            # if history present, don't load
+            key = self.key
+            if key not in state.committed_state or \
+                    state.committed_state[key] is NEVER_SET:
+                if not passive & CALLABLES_OK:
+                    return PASSIVE_NO_RESULT
+
+                if key in state.expired_attributes:
+                    value = state._load_expired(state, passive)
+                elif key in state.callables:
+                    callable_ = state.callables[key]
+                    value = callable_(state, passive)
+                elif self.callable_:
+                    value = self.callable_(state, passive)
+                else:
+                    value = ATTR_EMPTY
+
+                if value is PASSIVE_NO_RESULT or value is NEVER_SET:
+                    return value
+                elif value is ATTR_WAS_SET:
+                    try:
+                        return dict_[key]
+                    except KeyError:
+                        # TODO: no test coverage here.
+                        raise KeyError(
+                            "Deferred loader for attribute "
+                            "%r failed to populate "
+                            "correctly" % key)
+                elif value is not ATTR_EMPTY:
+                    return self.set_committed_value(state, dict_, value)
+
+            if not passive & INIT_OK:
+                return NEVER_SET
+            else:
+                # Return a new, empty value
+                return self.initialize(state, dict_)
+
+    def append(self, state, dict_, value, initiator, passive=PASSIVE_OFF):
+        self.set(state, dict_, value, initiator, passive=passive)
+
+    def remove(self, state, dict_, value, initiator, passive=PASSIVE_OFF):
+        self.set(state, dict_, None, initiator,
+                 passive=passive, check_old=value)
+
+    def pop(self, state, dict_, value, initiator, passive=PASSIVE_OFF):
+        self.set(state, dict_, None, initiator,
+                 passive=passive, check_old=value, pop=True)
+
+    def set(self, state, dict_, value, initiator,
+            passive=PASSIVE_OFF, check_old=None, pop=False):
+        raise NotImplementedError()
+
+    def get_committed_value(self, state, dict_, passive=PASSIVE_OFF):
+        """return the unchanged value of this attribute"""
+
+        if self.key in state.committed_state:
+            value = state.committed_state[self.key]
+            if value in (NO_VALUE, NEVER_SET):
+                return None
+            else:
+                return value
+        else:
+            return self.get(state, dict_, passive=passive)
+
+    def set_committed_value(self, state, dict_, value):
+        """set an attribute value on the given instance and 'commit' it."""
+
+        dict_[self.key] = value
+        state._commit(dict_, [self.key])
+        return value
+
+
+class ScalarAttributeImpl(AttributeImpl):
+    """represents a scalar value-holding InstrumentedAttribute."""
+
+    default_accepts_scalar_loader = True
+    uses_objects = False
+    supports_population = True
+    collection = False
+    dynamic = False
+
+    __slots__ = '_replace_token', '_append_token', '_remove_token'
+
+    def __init__(self, *arg, **kw):
+        super(ScalarAttributeImpl, self).__init__(*arg, **kw)
+        self._replace_token = self._append_token = Event(self, OP_REPLACE)
+        self._remove_token = Event(self, OP_REMOVE)
+
+    def delete(self, state, dict_):
+
+        # TODO: catch key errors, convert to attributeerror?
+        if self.dispatch._active_history:
+            old = self.get(state, dict_, PASSIVE_RETURN_NEVER_SET)
+        else:
+            old = dict_.get(self.key, NO_VALUE)
+
+        if self.dispatch.remove:
+            self.fire_remove_event(state, dict_, old, self._remove_token)
+        state._modified_event(dict_, self, old)
+        del dict_[self.key]
+
+    def get_history(self, state, dict_, passive=PASSIVE_OFF):
+        if self.key in dict_:
+            return History.from_scalar_attribute(self, state, dict_[self.key])
+        else:
+            if passive & INIT_OK:
+                passive ^= INIT_OK
+            current = self.get(state, dict_, passive=passive)
+            if current is PASSIVE_NO_RESULT:
+                return HISTORY_BLANK
+            else:
+                return History.from_scalar_attribute(self, state, current)
+
+    def set(self, state, dict_, value, initiator,
+            passive=PASSIVE_OFF, check_old=None, pop=False):
+        if self.dispatch._active_history:
+            old = self.get(state, dict_, PASSIVE_RETURN_NEVER_SET)
+        else:
+            old = dict_.get(self.key, NO_VALUE)
+
+        if self.dispatch.set:
+            value = self.fire_replace_event(state, dict_,
+                                            value, old, initiator)
+        state._modified_event(dict_, self, old)
+        dict_[self.key] = value
+
+    def fire_replace_event(self, state, dict_, value, previous, initiator):
+        for fn in self.dispatch.set:
+            value = fn(
+                state, value, previous, initiator or self._replace_token)
+        return value
+
+    def fire_remove_event(self, state, dict_, value, initiator):
+        for fn in self.dispatch.remove:
+            fn(state, value, initiator or self._remove_token)
+
+    @property
+    def type(self):
+        self.property.columns[0].type
+
+
+class ScalarObjectAttributeImpl(ScalarAttributeImpl):
+    """represents a scalar-holding InstrumentedAttribute,
+       where the target object is also instrumented.
+
+       Adds events to delete/set operations.
+
+    """
+
+    default_accepts_scalar_loader = False
+    uses_objects = True
+    supports_population = True
+    collection = False
+
+    __slots__ = ()
+
+    def delete(self, state, dict_):
+        old = self.get(state, dict_)
+        self.fire_remove_event(state, dict_, old, self._remove_token)
+        del dict_[self.key]
+
+    def get_history(self, state, dict_, passive=PASSIVE_OFF):
+        if self.key in dict_:
+            return History.from_object_attribute(self, state, dict_[self.key])
+        else:
+            if passive & INIT_OK:
+                passive ^= INIT_OK
+            current = self.get(state, dict_, passive=passive)
+            if current is PASSIVE_NO_RESULT:
+                return HISTORY_BLANK
+            else:
+                return History.from_object_attribute(self, state, current)
+
+    def get_all_pending(self, state, dict_, passive=PASSIVE_NO_INITIALIZE):
+        if self.key in dict_:
+            current = dict_[self.key]
+        elif passive & CALLABLES_OK:
+            current = self.get(state, dict_, passive=passive)
+        else:
+            return []
+
+        # can't use __hash__(), can't use __eq__() here
+        if current is not None and \
+                current is not PASSIVE_NO_RESULT and \
+                current is not NEVER_SET:
+            ret = [(instance_state(current), current)]
+        else:
+            ret = [(None, None)]
+
+        if self.key in state.committed_state:
+            original = state.committed_state[self.key]
+            if original is not None and \
+                    original is not PASSIVE_NO_RESULT and \
+                    original is not NEVER_SET and \
+                    original is not current:
+
+                ret.append((instance_state(original), original))
+        return ret
+
+    def set(self, state, dict_, value, initiator,
+            passive=PASSIVE_OFF, check_old=None, pop=False):
+        """Set a value on the given InstanceState.
+
+        """
+        if self.dispatch._active_history:
+            old = self.get(
+                state, dict_,
+                passive=PASSIVE_ONLY_PERSISTENT |
+                NO_AUTOFLUSH | LOAD_AGAINST_COMMITTED)
+        else:
+            old = self.get(
+                state, dict_, passive=PASSIVE_NO_FETCH ^ INIT_OK |
+                LOAD_AGAINST_COMMITTED)
+
+        if check_old is not None and \
+                old is not PASSIVE_NO_RESULT and \
+                check_old is not old:
+            if pop:
+                return
+            else:
+                raise ValueError(
+                    "Object %s not associated with %s on attribute '%s'" % (
+                        instance_str(check_old),
+                        state_str(state),
+                        self.key
+                    ))
+
+        value = self.fire_replace_event(state, dict_, value, old, initiator)
+        dict_[self.key] = value
+
+    def fire_remove_event(self, state, dict_, value, initiator):
+        if self.trackparent and value is not None:
+            self.sethasparent(instance_state(value), state, False)
+
+        for fn in self.dispatch.remove:
+            fn(state, value, initiator or self._remove_token)
+
+        state._modified_event(dict_, self, value)
+
+    def fire_replace_event(self, state, dict_, value, previous, initiator):
+        if self.trackparent:
+            if (previous is not value and
+                    previous not in (None, PASSIVE_NO_RESULT, NEVER_SET)):
+                self.sethasparent(instance_state(previous), state, False)
+
+        for fn in self.dispatch.set:
+            value = fn(
+                state, value, previous, initiator or self._replace_token)
+
+        state._modified_event(dict_, self, previous)
+
+        if self.trackparent:
+            if value is not None:
+                self.sethasparent(instance_state(value), state, True)
+
+        return value
+
+
+class CollectionAttributeImpl(AttributeImpl):
+    """A collection-holding attribute that instruments changes in membership.
+
+    Only handles collections of instrumented objects.
+
+    InstrumentedCollectionAttribute holds an arbitrary, user-specified
+    container object (defaulting to a list) and brokers access to the
+    CollectionAdapter, a "view" onto that object that presents consistent bag
+    semantics to the orm layer independent of the user data implementation.
+
+    """
+    default_accepts_scalar_loader = False
+    uses_objects = True
+    supports_population = True
+    collection = True
+    dynamic = False
+
+    __slots__ = (
+        'copy', 'collection_factory', '_append_token', '_remove_token',
+        '_bulk_replace_token', '_duck_typed_as'
+    )
+
+    def __init__(self, class_, key, callable_, dispatch,
+                 typecallable=None, trackparent=False, extension=None,
+                 copy_function=None, compare_function=None, **kwargs):
+        super(CollectionAttributeImpl, self).__init__(
+            class_,
+            key,
+            callable_, dispatch,
+            trackparent=trackparent,
+            extension=extension,
+            compare_function=compare_function,
+            **kwargs)
+
+        if copy_function is None:
+            copy_function = self.__copy
+        self.copy = copy_function
+        self.collection_factory = typecallable
+        self._append_token = Event(self, OP_APPEND)
+        self._remove_token = Event(self, OP_REMOVE)
+        self._bulk_replace_token = Event(self, OP_BULK_REPLACE)
+        self._duck_typed_as = util.duck_type_collection(
+            self.collection_factory())
+
+        if getattr(self.collection_factory, "_sa_linker", None):
+
+            @event.listens_for(self, "init_collection")
+            def link(target, collection, collection_adapter):
+                collection._sa_linker(collection_adapter)
+
+            @event.listens_for(self, "dispose_collection")
+            def unlink(target, collection, collection_adapter):
+                collection._sa_linker(None)
+
+    def __copy(self, item):
+        return [y for y in collections.collection_adapter(item)]
+
+    def get_history(self, state, dict_, passive=PASSIVE_OFF):
+        current = self.get(state, dict_, passive=passive)
+        if current is PASSIVE_NO_RESULT:
+            return HISTORY_BLANK
+        else:
+            return History.from_collection(self, state, current)
+
+    def get_all_pending(self, state, dict_, passive=PASSIVE_NO_INITIALIZE):
+        # NOTE: passive is ignored here at the moment
+
+        if self.key not in dict_:
+            return []
+
+        current = dict_[self.key]
+        current = getattr(current, '_sa_adapter')
+
+        if self.key in state.committed_state:
+            original = state.committed_state[self.key]
+            if original not in (NO_VALUE, NEVER_SET):
+                current_states = [((c is not None) and
+                                   instance_state(c) or None, c)
+                                  for c in current]
+                original_states = [((c is not None) and
+                                    instance_state(c) or None, c)
+                                   for c in original]
+
+                current_set = dict(current_states)
+                original_set = dict(original_states)
+
+                return \
+                    [(s, o) for s, o in current_states
+                        if s not in original_set] + \
+                    [(s, o) for s, o in current_states
+                        if s in original_set] + \
+                    [(s, o) for s, o in original_states
+                        if s not in current_set]
+
+        return [(instance_state(o), o) for o in current]
+
+    def fire_append_event(self, state, dict_, value, initiator):
+        for fn in self.dispatch.append:
+            value = fn(
+                state, value, initiator or self._append_token)
+
+        state._modified_event(dict_, self, NEVER_SET, True)
+
+        if self.trackparent and value is not None:
+            self.sethasparent(instance_state(value), state, True)
+
+        return value
+
+    def fire_pre_remove_event(self, state, dict_, initiator):
+        state._modified_event(dict_, self, NEVER_SET, True)
+
+    def fire_remove_event(self, state, dict_, value, initiator):
+        if self.trackparent and value is not None:
+            self.sethasparent(instance_state(value), state, False)
+
+        for fn in self.dispatch.remove:
+            fn(state, value, initiator or self._remove_token)
+
+        state._modified_event(dict_, self, NEVER_SET, True)
+
+    def delete(self, state, dict_):
+        if self.key not in dict_:
+            return
+
+        state._modified_event(dict_, self, NEVER_SET, True)
+
+        collection = self.get_collection(state, state.dict)
+        collection.clear_with_event()
+        # TODO: catch key errors, convert to attributeerror?
+        del dict_[self.key]
+
+    def initialize(self, state, dict_):
+        """Initialize this attribute with an empty collection."""
+
+        _, user_data = self._initialize_collection(state)
+        dict_[self.key] = user_data
+        return user_data
+
+    def _initialize_collection(self, state):
+
+        adapter, collection = state.manager.initialize_collection(
+            self.key, state, self.collection_factory)
+
+        self.dispatch.init_collection(state, collection, adapter)
+
+        return adapter, collection
+
+    def append(self, state, dict_, value, initiator, passive=PASSIVE_OFF):
+        collection = self.get_collection(state, dict_, passive=passive)
+        if collection is PASSIVE_NO_RESULT:
+            value = self.fire_append_event(state, dict_, value, initiator)
+            assert self.key not in dict_, \
+                "Collection was loaded during event handling."
+            state._get_pending_mutation(self.key).append(value)
+        else:
+            collection.append_with_event(value, initiator)
+
+    def remove(self, state, dict_, value, initiator, passive=PASSIVE_OFF):
+        collection = self.get_collection(state, state.dict, passive=passive)
+        if collection is PASSIVE_NO_RESULT:
+            self.fire_remove_event(state, dict_, value, initiator)
+            assert self.key not in dict_, \
+                "Collection was loaded during event handling."
+            state._get_pending_mutation(self.key).remove(value)
+        else:
+            collection.remove_with_event(value, initiator)
+
+    def pop(self, state, dict_, value, initiator, passive=PASSIVE_OFF):
+        try:
+            # TODO: better solution here would be to add
+            # a "popper" role to collections.py to complement
+            # "remover".
+            self.remove(state, dict_, value, initiator, passive=passive)
+        except (ValueError, KeyError, IndexError):
+            pass
+
+    def set(self, state, dict_, value, initiator=None,
+            passive=PASSIVE_OFF, pop=False, _adapt=True):
+        iterable = orig_iterable = value
+
+        # pulling a new collection first so that an adaptation exception does
+        # not trigger a lazy load of the old collection.
+        new_collection, user_data = self._initialize_collection(state)
+        if _adapt:
+            if new_collection._converter is not None:
+                iterable = new_collection._converter(iterable)
+            else:
+                setting_type = util.duck_type_collection(iterable)
+                receiving_type = self._duck_typed_as
+
+                if setting_type is not receiving_type:
+                    given = iterable is None and 'None' or \
+                        iterable.__class__.__name__
+                    wanted = self._duck_typed_as.__name__
+                    raise TypeError(
+                        "Incompatible collection type: %s is not %s-like" % (
+                            given, wanted))
+
+                # If the object is an adapted collection, return the (iterable)
+                # adapter.
+                if hasattr(iterable, '_sa_iterator'):
+                    iterable = iterable._sa_iterator()
+                elif setting_type is dict:
+                    if util.py3k:
+                        iterable = iterable.values()
+                    else:
+                        iterable = getattr(
+                            iterable, 'itervalues', iterable.values)()
+                else:
+                    iterable = iter(iterable)
+        new_values = list(iterable)
+
+        evt = self._bulk_replace_token
+
+        self.dispatch.bulk_replace(state, new_values, evt)
+
+        old = self.get(state, dict_, passive=PASSIVE_ONLY_PERSISTENT)
+        if old is PASSIVE_NO_RESULT:
+            old = self.initialize(state, dict_)
+        elif old is orig_iterable:
+            # ignore re-assignment of the current collection, as happens
+            # implicitly with in-place operators (foo.collection |= other)
+            return
+
+        # place a copy of "old" in state.committed_state
+        state._modified_event(dict_, self, old, True)
+
+        old_collection = old._sa_adapter
+
+        dict_[self.key] = user_data
+
+        collections.bulk_replace(
+            new_values, old_collection, new_collection,
+            initiator=evt)
+
+        del old._sa_adapter
+        self.dispatch.dispose_collection(state, old, old_collection)
+
+    def _invalidate_collection(self, collection):
+        adapter = getattr(collection, '_sa_adapter')
+        adapter.invalidated = True
+
+    def set_committed_value(self, state, dict_, value):
+        """Set an attribute value on the given instance and 'commit' it."""
+
+        collection, user_data = self._initialize_collection(state)
+
+        if value:
+            collection.append_multiple_without_event(value)
+
+        state.dict[self.key] = user_data
+
+        state._commit(dict_, [self.key])
+
+        if self.key in state._pending_mutations:
+            # pending items exist.  issue a modified event,
+            # add/remove new items.
+            state._modified_event(dict_, self, user_data, True)
+
+            pending = state._pending_mutations.pop(self.key)
+            added = pending.added_items
+            removed = pending.deleted_items
+            for item in added:
+                collection.append_without_event(item)
+            for item in removed:
+                collection.remove_without_event(item)
+
+        return user_data
+
+    def get_collection(self, state, dict_,
+                       user_data=None, passive=PASSIVE_OFF):
+        """Retrieve the CollectionAdapter associated with the given state.
+
+        Creates a new CollectionAdapter if one does not exist.
+
+        """
+        if user_data is None:
+            user_data = self.get(state, dict_, passive=passive)
+            if user_data is PASSIVE_NO_RESULT:
+                return user_data
+
+        return getattr(user_data, '_sa_adapter')
+
+
+def backref_listeners(attribute, key, uselist):
+    """Apply listeners to synchronize a two-way relationship."""
+
+    # use easily recognizable names for stack traces.
+
+    # in the sections marked "tokens to test for a recursive loop",
+    # this is somewhat brittle and very performance-sensitive logic
+    # that is specific to how we might arrive at each event.  a marker
+    # that can target us directly to arguments being invoked against
+    # the impl might be simpler, but could interfere with other systems.
+
+    parent_token = attribute.impl.parent_token
+    parent_impl = attribute.impl
+
+    def _acceptable_key_err(child_state, initiator, child_impl):
+        raise ValueError(
+            "Bidirectional attribute conflict detected: "
+            'Passing object %s to attribute "%s" '
+            'triggers a modify event on attribute "%s" '
+            'via the backref "%s".' % (
+                state_str(child_state),
+                initiator.parent_token,
+                child_impl.parent_token,
+                attribute.impl.parent_token
+            )
+        )
+
+    def emit_backref_from_scalar_set_event(state, child, oldchild, initiator):
+        if oldchild is child:
+            return child
+        if oldchild is not None and \
+                oldchild is not PASSIVE_NO_RESULT and \
+                oldchild is not NEVER_SET:
+            # With lazy=None, there's no guarantee that the full collection is
+            # present when updating via a backref.
+            old_state, old_dict = instance_state(oldchild),\
+                instance_dict(oldchild)
+            impl = old_state.manager[key].impl
+
+            # tokens to test for a recursive loop.
+            if not impl.collection and not impl.dynamic:
+                check_recursive_token = impl._replace_token
+            else:
+                check_recursive_token = impl._remove_token
+
+            if initiator is not check_recursive_token:
+                impl.pop(old_state,
+                         old_dict,
+                         state.obj(),
+                         parent_impl._append_token,
+                         passive=PASSIVE_NO_FETCH)
+
+        if child is not None:
+            child_state, child_dict = instance_state(child),\
+                instance_dict(child)
+            child_impl = child_state.manager[key].impl
+
+            if initiator.parent_token is not parent_token and \
+                    initiator.parent_token is not child_impl.parent_token:
+                _acceptable_key_err(state, initiator, child_impl)
+
+            # tokens to test for a recursive loop.
+            check_append_token = child_impl._append_token
+            check_bulk_replace_token = child_impl._bulk_replace_token \
+                if child_impl.collection else None
+
+            if initiator is not check_append_token and \
+                    initiator is not check_bulk_replace_token:
+                child_impl.append(
+                    child_state,
+                    child_dict,
+                    state.obj(),
+                    initiator,
+                    passive=PASSIVE_NO_FETCH)
+        return child
+
+    def emit_backref_from_collection_append_event(state, child, initiator):
+        if child is None:
+            return
+
+        child_state, child_dict = instance_state(child), \
+            instance_dict(child)
+        child_impl = child_state.manager[key].impl
+
+        if initiator.parent_token is not parent_token and \
+                initiator.parent_token is not child_impl.parent_token:
+            _acceptable_key_err(state, initiator, child_impl)
+
+        # tokens to test for a recursive loop.
+        check_append_token = child_impl._append_token
+        check_bulk_replace_token = child_impl._bulk_replace_token \
+            if child_impl.collection else None
+
+        if initiator is not check_append_token and \
+                initiator is not check_bulk_replace_token:
+            child_impl.append(
+                child_state,
+                child_dict,
+                state.obj(),
+                initiator,
+                passive=PASSIVE_NO_FETCH)
+        return child
+
+    def emit_backref_from_collection_remove_event(state, child, initiator):
+        if child is not None:
+            child_state, child_dict = instance_state(child),\
+                instance_dict(child)
+            child_impl = child_state.manager[key].impl
+
+            # tokens to test for a recursive loop.
+            if not child_impl.collection and not child_impl.dynamic:
+                check_remove_token = child_impl._remove_token
+                check_replace_token = child_impl._replace_token
+            else:
+                check_remove_token = child_impl._remove_token
+                check_replace_token = child_impl._bulk_replace_token \
+                    if child_impl.collection else None
+
+            if initiator is not check_remove_token and \
+                    initiator is not check_replace_token:
+                child_impl.pop(
+                    child_state,
+                    child_dict,
+                    state.obj(),
+                    initiator,
+                    passive=PASSIVE_NO_FETCH)
+
+    if uselist:
+        event.listen(attribute, "append",
+                     emit_backref_from_collection_append_event,
+                     retval=True, raw=True)
+    else:
+        event.listen(attribute, "set",
+                     emit_backref_from_scalar_set_event,
+                     retval=True, raw=True)
+    # TODO: need coverage in test/orm/ of remove event
+    event.listen(attribute, "remove",
+                 emit_backref_from_collection_remove_event,
+                 retval=True, raw=True)
+
+_NO_HISTORY = util.symbol('NO_HISTORY')
+_NO_STATE_SYMBOLS = frozenset([
+    id(PASSIVE_NO_RESULT),
+    id(NO_VALUE),
+    id(NEVER_SET)])
+
+History = util.namedtuple("History", [
+    "added", "unchanged", "deleted"
+])
+
+
+class History(History):
+    """A 3-tuple of added, unchanged and deleted values,
+    representing the changes which have occurred on an instrumented
+    attribute.
+
+    The easiest way to get a :class:`.History` object for a particular
+    attribute on an object is to use the :func:`.inspect` function::
+
+        from sqlalchemy import inspect
+
+        hist = inspect(myobject).attrs.myattribute.history
+
+    Each tuple member is an iterable sequence:
+
+    * ``added`` - the collection of items added to the attribute (the first
+      tuple element).
+
+    * ``unchanged`` - the collection of items that have not changed on the
+      attribute (the second tuple element).
+
+    * ``deleted`` - the collection of items that have been removed from the
+      attribute (the third tuple element).
+
+    """
+
+    def __bool__(self):
+        return self != HISTORY_BLANK
+    __nonzero__ = __bool__
+
+    def empty(self):
+        """Return True if this :class:`.History` has no changes
+        and no existing, unchanged state.
+
+        """
+
+        return not bool(
+            (self.added or self.deleted)
+            or self.unchanged
+        )
+
+    def sum(self):
+        """Return a collection of added + unchanged + deleted."""
+
+        return (self.added or []) +\
+            (self.unchanged or []) +\
+            (self.deleted or [])
+
+    def non_deleted(self):
+        """Return a collection of added + unchanged."""
+
+        return (self.added or []) +\
+            (self.unchanged or [])
+
+    def non_added(self):
+        """Return a collection of unchanged + deleted."""
+
+        return (self.unchanged or []) +\
+            (self.deleted or [])
+
+    def has_changes(self):
+        """Return True if this :class:`.History` has changes."""
+
+        return bool(self.added or self.deleted)
+
+    def as_state(self):
+        return History(
+            [(c is not None)
+             and instance_state(c) or None
+             for c in self.added],
+            [(c is not None)
+             and instance_state(c) or None
+             for c in self.unchanged],
+            [(c is not None)
+             and instance_state(c) or None
+             for c in self.deleted],
+        )
+
+    @classmethod
+    def from_scalar_attribute(cls, attribute, state, current):
+        original = state.committed_state.get(attribute.key, _NO_HISTORY)
+
+        if original is _NO_HISTORY:
+            if current is NEVER_SET:
+                return cls((), (), ())
+            else:
+                return cls((), [current], ())
+        # don't let ClauseElement expressions here trip things up
+        elif attribute.is_equal(current, original) is True:
+            return cls((), [current], ())
+        else:
+            # current convention on native scalars is to not
+            # include information
+            # about missing previous value in "deleted", but
+            # we do include None, which helps in some primary
+            # key situations
+            if id(original) in _NO_STATE_SYMBOLS:
+                deleted = ()
+            else:
+                deleted = [original]
+            if current is NEVER_SET:
+                return cls((), (), deleted)
+            else:
+                return cls([current], (), deleted)
+
+    @classmethod
+    def from_object_attribute(cls, attribute, state, current):
+        original = state.committed_state.get(attribute.key, _NO_HISTORY)
+
+        if original is _NO_HISTORY:
+            if current is NO_VALUE or current is NEVER_SET:
+                return cls((), (), ())
+            else:
+                return cls((), [current], ())
+        elif current is original:
+            return cls((), [current], ())
+        else:
+            # current convention on related objects is to not
+            # include information
+            # about missing previous value in "deleted", and
+            # to also not include None - the dependency.py rules
+            # ignore the None in any case.
+            if id(original) in _NO_STATE_SYMBOLS or original is None:
+                deleted = ()
+            else:
+                deleted = [original]
+            if current is NO_VALUE or current is NEVER_SET:
+                return cls((), (), deleted)
+            else:
+                return cls([current], (), deleted)
+
+    @classmethod
+    def from_collection(cls, attribute, state, current):
+        original = state.committed_state.get(attribute.key, _NO_HISTORY)
+
+        if current is NO_VALUE or current is NEVER_SET:
+            return cls((), (), ())
+
+        current = getattr(current, '_sa_adapter')
+        if original in (NO_VALUE, NEVER_SET):
+            return cls(list(current), (), ())
+        elif original is _NO_HISTORY:
+            return cls((), list(current), ())
+        else:
+
+            current_states = [((c is not None) and instance_state(c)
+                               or None, c)
+                              for c in current
+                              ]
+            original_states = [((c is not None) and instance_state(c)
+                                or None, c)
+                               for c in original
+                               ]
+
+            current_set = dict(current_states)
+            original_set = dict(original_states)
+
+            return cls(
+                [o for s, o in current_states if s not in original_set],
+                [o for s, o in current_states if s in original_set],
+                [o for s, o in original_states if s not in current_set]
+            )
+
+HISTORY_BLANK = History(None, None, None)
+
+
+def get_history(obj, key, passive=PASSIVE_OFF):
+    """Return a :class:`.History` record for the given object
+    and attribute key.
+
+    :param obj: an object whose class is instrumented by the
+      attributes package.
+
+    :param key: string attribute name.
+
+    :param passive: indicates loading behavior for the attribute
+       if the value is not already present.   This is a
+       bitflag attribute, which defaults to the symbol
+       :attr:`.PASSIVE_OFF` indicating all necessary SQL
+       should be emitted.
+
+    """
+    if passive is True:
+        util.warn_deprecated("Passing True for 'passive' is deprecated. "
+                             "Use attributes.PASSIVE_NO_INITIALIZE")
+        passive = PASSIVE_NO_INITIALIZE
+    elif passive is False:
+        util.warn_deprecated("Passing False for 'passive' is "
+                             "deprecated.  Use attributes.PASSIVE_OFF")
+        passive = PASSIVE_OFF
+
+    return get_state_history(instance_state(obj), key, passive)
+
+
+def get_state_history(state, key, passive=PASSIVE_OFF):
+    return state.get_history(key, passive)
+
+
+def has_parent(cls, obj, key, optimistic=False):
+    """TODO"""
+    manager = manager_of_class(cls)
+    state = instance_state(obj)
+    return manager.has_parent(state, key, optimistic)
+
+
+def register_attribute(class_, key, **kw):
+    comparator = kw.pop('comparator', None)
+    parententity = kw.pop('parententity', None)
+    doc = kw.pop('doc', None)
+    desc = register_descriptor(class_, key,
+                               comparator, parententity, doc=doc)
+    register_attribute_impl(class_, key, **kw)
+    return desc
+
+
+def register_attribute_impl(class_, key,
+                            uselist=False, callable_=None,
+                            useobject=False,
+                            impl_class=None, backref=None, **kw):
+
+    manager = manager_of_class(class_)
+    if uselist:
+        factory = kw.pop('typecallable', None)
+        typecallable = manager.instrument_collection_class(
+            key, factory or list)
+    else:
+        typecallable = kw.pop('typecallable', None)
+
+    dispatch = manager[key].dispatch
+
+    if impl_class:
+        impl = impl_class(class_, key, typecallable, dispatch, **kw)
+    elif uselist:
+        impl = CollectionAttributeImpl(class_, key, callable_, dispatch,
+                                       typecallable=typecallable, **kw)
+    elif useobject:
+        impl = ScalarObjectAttributeImpl(class_, key, callable_,
+                                         dispatch, **kw)
+    else:
+        impl = ScalarAttributeImpl(class_, key, callable_, dispatch, **kw)
+
+    manager[key].impl = impl
+
+    if backref:
+        backref_listeners(manager[key], backref, uselist)
+
+    manager.post_configure_attribute(key)
+    return manager[key]
+
+
+def register_descriptor(class_, key, comparator=None,
+                        parententity=None, doc=None):
+    manager = manager_of_class(class_)
+
+    descriptor = InstrumentedAttribute(class_, key, comparator=comparator,
+                                       parententity=parententity)
+
+    descriptor.__doc__ = doc
+
+    manager.instrument_attribute(key, descriptor)
+    return descriptor
+
+
+def unregister_attribute(class_, key):
+    manager_of_class(class_).uninstrument_attribute(key)
+
+
+def init_collection(obj, key):
+    """Initialize a collection attribute and return the collection adapter.
+
+    This function is used to provide direct access to collection internals
+    for a previously unloaded attribute.  e.g.::
+
+        collection_adapter = init_collection(someobject, 'elements')
+        for elem in values:
+            collection_adapter.append_without_event(elem)
+
+    For an easier way to do the above, see
+    :func:`~sqlalchemy.orm.attributes.set_committed_value`.
+
+    obj is an instrumented object instance.  An InstanceState
+    is accepted directly for backwards compatibility but
+    this usage is deprecated.
+
+    """
+    state = instance_state(obj)
+    dict_ = state.dict
+    return init_state_collection(state, dict_, key)
+
+
+def init_state_collection(state, dict_, key):
+    """Initialize a collection attribute and return the collection adapter."""
+
+    attr = state.manager[key].impl
+    user_data = attr.initialize(state, dict_)
+    return attr.get_collection(state, dict_, user_data)
+
+
+def set_committed_value(instance, key, value):
+    """Set the value of an attribute with no history events.
+
+    Cancels any previous history present.  The value should be
+    a scalar value for scalar-holding attributes, or
+    an iterable for any collection-holding attribute.
+
+    This is the same underlying method used when a lazy loader
+    fires off and loads additional data from the database.
+    In particular, this method can be used by application code
+    which has loaded additional attributes or collections through
+    separate queries, which can then be attached to an instance
+    as though it were part of its original loaded state.
+
+    """
+    state, dict_ = instance_state(instance), instance_dict(instance)
+    state.manager[key].impl.set_committed_value(state, dict_, value)
+
+
+def set_attribute(instance, key, value, initiator=None):
+    """Set the value of an attribute, firing history events.
+
+    This function may be used regardless of instrumentation
+    applied directly to the class, i.e. no descriptors are required.
+    Custom attribute management schemes will need to make usage
+    of this method to establish attribute state as understood
+    by SQLAlchemy.
+
+    :param instance: the object that will be modified
+
+    :param key: string name of the attribute
+
+    :param value: value to assign
+
+    :param initiator: an instance of :class:`.Event` that would have
+     been propagated from a previous event listener.  This argument
+     is used when the :func:`.set_attribute` function is being used within
+     an existing event listening function where an :class:`.Event` object
+     is being supplied; the object may be used to track the origin of the
+     chain of events.
+
+     .. versionadded:: 1.2.3
+
+    """
+    state, dict_ = instance_state(instance), instance_dict(instance)
+    state.manager[key].impl.set(state, dict_, value, initiator)
+
+
+def get_attribute(instance, key):
+    """Get the value of an attribute, firing any callables required.
+
+    This function may be used regardless of instrumentation
+    applied directly to the class, i.e. no descriptors are required.
+    Custom attribute management schemes will need to make usage
+    of this method to make usage of attribute state as understood
+    by SQLAlchemy.
+
+    """
+    state, dict_ = instance_state(instance), instance_dict(instance)
+    return state.manager[key].impl.get(state, dict_)
+
+
+def del_attribute(instance, key):
+    """Delete the value of an attribute, firing history events.
+
+    This function may be used regardless of instrumentation
+    applied directly to the class, i.e. no descriptors are required.
+    Custom attribute management schemes will need to make usage
+    of this method to establish attribute state as understood
+    by SQLAlchemy.
+
+    """
+    state, dict_ = instance_state(instance), instance_dict(instance)
+    state.manager[key].impl.delete(state, dict_)
+
+
+def flag_modified(instance, key):
+    """Mark an attribute on an instance as 'modified'.
+
+    This sets the 'modified' flag on the instance and
+    establishes an unconditional change event for the given attribute.
+    The attribute must have a value present, else an
+    :class:`.InvalidRequestError` is raised.
+
+    To mark an object "dirty" without referring to any specific attribute
+    so that it is considered within a flush, use the
+    :func:`.attributes.flag_dirty` call.
+
+    .. seealso::
+
+        :func:`.attributes.flag_dirty`
+
+    """
+    state, dict_ = instance_state(instance), instance_dict(instance)
+    impl = state.manager[key].impl
+    impl.dispatch.modified(state, impl._modified_token)
+    state._modified_event(dict_, impl, NO_VALUE, is_userland=True)
+
+
+def flag_dirty(instance):
+    """Mark an instance as 'dirty' without any specific attribute mentioned.
+
+    This is a special operation that will allow the object to travel through
+    the flush process for interception by events such as
+    :meth:`.SessionEvents.before_flush`.   Note that no SQL will be emitted in
+    the flush process for an object that has no changes, even if marked dirty
+    via this method.  However, a :meth:`.SessionEvents.before_flush` handler
+    will be able to see the object in the :attr:`.Session.dirty` collection and
+    may establish changes on it, which will then be included in the SQL
+    emitted.
+
+    .. versionadded:: 1.2
+
+    .. seealso::
+
+        :func:`.attributes.flag_modified`
+
+    """
+
+    state, dict_ = instance_state(instance), instance_dict(instance)
+    state._modified_event(dict_, None, NO_VALUE, is_userland=True)
+
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/_sources/QUANTAXIS_Trade/README.rst.txt b/_build/html/_sources/QUANTAXIS_Trade/README.rst.txt new file mode 100644 index 000000000..fb977fc7d --- /dev/null +++ b/_build/html/_sources/QUANTAXIS_Trade/README.rst.txt @@ -0,0 +1,128 @@ +QUANTAXIS quantitative financial strategy framework +========================== + +QUANTAXIS quantitative framework to achieve the stock and futures market, the whole species back to the test.Through the distributed crawler for data capture, to build a response to the data cleaning and market push engine to build a multi-language open response frame. And build interactive visualization of clients and websites. + +.. image:: https://badge.waffle.io/yutiansut/QUANTAXIS.svg?label=ready&title=Ready + :target: https://waffle.io/yutiansut/QUANTAXIS + :alt: 'Stories in Ready' + + + +0.4.x Release Note +--------------------------------- + +QUANTAXIS Quantitative Financial Strategy Framework is a quantitative analysis solution for small and medium-sized strategy teams.We can quickly implement scene-oriented customization solutions with highly decoupled modularity and standardized protocols. QUANTAXIS is a progressive open Framework, you can according to their own needs, the introduction of their own data, analysis programs, visualization process, you can also RESTful interface, the rapid realization of multi-LAN / WAN collaboration. + +QUANTAXIS and many excellent domestic quantitative platform is the difference, QA more concerned about the user experience and the actual situation, for the user needs will be more optimized, so will pay more attention to openness, the introduction of custom convenience, and the team Collaborative details are handled, such as custom data introductions, custom policy chart comparison, custom risk and policy portfolio management, and so on. + +* Welcome group discussion: [group link] (https://jq.qq.com/?_wv=1027&k=4CEKGzn) + +* For more information, see https://github.com/yutiansut/QUANTAXIS/blob/0.4-beta/update_log.md + +* If you have any questions, you can send [issue] (https://github.com/yutiansut/QUANTAXIS/issues) on github, or contact us at QQ 279336410, QQ group 563280067 +============= + +More info on https://github.com/yutiansut/quantaxis + + +An EXAMPLE of QUANTAXIS BACKTEST like that below: + +.. code:: python + + + import QUANTAXIS as QA + from QUANTAXIS import QA_Backtest_stock_day as QB + + + """ + Written Before: + ===============QUANTAXIS BACKTEST STOCK_DAY's Constant + Constant: + QB.account.message + QB.account.cash + QB.account.hold + QB.account.history + QB.account.assets + QB.account.detail + QB.account.init_assest + + + + QB.strategy_stock_list + QB.strategy_start_date + QB.strategy_end_date + + + QB.today + + QB.benchmark_code + + + + + Function: + get the market data (based on gap): + QB.QA_backtest_get_market_data(QB,code,QB.today) + get the market data as you want: + QA.QA_fetch_stock_day(code,start,end,model) + + + Order : + QB.QA_backtest_send_order(QB, code,amount,towards,order: dict) + + order has three model: + 1.Limited order order['order_model']=0 or l,L + attention: this model should have a order['price'] key + order['price']=xxxx + + 2.Market order order['order_model']=1 or m,M,market,Market + 3.Strict model order['order_model']=2 or s,S + which is buy in the highest price or sell in the lowest price + + Query the hold amount + + QB.QA_backtest_hold_amount(QB,code) + + + """ + + + @QB.backtest_init + def init(): + # + QB.setting.QA_util_sql_mongo_ip='127.0.0.1' + + QB.account.init_assest=2500000 + QB.benchmark_code='hs300' + + QB.strategy_stock_list=['000001','000002','600010','601801','603111'] + QB.strategy_start_date='2017-03-01' + QB.strategy_end_date='2017-07-01' + + @QB.before_backtest + def before_backtest(): + global risk_position + QA.QA_util_log_info(QB.account.message) + + + + @QB.load_strategy + def strategy(): + #print(QB.account.message) + #print(QB.account.cash) + #input() + + for item in QB.strategy_stock_list: + QA.QA_util_log_info(QB.QA_backtest_get_market_data(QB,item,QB.today)) + if QB.QA_backtest_hold_amount(QB,item)==0: + QB.QA_backtest_send_order(QB,item,10000,1,{'order_model':'Market'}) + + + else: + #print(QB.QA_backtest_hold_amount(QB,item)) + QB.QA_backtest_send_order(QB,item,10000,-1,{'order_model':'Market'}) + + @QB.end_backtest + def after_backtest(): + pass \ No newline at end of file diff --git a/_build/html/_sources/README.rst.txt b/_build/html/_sources/README.rst.txt new file mode 100644 index 000000000..fb977fc7d --- /dev/null +++ b/_build/html/_sources/README.rst.txt @@ -0,0 +1,128 @@ +QUANTAXIS quantitative financial strategy framework +========================== + +QUANTAXIS quantitative framework to achieve the stock and futures market, the whole species back to the test.Through the distributed crawler for data capture, to build a response to the data cleaning and market push engine to build a multi-language open response frame. And build interactive visualization of clients and websites. + +.. image:: https://badge.waffle.io/yutiansut/QUANTAXIS.svg?label=ready&title=Ready + :target: https://waffle.io/yutiansut/QUANTAXIS + :alt: 'Stories in Ready' + + + +0.4.x Release Note +--------------------------------- + +QUANTAXIS Quantitative Financial Strategy Framework is a quantitative analysis solution for small and medium-sized strategy teams.We can quickly implement scene-oriented customization solutions with highly decoupled modularity and standardized protocols. QUANTAXIS is a progressive open Framework, you can according to their own needs, the introduction of their own data, analysis programs, visualization process, you can also RESTful interface, the rapid realization of multi-LAN / WAN collaboration. + +QUANTAXIS and many excellent domestic quantitative platform is the difference, QA more concerned about the user experience and the actual situation, for the user needs will be more optimized, so will pay more attention to openness, the introduction of custom convenience, and the team Collaborative details are handled, such as custom data introductions, custom policy chart comparison, custom risk and policy portfolio management, and so on. + +* Welcome group discussion: [group link] (https://jq.qq.com/?_wv=1027&k=4CEKGzn) + +* For more information, see https://github.com/yutiansut/QUANTAXIS/blob/0.4-beta/update_log.md + +* If you have any questions, you can send [issue] (https://github.com/yutiansut/QUANTAXIS/issues) on github, or contact us at QQ 279336410, QQ group 563280067 +============= + +More info on https://github.com/yutiansut/quantaxis + + +An EXAMPLE of QUANTAXIS BACKTEST like that below: + +.. code:: python + + + import QUANTAXIS as QA + from QUANTAXIS import QA_Backtest_stock_day as QB + + + """ + Written Before: + ===============QUANTAXIS BACKTEST STOCK_DAY's Constant + Constant: + QB.account.message + QB.account.cash + QB.account.hold + QB.account.history + QB.account.assets + QB.account.detail + QB.account.init_assest + + + + QB.strategy_stock_list + QB.strategy_start_date + QB.strategy_end_date + + + QB.today + + QB.benchmark_code + + + + + Function: + get the market data (based on gap): + QB.QA_backtest_get_market_data(QB,code,QB.today) + get the market data as you want: + QA.QA_fetch_stock_day(code,start,end,model) + + + Order : + QB.QA_backtest_send_order(QB, code,amount,towards,order: dict) + + order has three model: + 1.Limited order order['order_model']=0 or l,L + attention: this model should have a order['price'] key + order['price']=xxxx + + 2.Market order order['order_model']=1 or m,M,market,Market + 3.Strict model order['order_model']=2 or s,S + which is buy in the highest price or sell in the lowest price + + Query the hold amount + + QB.QA_backtest_hold_amount(QB,code) + + + """ + + + @QB.backtest_init + def init(): + # + QB.setting.QA_util_sql_mongo_ip='127.0.0.1' + + QB.account.init_assest=2500000 + QB.benchmark_code='hs300' + + QB.strategy_stock_list=['000001','000002','600010','601801','603111'] + QB.strategy_start_date='2017-03-01' + QB.strategy_end_date='2017-07-01' + + @QB.before_backtest + def before_backtest(): + global risk_position + QA.QA_util_log_info(QB.account.message) + + + + @QB.load_strategy + def strategy(): + #print(QB.account.message) + #print(QB.account.cash) + #input() + + for item in QB.strategy_stock_list: + QA.QA_util_log_info(QB.QA_backtest_get_market_data(QB,item,QB.today)) + if QB.QA_backtest_hold_amount(QB,item)==0: + QB.QA_backtest_send_order(QB,item,10000,1,{'order_model':'Market'}) + + + else: + #print(QB.QA_backtest_hold_amount(QB,item)) + QB.QA_backtest_send_order(QB,item,10000,-1,{'order_model':'Market'}) + + @QB.end_backtest + def after_backtest(): + pass \ No newline at end of file diff --git a/_build/html/_sources/index.rst.txt b/_build/html/_sources/index.rst.txt new file mode 100644 index 000000000..d69aefa6d --- /dev/null +++ b/_build/html/_sources/index.rst.txt @@ -0,0 +1,20 @@ +.. QUANTAXIS documentation master file, created by + sphinx-quickstart on Mon May 7 21:02:19 2018. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to QUANTAXIS's documentation! +===================================== + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/_build/html/_sources/source/QUANTAXIS.QAARP.rst.txt b/_build/html/_sources/source/QUANTAXIS.QAARP.rst.txt new file mode 100644 index 000000000..58da99219 --- /dev/null +++ b/_build/html/_sources/source/QUANTAXIS.QAARP.rst.txt @@ -0,0 +1,54 @@ +QUANTAXIS.QAARP package +======================= + +Submodules +---------- + +QUANTAXIS.QAARP.QAAccount module +-------------------------------- + +.. automodule:: QUANTAXIS.QAARP.QAAccount + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAARP.QAPortfolio module +---------------------------------- + +.. automodule:: QUANTAXIS.QAARP.QAPortfolio + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAARP.QARisk module +----------------------------- + +.. automodule:: QUANTAXIS.QAARP.QARisk + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAARP.QAStrategy module +--------------------------------- + +.. automodule:: QUANTAXIS.QAARP.QAStrategy + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAARP.QAUser module +----------------------------- + +.. automodule:: QUANTAXIS.QAARP.QAUser + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: QUANTAXIS.QAARP + :members: + :undoc-members: + :show-inheritance: diff --git a/_build/html/_sources/source/QUANTAXIS.QAAnalysis.rst.txt b/_build/html/_sources/source/QUANTAXIS.QAAnalysis.rst.txt new file mode 100644 index 000000000..eede2424f --- /dev/null +++ b/_build/html/_sources/source/QUANTAXIS.QAAnalysis.rst.txt @@ -0,0 +1,62 @@ +QUANTAXIS.QAAnalysis package +============================ + +Submodules +---------- + +QUANTAXIS.QAAnalysis.QAAnalysis\_block module +--------------------------------------------- + +.. automodule:: QUANTAXIS.QAAnalysis.QAAnalysis_block + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAAnalysis.QAAnalysis\_dataframe module +------------------------------------------------- + +.. automodule:: QUANTAXIS.QAAnalysis.QAAnalysis_dataframe + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAAnalysis.QAAnalysis\_machinelearning module +------------------------------------------------------- + +.. automodule:: QUANTAXIS.QAAnalysis.QAAnalysis_machinelearning + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAAnalysis.QAAnalysis\_series module +---------------------------------------------- + +.. automodule:: QUANTAXIS.QAAnalysis.QAAnalysis_series + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAAnalysis.QAAnalysis\_tick module +-------------------------------------------- + +.. automodule:: QUANTAXIS.QAAnalysis.QAAnalysis_tick + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAAnalysis.QAAnalysis\_trade module +--------------------------------------------- + +.. automodule:: QUANTAXIS.QAAnalysis.QAAnalysis_trade + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: QUANTAXIS.QAAnalysis + :members: + :undoc-members: + :show-inheritance: diff --git a/_build/html/_sources/source/QUANTAXIS.QABacktest.rst.txt b/_build/html/_sources/source/QUANTAXIS.QABacktest.rst.txt new file mode 100644 index 000000000..adcc84e69 --- /dev/null +++ b/_build/html/_sources/source/QUANTAXIS.QABacktest.rst.txt @@ -0,0 +1,46 @@ +QUANTAXIS.QABacktest package +============================ + +Submodules +---------- + +QUANTAXIS.QABacktest.QAAnalysis module +-------------------------------------- + +.. automodule:: QUANTAXIS.QABacktest.QAAnalysis + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QABacktest.QABacktest module +-------------------------------------- + +.. automodule:: QUANTAXIS.QABacktest.QABacktest + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QABacktest.QAResult module +------------------------------------ + +.. automodule:: QUANTAXIS.QABacktest.QAResult + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QABacktest.backtest\_setting module +--------------------------------------------- + +.. automodule:: QUANTAXIS.QABacktest.backtest_setting + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: QUANTAXIS.QABacktest + :members: + :undoc-members: + :show-inheritance: diff --git a/_build/html/_sources/source/QUANTAXIS.QACmd.rst.txt b/_build/html/_sources/source/QUANTAXIS.QACmd.rst.txt new file mode 100644 index 000000000..fc5e3a217 --- /dev/null +++ b/_build/html/_sources/source/QUANTAXIS.QACmd.rst.txt @@ -0,0 +1,22 @@ +QUANTAXIS.QACmd package +======================= + +Submodules +---------- + +QUANTAXIS.QACmd.backtest module +------------------------------- + +.. automodule:: QUANTAXIS.QACmd.backtest + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: QUANTAXIS.QACmd + :members: + :undoc-members: + :show-inheritance: diff --git a/_build/html/_sources/source/QUANTAXIS.QAData.proto.rst.txt b/_build/html/_sources/source/QUANTAXIS.QAData.proto.rst.txt new file mode 100644 index 000000000..4c0e1151b --- /dev/null +++ b/_build/html/_sources/source/QUANTAXIS.QAData.proto.rst.txt @@ -0,0 +1,38 @@ +QUANTAXIS.QAData.proto package +============================== + +Submodules +---------- + +QUANTAXIS.QAData.proto.order\_pb2 module +---------------------------------------- + +.. automodule:: QUANTAXIS.QAData.proto.order_pb2 + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAData.proto.stock\_day\_pb2 module +--------------------------------------------- + +.. automodule:: QUANTAXIS.QAData.proto.stock_day_pb2 + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAData.proto.stock\_min\_pb2 module +--------------------------------------------- + +.. automodule:: QUANTAXIS.QAData.proto.stock_min_pb2 + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: QUANTAXIS.QAData.proto + :members: + :undoc-members: + :show-inheritance: diff --git a/_build/html/_sources/source/QUANTAXIS.QAData.rst.txt b/_build/html/_sources/source/QUANTAXIS.QAData.rst.txt new file mode 100644 index 000000000..7721ce6ba --- /dev/null +++ b/_build/html/_sources/source/QUANTAXIS.QAData.rst.txt @@ -0,0 +1,93 @@ +QUANTAXIS.QAData package +======================== + +Subpackages +----------- + +.. toctree:: + + QUANTAXIS.QAData.proto + +Submodules +---------- + +QUANTAXIS.QAData.QADataStruct module +------------------------------------ + +.. automodule:: QUANTAXIS.QAData.QADataStruct + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAData.base\_datastruct module +---------------------------------------- + +.. automodule:: QUANTAXIS.QAData.base_datastruct + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAData.data\_fq module +-------------------------------- + +.. automodule:: QUANTAXIS.QAData.data_fq + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAData.data\_resample module +-------------------------------------- + +.. automodule:: QUANTAXIS.QAData.data_resample + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAData.dsmethods module +--------------------------------- + +.. automodule:: QUANTAXIS.QAData.dsmethods + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAData.fundamental module +----------------------------------- + +.. automodule:: QUANTAXIS.QAData.fundamental + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAData.realtimedata module +------------------------------------ + +.. automodule:: QUANTAXIS.QAData.realtimedata + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAData.schema module +------------------------------ + +.. automodule:: QUANTAXIS.QAData.schema + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAData.serialize module +--------------------------------- + +.. automodule:: QUANTAXIS.QAData.serialize + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: QUANTAXIS.QAData + :members: + :undoc-members: + :show-inheritance: diff --git a/_build/html/_sources/source/QUANTAXIS.QAEngine.rst.txt b/_build/html/_sources/source/QUANTAXIS.QAEngine.rst.txt new file mode 100644 index 000000000..7f85c330b --- /dev/null +++ b/_build/html/_sources/source/QUANTAXIS.QAEngine.rst.txt @@ -0,0 +1,38 @@ +QUANTAXIS.QAEngine package +========================== + +Submodules +---------- + +QUANTAXIS.QAEngine.QAEvent module +--------------------------------- + +.. automodule:: QUANTAXIS.QAEngine.QAEvent + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAEngine.QATask module +-------------------------------- + +.. automodule:: QUANTAXIS.QAEngine.QATask + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAEngine.QAThreadEngine module +---------------------------------------- + +.. automodule:: QUANTAXIS.QAEngine.QAThreadEngine + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: QUANTAXIS.QAEngine + :members: + :undoc-members: + :show-inheritance: diff --git a/_build/html/_sources/source/QUANTAXIS.QAFetch.rst.txt b/_build/html/_sources/source/QUANTAXIS.QAFetch.rst.txt new file mode 100644 index 000000000..7c41e5293 --- /dev/null +++ b/_build/html/_sources/source/QUANTAXIS.QAFetch.rst.txt @@ -0,0 +1,126 @@ +QUANTAXIS.QAFetch package +========================= + +Submodules +---------- + +QUANTAXIS.QAFetch.Fetcher module +-------------------------------- + +.. automodule:: QUANTAXIS.QAFetch.Fetcher + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAFetch.QACrawler module +---------------------------------- + +.. automodule:: QUANTAXIS.QAFetch.QACrawler + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAFetch.QAEastMoney module +------------------------------------ + +.. automodule:: QUANTAXIS.QAFetch.QAEastMoney + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAFetch.QAQuery module +-------------------------------- + +.. automodule:: QUANTAXIS.QAFetch.QAQuery + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAFetch.QAQuery\_Advance module +----------------------------------------- + +.. automodule:: QUANTAXIS.QAFetch.QAQuery_Advance + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAFetch.QATdx module +------------------------------ + +.. automodule:: QUANTAXIS.QAFetch.QATdx + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAFetch.QATdx\_adv module +----------------------------------- + +.. automodule:: QUANTAXIS.QAFetch.QATdx_adv + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAFetch.QAThs module +------------------------------ + +.. automodule:: QUANTAXIS.QAFetch.QAThs + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAFetch.QATushare module +---------------------------------- + +.. automodule:: QUANTAXIS.QAFetch.QATushare + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAFetch.QAWind module +------------------------------- + +.. automodule:: QUANTAXIS.QAFetch.QAWind + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAFetch.QAfinancial module +------------------------------------ + +.. automodule:: QUANTAXIS.QAFetch.QAfinancial + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAFetch.base module +----------------------------- + +.. automodule:: QUANTAXIS.QAFetch.base + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAFetch.data\_list module +----------------------------------- + +.. automodule:: QUANTAXIS.QAFetch.data_list + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAFetch.realtime module +--------------------------------- + +.. automodule:: QUANTAXIS.QAFetch.realtime + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: QUANTAXIS.QAFetch + :members: + :undoc-members: + :show-inheritance: diff --git a/_build/html/_sources/source/QUANTAXIS.QAIndicator.rst.txt b/_build/html/_sources/source/QUANTAXIS.QAIndicator.rst.txt new file mode 100644 index 000000000..afb3be113 --- /dev/null +++ b/_build/html/_sources/source/QUANTAXIS.QAIndicator.rst.txt @@ -0,0 +1,30 @@ +QUANTAXIS.QAIndicator package +============================= + +Submodules +---------- + +QUANTAXIS.QAIndicator.base module +--------------------------------- + +.. automodule:: QUANTAXIS.QAIndicator.base + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAIndicator.indicators module +--------------------------------------- + +.. automodule:: QUANTAXIS.QAIndicator.indicators + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: QUANTAXIS.QAIndicator + :members: + :undoc-members: + :show-inheritance: diff --git a/_build/html/_sources/source/QUANTAXIS.QAMarket.rst.txt b/_build/html/_sources/source/QUANTAXIS.QAMarket.rst.txt new file mode 100644 index 000000000..5878c0e06 --- /dev/null +++ b/_build/html/_sources/source/QUANTAXIS.QAMarket.rst.txt @@ -0,0 +1,126 @@ +QUANTAXIS.QAMarket package +========================== + +Submodules +---------- + +QUANTAXIS.QAMarket.Broker\_Calender module +------------------------------------------ + +.. automodule:: QUANTAXIS.QAMarket.Broker_Calender + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAMarket.QABacktestBroker module +------------------------------------------ + +.. automodule:: QUANTAXIS.QAMarket.QABacktestBroker + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAMarket.QABroker module +---------------------------------- + +.. automodule:: QUANTAXIS.QAMarket.QABroker + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAMarket.QADealer module +---------------------------------- + +.. automodule:: QUANTAXIS.QAMarket.QADealer + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAMarket.QAMarket module +---------------------------------- + +.. automodule:: QUANTAXIS.QAMarket.QAMarket + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAMarket.QAOrder module +--------------------------------- + +.. automodule:: QUANTAXIS.QAMarket.QAOrder + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAMarket.QAOrderHandler module +---------------------------------------- + +.. automodule:: QUANTAXIS.QAMarket.QAOrderHandler + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAMarket.QARandomBroker module +---------------------------------------- + +.. automodule:: QUANTAXIS.QAMarket.QARandomBroker + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAMarket.QARealBroker module +-------------------------------------- + +.. automodule:: QUANTAXIS.QAMarket.QARealBroker + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAMarket.QASimulatedBroker module +------------------------------------------- + +.. automodule:: QUANTAXIS.QAMarket.QASimulatedBroker + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAMarket.QATrade module +--------------------------------- + +.. automodule:: QUANTAXIS.QAMarket.QATrade + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAMarket.shipaneBroker module +--------------------------------------- + +.. automodule:: QUANTAXIS.QAMarket.shipaneBroker + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAMarket.shipaneclient module +--------------------------------------- + +.. automodule:: QUANTAXIS.QAMarket.shipaneclient + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAMarket.tdxRealBroker module +--------------------------------------- + +.. automodule:: QUANTAXIS.QAMarket.tdxRealBroker + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: QUANTAXIS.QAMarket + :members: + :undoc-members: + :show-inheritance: diff --git a/_build/html/_sources/source/QUANTAXIS.QASU.rst.txt b/_build/html/_sources/source/QUANTAXIS.QASU.rst.txt new file mode 100644 index 000000000..5693f90fc --- /dev/null +++ b/_build/html/_sources/source/QUANTAXIS.QASU.rst.txt @@ -0,0 +1,78 @@ +QUANTAXIS.QASU package +====================== + +Submodules +---------- + +QUANTAXIS.QASU.main module +-------------------------- + +.. automodule:: QUANTAXIS.QASU.main + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QASU.save\_account module +----------------------------------- + +.. automodule:: QUANTAXIS.QASU.save_account + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QASU.save\_backtest module +------------------------------------ + +.. automodule:: QUANTAXIS.QASU.save_backtest + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QASU.save\_local module +--------------------------------- + +.. automodule:: QUANTAXIS.QASU.save_local + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QASU.save\_tdx module +------------------------------- + +.. automodule:: QUANTAXIS.QASU.save_tdx + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QASU.save\_tdx\_file module +------------------------------------- + +.. automodule:: QUANTAXIS.QASU.save_tdx_file + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QASU.save\_tushare module +----------------------------------- + +.. automodule:: QUANTAXIS.QASU.save_tushare + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QASU.user module +-------------------------- + +.. automodule:: QUANTAXIS.QASU.user + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: QUANTAXIS.QASU + :members: + :undoc-members: + :show-inheritance: diff --git a/_build/html/_sources/source/QUANTAXIS.QAUtil.rst.txt b/_build/html/_sources/source/QUANTAXIS.QAUtil.rst.txt new file mode 100644 index 000000000..0625c15d6 --- /dev/null +++ b/_build/html/_sources/source/QUANTAXIS.QAUtil.rst.txt @@ -0,0 +1,190 @@ +QUANTAXIS.QAUtil package +======================== + +Submodules +---------- + +QUANTAXIS.QAUtil.QAAuth module +------------------------------ + +.. automodule:: QUANTAXIS.QAUtil.QAAuth + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QABar module +----------------------------- + +.. automodule:: QUANTAXIS.QAUtil.QABar + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QACfg module +----------------------------- + +.. automodule:: QUANTAXIS.QAUtil.QACfg + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QACode module +------------------------------ + +.. automodule:: QUANTAXIS.QAUtil.QACode + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QACsv module +----------------------------- + +.. automodule:: QUANTAXIS.QAUtil.QACsv + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QADate module +------------------------------ + +.. automodule:: QUANTAXIS.QAUtil.QADate + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QADate\_trade module +------------------------------------- + +.. automodule:: QUANTAXIS.QAUtil.QADate_trade + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QADict module +------------------------------ + +.. automodule:: QUANTAXIS.QAUtil.QADict + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QAList module +------------------------------ + +.. automodule:: QUANTAXIS.QAUtil.QAList + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QALocalize module +---------------------------------- + +.. automodule:: QUANTAXIS.QAUtil.QALocalize + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QALogs module +------------------------------ + +.. automodule:: QUANTAXIS.QAUtil.QALogs + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QAMail module +------------------------------ + +.. automodule:: QUANTAXIS.QAUtil.QAMail + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QAMongo module +------------------------------- + +.. automodule:: QUANTAXIS.QAUtil.QAMongo + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QAParameter module +----------------------------------- + +.. automodule:: QUANTAXIS.QAUtil.QAParameter + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QAPlot module +------------------------------ + +.. automodule:: QUANTAXIS.QAUtil.QAPlot + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QARandom module +-------------------------------- + +.. automodule:: QUANTAXIS.QAUtil.QARandom + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QASetting module +--------------------------------- + +.. automodule:: QUANTAXIS.QAUtil.QASetting + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QASql module +----------------------------- + +.. automodule:: QUANTAXIS.QAUtil.QASql + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QAText module +------------------------------ + +.. automodule:: QUANTAXIS.QAUtil.QAText + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QATransform module +----------------------------------- + +.. automodule:: QUANTAXIS.QAUtil.QATransform + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QAWeb module +----------------------------- + +.. automodule:: QUANTAXIS.QAUtil.QAWeb + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.host module +---------------------------- + +.. automodule:: QUANTAXIS.QAUtil.host + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: QUANTAXIS.QAUtil + :members: + :undoc-members: + :show-inheritance: diff --git a/_build/html/_sources/source/QUANTAXIS.QAWeb.rst.txt b/_build/html/_sources/source/QUANTAXIS.QAWeb.rst.txt new file mode 100644 index 000000000..7af3d790f --- /dev/null +++ b/_build/html/_sources/source/QUANTAXIS.QAWeb.rst.txt @@ -0,0 +1,30 @@ +QUANTAXIS.QAWeb package +======================= + +Submodules +---------- + +QUANTAXIS.QAWeb.QA\_Web module +------------------------------ + +.. automodule:: QUANTAXIS.QAWeb.QA_Web + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAWeb.chain module +---------------------------- + +.. automodule:: QUANTAXIS.QAWeb.chain + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: QUANTAXIS.QAWeb + :members: + :undoc-members: + :show-inheritance: diff --git a/_build/html/_sources/source/QUANTAXIS.rst.txt b/_build/html/_sources/source/QUANTAXIS.rst.txt new file mode 100644 index 000000000..e5a40b09e --- /dev/null +++ b/_build/html/_sources/source/QUANTAXIS.rst.txt @@ -0,0 +1,28 @@ +QUANTAXIS package +================= + +Subpackages +----------- + +.. toctree:: + + QUANTAXIS.QAARP + QUANTAXIS.QAAnalysis + QUANTAXIS.QABacktest + QUANTAXIS.QACmd + QUANTAXIS.QAData + QUANTAXIS.QAEngine + QUANTAXIS.QAFetch + QUANTAXIS.QAIndicator + QUANTAXIS.QAMarket + QUANTAXIS.QASU + QUANTAXIS.QAUtil + QUANTAXIS.QAWeb + +Module contents +--------------- + +.. automodule:: QUANTAXIS + :members: + :undoc-members: + :show-inheritance: diff --git a/_build/html/_sources/source/modules.rst.txt b/_build/html/_sources/source/modules.rst.txt new file mode 100644 index 000000000..b09928062 --- /dev/null +++ b/_build/html/_sources/source/modules.rst.txt @@ -0,0 +1,7 @@ +QUANTAXIS +========= + +.. toctree:: + :maxdepth: 4 + + QUANTAXIS diff --git a/_build/html/_static/ajax-loader.gif b/_build/html/_static/ajax-loader.gif new file mode 100644 index 000000000..61faf8cab Binary files /dev/null and b/_build/html/_static/ajax-loader.gif differ diff --git a/_build/html/_static/alabaster.css b/_build/html/_static/alabaster.css new file mode 100644 index 000000000..be65b1374 --- /dev/null +++ b/_build/html/_static/alabaster.css @@ -0,0 +1,693 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@import url("basic.css"); + +/* -- page layout ----------------------------------------------------------- */ + +body { + font-family: 'goudy old style', 'minion pro', 'bell mt', Georgia, 'Hiragino Mincho Pro', serif; + font-size: 17px; + background-color: #fff; + color: #000; + margin: 0; + padding: 0; +} + + +div.document { + width: 940px; + margin: 30px auto 0 auto; +} + +div.documentwrapper { + float: left; + width: 100%; +} + +div.bodywrapper { + margin: 0 0 0 220px; +} + +div.sphinxsidebar { + width: 220px; + font-size: 14px; + line-height: 1.5; +} + +hr { + border: 1px solid #B1B4B6; +} + +div.body { + background-color: #fff; + color: #3E4349; + padding: 0 30px 0 30px; +} + +div.body > .section { + text-align: left; +} + +div.footer { + width: 940px; + margin: 20px auto 30px auto; + font-size: 14px; + color: #888; + text-align: right; +} + +div.footer a { + color: #888; +} + +p.caption { + font-family: inherit; + font-size: inherit; +} + + +div.relations { + display: none; +} + + +div.sphinxsidebar a { + color: #444; + text-decoration: none; + border-bottom: 1px dotted #999; +} + +div.sphinxsidebar a:hover { + border-bottom: 1px solid #999; +} + +div.sphinxsidebarwrapper { + padding: 18px 10px; +} + +div.sphinxsidebarwrapper p.logo { + padding: 0; + margin: -10px 0 0 0px; + text-align: center; +} + +div.sphinxsidebarwrapper h1.logo { + margin-top: -10px; + text-align: center; + margin-bottom: 5px; + text-align: left; +} + +div.sphinxsidebarwrapper h1.logo-name { + margin-top: 0px; +} + +div.sphinxsidebarwrapper p.blurb { + margin-top: 0; + font-style: normal; +} + +div.sphinxsidebar h3, +div.sphinxsidebar h4 { + font-family: 'Garamond', 'Georgia', serif; + color: #444; + font-size: 24px; + font-weight: normal; + margin: 0 0 5px 0; + padding: 0; +} + +div.sphinxsidebar h4 { + font-size: 20px; +} + +div.sphinxsidebar h3 a { + color: #444; +} + +div.sphinxsidebar p.logo a, +div.sphinxsidebar h3 a, +div.sphinxsidebar p.logo a:hover, +div.sphinxsidebar h3 a:hover { + border: none; +} + +div.sphinxsidebar p { + color: #555; + margin: 10px 0; +} + +div.sphinxsidebar ul { + margin: 10px 0; + padding: 0; + color: #000; +} + +div.sphinxsidebar ul li.toctree-l1 > a { + font-size: 120%; +} + +div.sphinxsidebar ul li.toctree-l2 > a { + font-size: 110%; +} + +div.sphinxsidebar input { + border: 1px solid #CCC; + font-family: 'goudy old style', 'minion pro', 'bell mt', Georgia, 'Hiragino Mincho Pro', serif; + font-size: 1em; +} + +div.sphinxsidebar hr { + border: none; + height: 1px; + color: #AAA; + background: #AAA; + + text-align: left; + margin-left: 0; + width: 50%; +} + +/* -- body styles ----------------------------------------------------------- */ + +a { + color: #004B6B; + text-decoration: underline; +} + +a:hover { + color: #6D4100; + text-decoration: underline; +} + +div.body h1, +div.body h2, +div.body h3, +div.body h4, +div.body h5, +div.body h6 { + font-family: 'Garamond', 'Georgia', serif; + font-weight: normal; + margin: 30px 0px 10px 0px; + padding: 0; +} + +div.body h1 { margin-top: 0; padding-top: 0; font-size: 240%; } +div.body h2 { font-size: 180%; } +div.body h3 { font-size: 150%; } +div.body h4 { font-size: 130%; } +div.body h5 { font-size: 100%; } +div.body h6 { font-size: 100%; } + +a.headerlink { + color: #DDD; + padding: 0 4px; + text-decoration: none; +} + +a.headerlink:hover { + color: #444; + background: #EAEAEA; +} + +div.body p, div.body dd, div.body li { + line-height: 1.4em; +} + +div.admonition { + margin: 20px 0px; + padding: 10px 30px; + background-color: #EEE; + border: 1px solid #CCC; +} + +div.admonition tt.xref, div.admonition code.xref, div.admonition a tt { + background-color: #FBFBFB; + border-bottom: 1px solid #fafafa; +} + +div.admonition p.admonition-title { + font-family: 'Garamond', 'Georgia', serif; + font-weight: normal; + font-size: 24px; + margin: 0 0 10px 0; + padding: 0; + line-height: 1; +} + +div.admonition p.last { + margin-bottom: 0; +} + +div.highlight { + background-color: #fff; +} + +dt:target, .highlight { + background: #FAF3E8; +} + +div.warning { + background-color: #FCC; + border: 1px solid #FAA; +} + +div.danger { + background-color: #FCC; + border: 1px solid #FAA; + -moz-box-shadow: 2px 2px 4px #D52C2C; + -webkit-box-shadow: 2px 2px 4px #D52C2C; + box-shadow: 2px 2px 4px #D52C2C; +} + +div.error { + background-color: #FCC; + border: 1px solid #FAA; + -moz-box-shadow: 2px 2px 4px #D52C2C; + -webkit-box-shadow: 2px 2px 4px #D52C2C; + box-shadow: 2px 2px 4px #D52C2C; +} + +div.caution { + background-color: #FCC; + border: 1px solid #FAA; +} + +div.attention { + background-color: #FCC; + border: 1px solid #FAA; +} + +div.important { + background-color: #EEE; + border: 1px solid #CCC; +} + +div.note { + background-color: #EEE; + border: 1px solid #CCC; +} + +div.tip { + background-color: #EEE; + border: 1px solid #CCC; +} + +div.hint { + background-color: #EEE; + border: 1px solid #CCC; +} + +div.seealso { + background-color: #EEE; + border: 1px solid #CCC; +} + +div.topic { + background-color: #EEE; +} + +p.admonition-title { + display: inline; +} + +p.admonition-title:after { + content: ":"; +} + +pre, tt, code { + font-family: 'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace; + font-size: 0.9em; +} + +.hll { + background-color: #FFC; + margin: 0 -12px; + padding: 0 12px; + display: block; +} + +img.screenshot { +} + +tt.descname, tt.descclassname, code.descname, code.descclassname { + font-size: 0.95em; +} + +tt.descname, code.descname { + padding-right: 0.08em; +} + +img.screenshot { + -moz-box-shadow: 2px 2px 4px #EEE; + -webkit-box-shadow: 2px 2px 4px #EEE; + box-shadow: 2px 2px 4px #EEE; +} + +table.docutils { + border: 1px solid #888; + -moz-box-shadow: 2px 2px 4px #EEE; + -webkit-box-shadow: 2px 2px 4px #EEE; + box-shadow: 2px 2px 4px #EEE; +} + +table.docutils td, table.docutils th { + border: 1px solid #888; + padding: 0.25em 0.7em; +} + +table.field-list, table.footnote { + border: none; + -moz-box-shadow: none; + -webkit-box-shadow: none; + box-shadow: none; +} + +table.footnote { + margin: 15px 0; + width: 100%; + border: 1px solid #EEE; + background: #FDFDFD; + font-size: 0.9em; +} + +table.footnote + table.footnote { + margin-top: -15px; + border-top: none; +} + +table.field-list th { + padding: 0 0.8em 0 0; +} + +table.field-list td { + padding: 0; +} + +table.field-list p { + margin-bottom: 0.8em; +} + +/* Cloned from + * https://github.com/sphinx-doc/sphinx/commit/ef60dbfce09286b20b7385333d63a60321784e68 + */ +.field-name { + -moz-hyphens: manual; + -ms-hyphens: manual; + -webkit-hyphens: manual; + hyphens: manual; +} + +table.footnote td.label { + width: .1px; + padding: 0.3em 0 0.3em 0.5em; +} + +table.footnote td { + padding: 0.3em 0.5em; +} + +dl { + margin: 0; + padding: 0; +} + +dl dd { + margin-left: 30px; +} + +blockquote { + margin: 0 0 0 30px; + padding: 0; +} + +ul, ol { + /* Matches the 30px from the narrow-screen "li > ul" selector below */ + margin: 10px 0 10px 30px; + padding: 0; +} + +pre { + background: #EEE; + padding: 7px 30px; + margin: 15px 0px; + line-height: 1.3em; +} + +div.viewcode-block:target { + background: #ffd; +} + +dl pre, blockquote pre, li pre { + margin-left: 0; + padding-left: 30px; +} + +tt, code { + background-color: #ecf0f3; + color: #222; + /* padding: 1px 2px; */ +} + +tt.xref, code.xref, a tt { + background-color: #FBFBFB; + border-bottom: 1px solid #fff; +} + +a.reference { + text-decoration: none; + border-bottom: 1px dotted #004B6B; +} + +/* Don't put an underline on images */ +a.image-reference, a.image-reference:hover { + border-bottom: none; +} + +a.reference:hover { + border-bottom: 1px solid #6D4100; +} + +a.footnote-reference { + text-decoration: none; + font-size: 0.7em; + vertical-align: top; + border-bottom: 1px dotted #004B6B; +} + +a.footnote-reference:hover { + border-bottom: 1px solid #6D4100; +} + +a:hover tt, a:hover code { + background: #EEE; +} + + +@media screen and (max-width: 870px) { + + div.sphinxsidebar { + display: none; + } + + div.document { + width: 100%; + + } + + div.documentwrapper { + margin-left: 0; + margin-top: 0; + margin-right: 0; + margin-bottom: 0; + } + + div.bodywrapper { + margin-top: 0; + margin-right: 0; + margin-bottom: 0; + margin-left: 0; + } + + ul { + margin-left: 0; + } + + li > ul { + /* Matches the 30px from the "ul, ol" selector above */ + margin-left: 30px; + } + + .document { + width: auto; + } + + .footer { + width: auto; + } + + .bodywrapper { + margin: 0; + } + + .footer { + width: auto; + } + + .github { + display: none; + } + + + +} + + + +@media screen and (max-width: 875px) { + + body { + margin: 0; + padding: 20px 30px; + } + + div.documentwrapper { + float: none; + background: #fff; + } + + div.sphinxsidebar { + display: block; + float: none; + width: 102.5%; + margin: 50px -30px -20px -30px; + padding: 10px 20px; + background: #333; + color: #FFF; + } + + div.sphinxsidebar h3, div.sphinxsidebar h4, div.sphinxsidebar p, + div.sphinxsidebar h3 a { + color: #fff; + } + + div.sphinxsidebar a { + color: #AAA; + } + + div.sphinxsidebar p.logo { + display: none; + } + + div.document { + width: 100%; + margin: 0; + } + + div.footer { + display: none; + } + + div.bodywrapper { + margin: 0; + } + + div.body { + min-height: 0; + padding: 0; + } + + .rtd_doc_footer { + display: none; + } + + .document { + width: auto; + } + + .footer { + width: auto; + } + + .footer { + width: auto; + } + + .github { + display: none; + } +} + + +/* misc. */ + +.revsys-inline { + display: none!important; +} + +/* Make nested-list/multi-paragraph items look better in Releases changelog + * pages. Without this, docutils' magical list fuckery causes inconsistent + * formatting between different release sub-lists. + */ +div#changelog > div.section > ul > li > p:only-child { + margin-bottom: 0; +} + +/* Hide fugly table cell borders in ..bibliography:: directive output */ +table.docutils.citation, table.docutils.citation td, table.docutils.citation th { + border: none; + /* Below needed in some edge cases; if not applied, bottom shadows appear */ + -moz-box-shadow: none; + -webkit-box-shadow: none; + box-shadow: none; +} \ No newline at end of file diff --git a/_build/html/_static/basic.css b/_build/html/_static/basic.css new file mode 100644 index 000000000..19ced1057 --- /dev/null +++ b/_build/html/_static/basic.css @@ -0,0 +1,665 @@ +/* + * basic.css + * ~~~~~~~~~ + * + * Sphinx stylesheet -- basic theme. + * + * :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/* -- main layout ----------------------------------------------------------- */ + +div.clearer { + clear: both; +} + +/* -- relbar ---------------------------------------------------------------- */ + +div.related { + width: 100%; + font-size: 90%; +} + +div.related h3 { + display: none; +} + +div.related ul { + margin: 0; + padding: 0 0 0 10px; + list-style: none; +} + +div.related li { + display: inline; +} + +div.related li.right { + float: right; + margin-right: 5px; +} + +/* -- sidebar --------------------------------------------------------------- */ + +div.sphinxsidebarwrapper { + padding: 10px 5px 0 10px; +} + +div.sphinxsidebar { + float: left; + width: 230px; + margin-left: -100%; + font-size: 90%; + word-wrap: break-word; + overflow-wrap : break-word; +} + +div.sphinxsidebar ul { + list-style: none; +} + +div.sphinxsidebar ul ul, +div.sphinxsidebar ul.want-points { + margin-left: 20px; + list-style: square; +} + +div.sphinxsidebar ul ul { + margin-top: 0; + margin-bottom: 0; +} + +div.sphinxsidebar form { + margin-top: 10px; +} + +div.sphinxsidebar input { + border: 1px solid #98dbcc; + font-family: sans-serif; + font-size: 1em; +} + +div.sphinxsidebar #searchbox input[type="text"] { + float: left; + width: 80%; + padding: 0.25em; + box-sizing: border-box; +} + +div.sphinxsidebar #searchbox input[type="submit"] { + float: left; + width: 20%; + border-left: none; + padding: 0.25em; + box-sizing: border-box; +} + + +img { + border: 0; + max-width: 100%; +} + +/* -- search page ----------------------------------------------------------- */ + +ul.search { + margin: 10px 0 0 20px; + padding: 0; +} + +ul.search li { + padding: 5px 0 5px 20px; + background-image: url(file.png); + background-repeat: no-repeat; + background-position: 0 7px; +} + +ul.search li a { + font-weight: bold; +} + +ul.search li div.context { + color: #888; + margin: 2px 0 0 30px; + text-align: left; +} + +ul.keywordmatches li.goodmatch a { + font-weight: bold; +} + +/* -- index page ------------------------------------------------------------ */ + +table.contentstable { + width: 90%; + margin-left: auto; + margin-right: auto; +} + +table.contentstable p.biglink { + line-height: 150%; +} + +a.biglink { + font-size: 1.3em; +} + +span.linkdescr { + font-style: italic; + padding-top: 5px; + font-size: 90%; +} + +/* -- general index --------------------------------------------------------- */ + +table.indextable { + width: 100%; +} + +table.indextable td { + text-align: left; + vertical-align: top; +} + +table.indextable ul { + margin-top: 0; + margin-bottom: 0; + list-style-type: none; +} + +table.indextable > tbody > tr > td > ul { + padding-left: 0em; +} + +table.indextable tr.pcap { + height: 10px; +} + +table.indextable tr.cap { + margin-top: 10px; + background-color: #f2f2f2; +} + +img.toggler { + margin-right: 3px; + margin-top: 3px; + cursor: pointer; +} + +div.modindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +div.genindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +/* -- domain module index --------------------------------------------------- */ + +table.modindextable td { + padding: 2px; + border-collapse: collapse; +} + +/* -- general body styles --------------------------------------------------- */ + +div.body { + min-width: 450px; + max-width: 800px; +} + +div.body p, div.body dd, div.body li, div.body blockquote { + -moz-hyphens: auto; + -ms-hyphens: auto; + -webkit-hyphens: auto; + hyphens: auto; +} + +a.headerlink { + visibility: hidden; +} + +h1:hover > a.headerlink, +h2:hover > a.headerlink, +h3:hover > a.headerlink, +h4:hover > a.headerlink, +h5:hover > a.headerlink, +h6:hover > a.headerlink, +dt:hover > a.headerlink, +caption:hover > a.headerlink, +p.caption:hover > a.headerlink, +div.code-block-caption:hover > a.headerlink { + visibility: visible; +} + +div.body p.caption { + text-align: inherit; +} + +div.body td { + text-align: left; +} + +.first { + margin-top: 0 !important; +} + +p.rubric { + margin-top: 30px; + font-weight: bold; +} + +img.align-left, .figure.align-left, object.align-left { + clear: left; + float: left; + margin-right: 1em; +} + +img.align-right, .figure.align-right, object.align-right { + clear: right; + float: right; + margin-left: 1em; +} + +img.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + +.align-left { + text-align: left; +} + +.align-center { + text-align: center; +} + +.align-right { + text-align: right; +} + +/* -- sidebars -------------------------------------------------------------- */ + +div.sidebar { + margin: 0 0 0.5em 1em; + border: 1px solid #ddb; + padding: 7px 7px 0 7px; + background-color: #ffe; + width: 40%; + float: right; +} + +p.sidebar-title { + font-weight: bold; +} + +/* -- topics ---------------------------------------------------------------- */ + +div.topic { + border: 1px solid #ccc; + padding: 7px 7px 0 7px; + margin: 10px 0 10px 0; +} + +p.topic-title { + font-size: 1.1em; + font-weight: bold; + margin-top: 10px; +} + +/* -- admonitions ----------------------------------------------------------- */ + +div.admonition { + margin-top: 10px; + margin-bottom: 10px; + padding: 7px; +} + +div.admonition dt { + font-weight: bold; +} + +div.admonition dl { + margin-bottom: 0; +} + +p.admonition-title { + margin: 0px 10px 5px 0px; + font-weight: bold; +} + +div.body p.centered { + text-align: center; + margin-top: 25px; +} + +/* -- tables ---------------------------------------------------------------- */ + +table.docutils { + border: 0; + border-collapse: collapse; +} + +table.align-center { + margin-left: auto; + margin-right: auto; +} + +table caption span.caption-number { + font-style: italic; +} + +table caption span.caption-text { +} + +table.docutils td, table.docutils th { + padding: 1px 8px 1px 5px; + border-top: 0; + border-left: 0; + border-right: 0; + border-bottom: 1px solid #aaa; +} + +table.footnote td, table.footnote th { + border: 0 !important; +} + +th { + text-align: left; + padding-right: 5px; +} + +table.citation { + border-left: solid 1px gray; + margin-left: 1px; +} + +table.citation td { + border-bottom: none; +} + +/* -- figures --------------------------------------------------------------- */ + +div.figure { + margin: 0.5em; + padding: 0.5em; +} + +div.figure p.caption { + padding: 0.3em; +} + +div.figure p.caption span.caption-number { + font-style: italic; +} + +div.figure p.caption span.caption-text { +} + +/* -- field list styles ----------------------------------------------------- */ + +table.field-list td, table.field-list th { + border: 0 !important; +} + +.field-list ul { + margin: 0; + padding-left: 1em; +} + +.field-list p { + margin: 0; +} + +.field-name { + -moz-hyphens: manual; + -ms-hyphens: manual; + -webkit-hyphens: manual; + hyphens: manual; +} + +/* -- other body styles ----------------------------------------------------- */ + +ol.arabic { + list-style: decimal; +} + +ol.loweralpha { + list-style: lower-alpha; +} + +ol.upperalpha { + list-style: upper-alpha; +} + +ol.lowerroman { + list-style: lower-roman; +} + +ol.upperroman { + list-style: upper-roman; +} + +dl { + margin-bottom: 15px; +} + +dd p { + margin-top: 0px; +} + +dd ul, dd table { + margin-bottom: 10px; +} + +dd { + margin-top: 3px; + margin-bottom: 10px; + margin-left: 30px; +} + +dt:target, span.highlighted { + background-color: #fbe54e; +} + +rect.highlighted { + fill: #fbe54e; +} + +dl.glossary dt { + font-weight: bold; + font-size: 1.1em; +} + +.optional { + font-size: 1.3em; +} + +.sig-paren { + font-size: larger; +} + +.versionmodified { + font-style: italic; +} + +.system-message { + background-color: #fda; + padding: 5px; + border: 3px solid red; +} + +.footnote:target { + background-color: #ffa; +} + +.line-block { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} + +.line-block .line-block { + margin-top: 0; + margin-bottom: 0; + margin-left: 1.5em; +} + +.guilabel, .menuselection { + font-family: sans-serif; +} + +.accelerator { + text-decoration: underline; +} + +.classifier { + font-style: oblique; +} + +abbr, acronym { + border-bottom: dotted 1px; + cursor: help; +} + +/* -- code displays --------------------------------------------------------- */ + +pre { + overflow: auto; + overflow-y: hidden; /* fixes display issues on Chrome browsers */ +} + +span.pre { + -moz-hyphens: none; + -ms-hyphens: none; + -webkit-hyphens: none; + hyphens: none; +} + +td.linenos pre { + padding: 5px 0px; + border: 0; + background-color: transparent; + color: #aaa; +} + +table.highlighttable { + margin-left: 0.5em; +} + +table.highlighttable td { + padding: 0 0.5em 0 0.5em; +} + +div.code-block-caption { + padding: 2px 5px; + font-size: small; +} + +div.code-block-caption code { + background-color: transparent; +} + +div.code-block-caption + div > div.highlight > pre { + margin-top: 0; +} + +div.code-block-caption span.caption-number { + padding: 0.1em 0.3em; + font-style: italic; +} + +div.code-block-caption span.caption-text { +} + +div.literal-block-wrapper { + padding: 1em 1em 0; +} + +div.literal-block-wrapper div.highlight { + margin: 0; +} + +code.descname { + background-color: transparent; + font-weight: bold; + font-size: 1.2em; +} + +code.descclassname { + background-color: transparent; +} + +code.xref, a code { + background-color: transparent; + font-weight: bold; +} + +h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { + background-color: transparent; +} + +.viewcode-link { + float: right; +} + +.viewcode-back { + float: right; + font-family: sans-serif; +} + +div.viewcode-block:target { + margin: -1px -10px; + padding: 0 10px; +} + +/* -- math display ---------------------------------------------------------- */ + +img.math { + vertical-align: middle; +} + +div.body div.math p { + text-align: center; +} + +span.eqno { + float: right; +} + +span.eqno a.headerlink { + position: relative; + left: 0px; + z-index: 1; +} + +div.math:hover a.headerlink { + visibility: visible; +} + +/* -- printout stylesheet --------------------------------------------------- */ + +@media print { + div.document, + div.documentwrapper, + div.bodywrapper { + margin: 0 !important; + width: 100%; + } + + div.sphinxsidebar, + div.related, + div.footer, + #top-link { + display: none; + } +} \ No newline at end of file diff --git a/_build/html/_static/comment-bright.png b/_build/html/_static/comment-bright.png new file mode 100644 index 000000000..15e27edb1 Binary files /dev/null and b/_build/html/_static/comment-bright.png differ diff --git a/_build/html/_static/comment-close.png b/_build/html/_static/comment-close.png new file mode 100644 index 000000000..4d91bcf57 Binary files /dev/null and b/_build/html/_static/comment-close.png differ diff --git a/_build/html/_static/comment.png b/_build/html/_static/comment.png new file mode 100644 index 000000000..dfbc0cbd5 Binary files /dev/null and b/_build/html/_static/comment.png differ diff --git a/_build/html/_static/custom.css b/_build/html/_static/custom.css new file mode 100644 index 000000000..2a924f1d6 --- /dev/null +++ b/_build/html/_static/custom.css @@ -0,0 +1 @@ +/* This file intentionally left blank. */ diff --git a/_build/html/_static/doctools.js b/_build/html/_static/doctools.js new file mode 100644 index 000000000..0c15c0099 --- /dev/null +++ b/_build/html/_static/doctools.js @@ -0,0 +1,311 @@ +/* + * doctools.js + * ~~~~~~~~~~~ + * + * Sphinx JavaScript utilities for all documentation. + * + * :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/** + * select a different prefix for underscore + */ +$u = _.noConflict(); + +/** + * make the code below compatible with browsers without + * an installed firebug like debugger +if (!window.console || !console.firebug) { + var names = ["log", "debug", "info", "warn", "error", "assert", "dir", + "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", + "profile", "profileEnd"]; + window.console = {}; + for (var i = 0; i < names.length; ++i) + window.console[names[i]] = function() {}; +} + */ + +/** + * small helper function to urldecode strings + */ +jQuery.urldecode = function(x) { + return decodeURIComponent(x).replace(/\+/g, ' '); +}; + +/** + * small helper function to urlencode strings + */ +jQuery.urlencode = encodeURIComponent; + +/** + * This function returns the parsed url parameters of the + * current request. Multiple values per key are supported, + * it will always return arrays of strings for the value parts. + */ +jQuery.getQueryParameters = function(s) { + if (typeof s === 'undefined') + s = document.location.search; + var parts = s.substr(s.indexOf('?') + 1).split('&'); + var result = {}; + for (var i = 0; i < parts.length; i++) { + var tmp = parts[i].split('=', 2); + var key = jQuery.urldecode(tmp[0]); + var value = jQuery.urldecode(tmp[1]); + if (key in result) + result[key].push(value); + else + result[key] = [value]; + } + return result; +}; + +/** + * highlight a given string on a jquery object by wrapping it in + * span elements with the given class name. + */ +jQuery.fn.highlightText = function(text, className) { + function highlight(node, addItems) { + if (node.nodeType === 3) { + var val = node.nodeValue; + var pos = val.toLowerCase().indexOf(text); + if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) { + var span; + var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg"); + if (isInSVG) { + span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); + } else { + span = document.createElement("span"); + span.className = className; + } + span.appendChild(document.createTextNode(val.substr(pos, text.length))); + node.parentNode.insertBefore(span, node.parentNode.insertBefore( + document.createTextNode(val.substr(pos + text.length)), + node.nextSibling)); + node.nodeValue = val.substr(0, pos); + if (isInSVG) { + var bbox = span.getBBox(); + var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect"); + rect.x.baseVal.value = bbox.x; + rect.y.baseVal.value = bbox.y; + rect.width.baseVal.value = bbox.width; + rect.height.baseVal.value = bbox.height; + rect.setAttribute('class', className); + var parentOfText = node.parentNode.parentNode; + addItems.push({ + "parent": node.parentNode, + "target": rect}); + } + } + } + else if (!jQuery(node).is("button, select, textarea")) { + jQuery.each(node.childNodes, function() { + highlight(this, addItems); + }); + } + } + var addItems = []; + var result = this.each(function() { + highlight(this, addItems); + }); + for (var i = 0; i < addItems.length; ++i) { + jQuery(addItems[i].parent).before(addItems[i].target); + } + return result; +}; + +/* + * backward compatibility for jQuery.browser + * This will be supported until firefox bug is fixed. + */ +if (!jQuery.browser) { + jQuery.uaMatch = function(ua) { + ua = ua.toLowerCase(); + + var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || + /(webkit)[ \/]([\w.]+)/.exec(ua) || + /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || + /(msie) ([\w.]+)/.exec(ua) || + ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || + []; + + return { + browser: match[ 1 ] || "", + version: match[ 2 ] || "0" + }; + }; + jQuery.browser = {}; + jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; +} + +/** + * Small JavaScript module for the documentation. + */ +var Documentation = { + + init : function() { + this.fixFirefoxAnchorBug(); + this.highlightSearchWords(); + this.initIndexTable(); + + }, + + /** + * i18n support + */ + TRANSLATIONS : {}, + PLURAL_EXPR : function(n) { return n === 1 ? 0 : 1; }, + LOCALE : 'unknown', + + // gettext and ngettext don't access this so that the functions + // can safely bound to a different name (_ = Documentation.gettext) + gettext : function(string) { + var translated = Documentation.TRANSLATIONS[string]; + if (typeof translated === 'undefined') + return string; + return (typeof translated === 'string') ? translated : translated[0]; + }, + + ngettext : function(singular, plural, n) { + var translated = Documentation.TRANSLATIONS[singular]; + if (typeof translated === 'undefined') + return (n == 1) ? singular : plural; + return translated[Documentation.PLURALEXPR(n)]; + }, + + addTranslations : function(catalog) { + for (var key in catalog.messages) + this.TRANSLATIONS[key] = catalog.messages[key]; + this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); + this.LOCALE = catalog.locale; + }, + + /** + * add context elements like header anchor links + */ + addContextElements : function() { + $('div[id] > :header:first').each(function() { + $('\u00B6'). + attr('href', '#' + this.id). + attr('title', _('Permalink to this headline')). + appendTo(this); + }); + $('dt[id]').each(function() { + $('\u00B6'). + attr('href', '#' + this.id). + attr('title', _('Permalink to this definition')). + appendTo(this); + }); + }, + + /** + * workaround a firefox stupidity + * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075 + */ + fixFirefoxAnchorBug : function() { + if (document.location.hash && $.browser.mozilla) + window.setTimeout(function() { + document.location.href += ''; + }, 10); + }, + + /** + * highlight the search words provided in the url in the text + */ + highlightSearchWords : function() { + var params = $.getQueryParameters(); + var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; + if (terms.length) { + var body = $('div.body'); + if (!body.length) { + body = $('body'); + } + window.setTimeout(function() { + $.each(terms, function() { + body.highlightText(this.toLowerCase(), 'highlighted'); + }); + }, 10); + $('') + .appendTo($('#searchbox')); + } + }, + + /** + * init the domain index toggle buttons + */ + initIndexTable : function() { + var togglers = $('img.toggler').click(function() { + var src = $(this).attr('src'); + var idnum = $(this).attr('id').substr(7); + $('tr.cg-' + idnum).toggle(); + if (src.substr(-9) === 'minus.png') + $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); + else + $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); + }).css('display', ''); + if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { + togglers.click(); + } + }, + + /** + * helper function to hide the search marks again + */ + hideSearchWords : function() { + $('#searchbox .highlight-link').fadeOut(300); + $('span.highlighted').removeClass('highlighted'); + }, + + /** + * make the url absolute + */ + makeURL : function(relativeURL) { + return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; + }, + + /** + * get the current relative url + */ + getCurrentURL : function() { + var path = document.location.pathname; + var parts = path.split(/\//); + $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { + if (this === '..') + parts.pop(); + }); + var url = parts.join('/'); + return path.substring(url.lastIndexOf('/') + 1, path.length - 1); + }, + + initOnKeyListeners: function() { + $(document).keyup(function(event) { + var activeElementType = document.activeElement.tagName; + // don't navigate when in search box or textarea + if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') { + switch (event.keyCode) { + case 37: // left + var prevHref = $('link[rel="prev"]').prop('href'); + if (prevHref) { + window.location.href = prevHref; + return false; + } + case 39: // right + var nextHref = $('link[rel="next"]').prop('href'); + if (nextHref) { + window.location.href = nextHref; + return false; + } + } + } + }); + } +}; + +// quick alias for translations +_ = Documentation.gettext; + +$(document).ready(function() { + Documentation.init(); +}); \ No newline at end of file diff --git a/_build/html/_static/documentation_options.js b/_build/html/_static/documentation_options.js new file mode 100644 index 000000000..3fbeb656f --- /dev/null +++ b/_build/html/_static/documentation_options.js @@ -0,0 +1,9 @@ +var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '1.0', + LANGUAGE: 'python', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true, + SOURCELINK_SUFFIX: '.txt' +}; \ No newline at end of file diff --git a/_build/html/_static/down-pressed.png b/_build/html/_static/down-pressed.png new file mode 100644 index 000000000..5756c8cad Binary files /dev/null and b/_build/html/_static/down-pressed.png differ diff --git a/_build/html/_static/down.png b/_build/html/_static/down.png new file mode 100644 index 000000000..1b3bdad2c Binary files /dev/null and b/_build/html/_static/down.png differ diff --git a/_build/html/_static/file.png b/_build/html/_static/file.png new file mode 100644 index 000000000..a858a410e Binary files /dev/null and b/_build/html/_static/file.png differ diff --git a/_build/html/_static/jquery-3.2.1.js b/_build/html/_static/jquery-3.2.1.js new file mode 100644 index 000000000..d2d8ca479 --- /dev/null +++ b/_build/html/_static/jquery-3.2.1.js @@ -0,0 +1,10253 @@ +/*! + * jQuery JavaScript Library v3.2.1 + * https://jquery.com/ + * + * Includes Sizzle.js + * https://sizzlejs.com/ + * + * Copyright JS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: 2017-03-20T18:59Z + */ +( function( global, factory ) { + + "use strict"; + + if ( typeof module === "object" && typeof module.exports === "object" ) { + + // For CommonJS and CommonJS-like environments where a proper `window` + // is present, execute the factory and get jQuery. + // For environments that do not have a `window` with a `document` + // (such as Node.js), expose a factory as module.exports. + // This accentuates the need for the creation of a real `window`. + // e.g. var jQuery = require("jquery")(window); + // See ticket #14549 for more info. + module.exports = global.document ? + factory( global, true ) : + function( w ) { + if ( !w.document ) { + throw new Error( "jQuery requires a window with a document" ); + } + return factory( w ); + }; + } else { + factory( global ); + } + +// Pass this if window is not defined yet +} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { + +// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 +// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode +// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common +// enough that all such attempts are guarded in a try block. +"use strict"; + +var arr = []; + +var document = window.document; + +var getProto = Object.getPrototypeOf; + +var slice = arr.slice; + +var concat = arr.concat; + +var push = arr.push; + +var indexOf = arr.indexOf; + +var class2type = {}; + +var toString = class2type.toString; + +var hasOwn = class2type.hasOwnProperty; + +var fnToString = hasOwn.toString; + +var ObjectFunctionString = fnToString.call( Object ); + +var support = {}; + + + + function DOMEval( code, doc ) { + doc = doc || document; + + var script = doc.createElement( "script" ); + + script.text = code; + doc.head.appendChild( script ).parentNode.removeChild( script ); + } +/* global Symbol */ +// Defining this global in .eslintrc.json would create a danger of using the global +// unguarded in another place, it seems safer to define global only for this module + + + +var + version = "3.2.1", + + // Define a local copy of jQuery + jQuery = function( selector, context ) { + + // The jQuery object is actually just the init constructor 'enhanced' + // Need init if jQuery is called (just allow error to be thrown if not included) + return new jQuery.fn.init( selector, context ); + }, + + // Support: Android <=4.0 only + // Make sure we trim BOM and NBSP + rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, + + // Matches dashed string for camelizing + rmsPrefix = /^-ms-/, + rdashAlpha = /-([a-z])/g, + + // Used by jQuery.camelCase as callback to replace() + fcamelCase = function( all, letter ) { + return letter.toUpperCase(); + }; + +jQuery.fn = jQuery.prototype = { + + // The current version of jQuery being used + jquery: version, + + constructor: jQuery, + + // The default length of a jQuery object is 0 + length: 0, + + toArray: function() { + return slice.call( this ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + + // Return all the elements in a clean array + if ( num == null ) { + return slice.call( this ); + } + + // Return just the one element from the set + return num < 0 ? this[ num + this.length ] : this[ num ]; + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems ) { + + // Build a new jQuery matched element set + var ret = jQuery.merge( this.constructor(), elems ); + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + each: function( callback ) { + return jQuery.each( this, callback ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map( this, function( elem, i ) { + return callback.call( elem, i, elem ); + } ) ); + }, + + slice: function() { + return this.pushStack( slice.apply( this, arguments ) ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + eq: function( i ) { + var len = this.length, + j = +i + ( i < 0 ? len : 0 ); + return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); + }, + + end: function() { + return this.prevObject || this.constructor(); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: push, + sort: arr.sort, + splice: arr.splice +}; + +jQuery.extend = jQuery.fn.extend = function() { + var options, name, src, copy, copyIsArray, clone, + target = arguments[ 0 ] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + + // Skip the boolean and the target + target = arguments[ i ] || {}; + i++; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !jQuery.isFunction( target ) ) { + target = {}; + } + + // Extend jQuery itself if only one argument is passed + if ( i === length ) { + target = this; + i--; + } + + for ( ; i < length; i++ ) { + + // Only deal with non-null/undefined values + if ( ( options = arguments[ i ] ) != null ) { + + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject( copy ) || + ( copyIsArray = Array.isArray( copy ) ) ) ) { + + if ( copyIsArray ) { + copyIsArray = false; + clone = src && Array.isArray( src ) ? src : []; + + } else { + clone = src && jQuery.isPlainObject( src ) ? src : {}; + } + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend( { + + // Unique for each copy of jQuery on the page + expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), + + // Assume jQuery is ready without the ready module + isReady: true, + + error: function( msg ) { + throw new Error( msg ); + }, + + noop: function() {}, + + isFunction: function( obj ) { + return jQuery.type( obj ) === "function"; + }, + + isWindow: function( obj ) { + return obj != null && obj === obj.window; + }, + + isNumeric: function( obj ) { + + // As of jQuery 3.0, isNumeric is limited to + // strings and numbers (primitives or objects) + // that can be coerced to finite numbers (gh-2662) + var type = jQuery.type( obj ); + return ( type === "number" || type === "string" ) && + + // parseFloat NaNs numeric-cast false positives ("") + // ...but misinterprets leading-number strings, particularly hex literals ("0x...") + // subtraction forces infinities to NaN + !isNaN( obj - parseFloat( obj ) ); + }, + + isPlainObject: function( obj ) { + var proto, Ctor; + + // Detect obvious negatives + // Use toString instead of jQuery.type to catch host objects + if ( !obj || toString.call( obj ) !== "[object Object]" ) { + return false; + } + + proto = getProto( obj ); + + // Objects with no prototype (e.g., `Object.create( null )`) are plain + if ( !proto ) { + return true; + } + + // Objects with prototype are plain iff they were constructed by a global Object function + Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; + return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; + }, + + isEmptyObject: function( obj ) { + + /* eslint-disable no-unused-vars */ + // See https://github.com/eslint/eslint/issues/6125 + var name; + + for ( name in obj ) { + return false; + } + return true; + }, + + type: function( obj ) { + if ( obj == null ) { + return obj + ""; + } + + // Support: Android <=2.3 only (functionish RegExp) + return typeof obj === "object" || typeof obj === "function" ? + class2type[ toString.call( obj ) ] || "object" : + typeof obj; + }, + + // Evaluates a script in a global context + globalEval: function( code ) { + DOMEval( code ); + }, + + // Convert dashed to camelCase; used by the css and data modules + // Support: IE <=9 - 11, Edge 12 - 13 + // Microsoft forgot to hump their vendor prefix (#9572) + camelCase: function( string ) { + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); + }, + + each: function( obj, callback ) { + var length, i = 0; + + if ( isArrayLike( obj ) ) { + length = obj.length; + for ( ; i < length; i++ ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; + } + } + } else { + for ( i in obj ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; + } + } + } + + return obj; + }, + + // Support: Android <=4.0 only + trim: function( text ) { + return text == null ? + "" : + ( text + "" ).replace( rtrim, "" ); + }, + + // results is for internal usage only + makeArray: function( arr, results ) { + var ret = results || []; + + if ( arr != null ) { + if ( isArrayLike( Object( arr ) ) ) { + jQuery.merge( ret, + typeof arr === "string" ? + [ arr ] : arr + ); + } else { + push.call( ret, arr ); + } + } + + return ret; + }, + + inArray: function( elem, arr, i ) { + return arr == null ? -1 : indexOf.call( arr, elem, i ); + }, + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + merge: function( first, second ) { + var len = +second.length, + j = 0, + i = first.length; + + for ( ; j < len; j++ ) { + first[ i++ ] = second[ j ]; + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, invert ) { + var callbackInverse, + matches = [], + i = 0, + length = elems.length, + callbackExpect = !invert; + + // Go through the array, only saving the items + // that pass the validator function + for ( ; i < length; i++ ) { + callbackInverse = !callback( elems[ i ], i ); + if ( callbackInverse !== callbackExpect ) { + matches.push( elems[ i ] ); + } + } + + return matches; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var length, value, + i = 0, + ret = []; + + // Go through the array, translating each of the items to their new values + if ( isArrayLike( elems ) ) { + length = elems.length; + for ( ; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + + // Go through every key on the object, + } else { + for ( i in elems ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + } + + // Flatten any nested arrays + return concat.apply( [], ret ); + }, + + // A global GUID counter for objects + guid: 1, + + // Bind a function to a context, optionally partially applying any + // arguments. + proxy: function( fn, context ) { + var tmp, args, proxy; + + if ( typeof context === "string" ) { + tmp = fn[ context ]; + context = fn; + fn = tmp; + } + + // Quick check to determine if target is callable, in the spec + // this throws a TypeError, but we will just return undefined. + if ( !jQuery.isFunction( fn ) ) { + return undefined; + } + + // Simulated bind + args = slice.call( arguments, 2 ); + proxy = function() { + return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); + }; + + // Set the guid of unique handler to the same of original handler, so it can be removed + proxy.guid = fn.guid = fn.guid || jQuery.guid++; + + return proxy; + }, + + now: Date.now, + + // jQuery.support is not used in Core but other projects attach their + // properties to it so it needs to exist. + support: support +} ); + +if ( typeof Symbol === "function" ) { + jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; +} + +// Populate the class2type map +jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), +function( i, name ) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +} ); + +function isArrayLike( obj ) { + + // Support: real iOS 8.2 only (not reproducible in simulator) + // `in` check used to prevent JIT error (gh-2145) + // hasOwn isn't used here due to false negatives + // regarding Nodelist length in IE + var length = !!obj && "length" in obj && obj.length, + type = jQuery.type( obj ); + + if ( type === "function" || jQuery.isWindow( obj ) ) { + return false; + } + + return type === "array" || length === 0 || + typeof length === "number" && length > 0 && ( length - 1 ) in obj; +} +var Sizzle = +/*! + * Sizzle CSS Selector Engine v2.3.3 + * https://sizzlejs.com/ + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-08-08 + */ +(function( window ) { + +var i, + support, + Expr, + getText, + isXML, + tokenize, + compile, + select, + outermostContext, + sortInput, + hasDuplicate, + + // Local document vars + setDocument, + document, + docElem, + documentIsHTML, + rbuggyQSA, + rbuggyMatches, + matches, + contains, + + // Instance-specific data + expando = "sizzle" + 1 * new Date(), + preferredDoc = window.document, + dirruns = 0, + done = 0, + classCache = createCache(), + tokenCache = createCache(), + compilerCache = createCache(), + sortOrder = function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + } + return 0; + }, + + // Instance methods + hasOwn = ({}).hasOwnProperty, + arr = [], + pop = arr.pop, + push_native = arr.push, + push = arr.push, + slice = arr.slice, + // Use a stripped-down indexOf as it's faster than native + // https://jsperf.com/thor-indexof-vs-for/5 + indexOf = function( list, elem ) { + var i = 0, + len = list.length; + for ( ; i < len; i++ ) { + if ( list[i] === elem ) { + return i; + } + } + return -1; + }, + + booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", + + // Regular expressions + + // http://www.w3.org/TR/css3-selectors/#whitespace + whitespace = "[\\x20\\t\\r\\n\\f]", + + // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier + identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+", + + // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors + attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + + // Operator (capture 2) + "*([*^$|!~]?=)" + whitespace + + // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + + "*\\]", + + pseudos = ":(" + identifier + ")(?:\\((" + + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: + // 1. quoted (capture 3; capture 4 or capture 5) + "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + + // 2. simple (capture 6) + "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + + // 3. anything else (capture 2) + ".*" + + ")\\)|)", + + // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter + rwhitespace = new RegExp( whitespace + "+", "g" ), + rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), + + rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), + rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), + + rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), + + rpseudo = new RegExp( pseudos ), + ridentifier = new RegExp( "^" + identifier + "$" ), + + matchExpr = { + "ID": new RegExp( "^#(" + identifier + ")" ), + "CLASS": new RegExp( "^\\.(" + identifier + ")" ), + "TAG": new RegExp( "^(" + identifier + "|[*])" ), + "ATTR": new RegExp( "^" + attributes ), + "PSEUDO": new RegExp( "^" + pseudos ), + "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), + "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), + // For use in libraries implementing .is() + // We use this for POS matching in `select` + "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) + }, + + rinputs = /^(?:input|select|textarea|button)$/i, + rheader = /^h\d$/i, + + rnative = /^[^{]+\{\s*\[native \w/, + + // Easily-parseable/retrievable ID or TAG or CLASS selectors + rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, + + rsibling = /[+~]/, + + // CSS escapes + // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters + runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), + funescape = function( _, escaped, escapedWhitespace ) { + var high = "0x" + escaped - 0x10000; + // NaN means non-codepoint + // Support: Firefox<24 + // Workaround erroneous numeric interpretation of +"0x" + return high !== high || escapedWhitespace ? + escaped : + high < 0 ? + // BMP codepoint + String.fromCharCode( high + 0x10000 ) : + // Supplemental Plane codepoint (surrogate pair) + String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); + }, + + // CSS string/identifier serialization + // https://drafts.csswg.org/cssom/#common-serializing-idioms + rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, + fcssescape = function( ch, asCodePoint ) { + if ( asCodePoint ) { + + // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER + if ( ch === "\0" ) { + return "\uFFFD"; + } + + // Control characters and (dependent upon position) numbers get escaped as code points + return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; + } + + // Other potentially-special ASCII characters get backslash-escaped + return "\\" + ch; + }, + + // Used for iframes + // See setDocument() + // Removing the function wrapper causes a "Permission Denied" + // error in IE + unloadHandler = function() { + setDocument(); + }, + + disabledAncestor = addCombinator( + function( elem ) { + return elem.disabled === true && ("form" in elem || "label" in elem); + }, + { dir: "parentNode", next: "legend" } + ); + +// Optimize for push.apply( _, NodeList ) +try { + push.apply( + (arr = slice.call( preferredDoc.childNodes )), + preferredDoc.childNodes + ); + // Support: Android<4.0 + // Detect silently failing push.apply + arr[ preferredDoc.childNodes.length ].nodeType; +} catch ( e ) { + push = { apply: arr.length ? + + // Leverage slice if possible + function( target, els ) { + push_native.apply( target, slice.call(els) ); + } : + + // Support: IE<9 + // Otherwise append directly + function( target, els ) { + var j = target.length, + i = 0; + // Can't trust NodeList.length + while ( (target[j++] = els[i++]) ) {} + target.length = j - 1; + } + }; +} + +function Sizzle( selector, context, results, seed ) { + var m, i, elem, nid, match, groups, newSelector, + newContext = context && context.ownerDocument, + + // nodeType defaults to 9, since context defaults to document + nodeType = context ? context.nodeType : 9; + + results = results || []; + + // Return early from calls with invalid selector or context + if ( typeof selector !== "string" || !selector || + nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { + + return results; + } + + // Try to shortcut find operations (as opposed to filters) in HTML documents + if ( !seed ) { + + if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { + setDocument( context ); + } + context = context || document; + + if ( documentIsHTML ) { + + // If the selector is sufficiently simple, try using a "get*By*" DOM method + // (excepting DocumentFragment context, where the methods don't exist) + if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { + + // ID selector + if ( (m = match[1]) ) { + + // Document context + if ( nodeType === 9 ) { + if ( (elem = context.getElementById( m )) ) { + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( elem.id === m ) { + results.push( elem ); + return results; + } + } else { + return results; + } + + // Element context + } else { + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( newContext && (elem = newContext.getElementById( m )) && + contains( context, elem ) && + elem.id === m ) { + + results.push( elem ); + return results; + } + } + + // Type selector + } else if ( match[2] ) { + push.apply( results, context.getElementsByTagName( selector ) ); + return results; + + // Class selector + } else if ( (m = match[3]) && support.getElementsByClassName && + context.getElementsByClassName ) { + + push.apply( results, context.getElementsByClassName( m ) ); + return results; + } + } + + // Take advantage of querySelectorAll + if ( support.qsa && + !compilerCache[ selector + " " ] && + (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { + + if ( nodeType !== 1 ) { + newContext = context; + newSelector = selector; + + // qSA looks outside Element context, which is not what we want + // Thanks to Andrew Dupont for this workaround technique + // Support: IE <=8 + // Exclude object elements + } else if ( context.nodeName.toLowerCase() !== "object" ) { + + // Capture the context ID, setting it first if necessary + if ( (nid = context.getAttribute( "id" )) ) { + nid = nid.replace( rcssescape, fcssescape ); + } else { + context.setAttribute( "id", (nid = expando) ); + } + + // Prefix every selector in the list + groups = tokenize( selector ); + i = groups.length; + while ( i-- ) { + groups[i] = "#" + nid + " " + toSelector( groups[i] ); + } + newSelector = groups.join( "," ); + + // Expand context for sibling selectors + newContext = rsibling.test( selector ) && testContext( context.parentNode ) || + context; + } + + if ( newSelector ) { + try { + push.apply( results, + newContext.querySelectorAll( newSelector ) + ); + return results; + } catch ( qsaError ) { + } finally { + if ( nid === expando ) { + context.removeAttribute( "id" ); + } + } + } + } + } + } + + // All others + return select( selector.replace( rtrim, "$1" ), context, results, seed ); +} + +/** + * Create key-value caches of limited size + * @returns {function(string, object)} Returns the Object data after storing it on itself with + * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) + * deleting the oldest entry + */ +function createCache() { + var keys = []; + + function cache( key, value ) { + // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) + if ( keys.push( key + " " ) > Expr.cacheLength ) { + // Only keep the most recent entries + delete cache[ keys.shift() ]; + } + return (cache[ key + " " ] = value); + } + return cache; +} + +/** + * Mark a function for special use by Sizzle + * @param {Function} fn The function to mark + */ +function markFunction( fn ) { + fn[ expando ] = true; + return fn; +} + +/** + * Support testing using an element + * @param {Function} fn Passed the created element and returns a boolean result + */ +function assert( fn ) { + var el = document.createElement("fieldset"); + + try { + return !!fn( el ); + } catch (e) { + return false; + } finally { + // Remove from its parent by default + if ( el.parentNode ) { + el.parentNode.removeChild( el ); + } + // release memory in IE + el = null; + } +} + +/** + * Adds the same handler for all of the specified attrs + * @param {String} attrs Pipe-separated list of attributes + * @param {Function} handler The method that will be applied + */ +function addHandle( attrs, handler ) { + var arr = attrs.split("|"), + i = arr.length; + + while ( i-- ) { + Expr.attrHandle[ arr[i] ] = handler; + } +} + +/** + * Checks document order of two siblings + * @param {Element} a + * @param {Element} b + * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b + */ +function siblingCheck( a, b ) { + var cur = b && a, + diff = cur && a.nodeType === 1 && b.nodeType === 1 && + a.sourceIndex - b.sourceIndex; + + // Use IE sourceIndex if available on both nodes + if ( diff ) { + return diff; + } + + // Check if b follows a + if ( cur ) { + while ( (cur = cur.nextSibling) ) { + if ( cur === b ) { + return -1; + } + } + } + + return a ? 1 : -1; +} + +/** + * Returns a function to use in pseudos for input types + * @param {String} type + */ +function createInputPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for buttons + * @param {String} type + */ +function createButtonPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for :enabled/:disabled + * @param {Boolean} disabled true for :disabled; false for :enabled + */ +function createDisabledPseudo( disabled ) { + + // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable + return function( elem ) { + + // Only certain elements can match :enabled or :disabled + // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled + // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled + if ( "form" in elem ) { + + // Check for inherited disabledness on relevant non-disabled elements: + // * listed form-associated elements in a disabled fieldset + // https://html.spec.whatwg.org/multipage/forms.html#category-listed + // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled + // * option elements in a disabled optgroup + // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled + // All such elements have a "form" property. + if ( elem.parentNode && elem.disabled === false ) { + + // Option elements defer to a parent optgroup if present + if ( "label" in elem ) { + if ( "label" in elem.parentNode ) { + return elem.parentNode.disabled === disabled; + } else { + return elem.disabled === disabled; + } + } + + // Support: IE 6 - 11 + // Use the isDisabled shortcut property to check for disabled fieldset ancestors + return elem.isDisabled === disabled || + + // Where there is no isDisabled, check manually + /* jshint -W018 */ + elem.isDisabled !== !disabled && + disabledAncestor( elem ) === disabled; + } + + return elem.disabled === disabled; + + // Try to winnow out elements that can't be disabled before trusting the disabled property. + // Some victims get caught in our net (label, legend, menu, track), but it shouldn't + // even exist on them, let alone have a boolean value. + } else if ( "label" in elem ) { + return elem.disabled === disabled; + } + + // Remaining elements are neither :enabled nor :disabled + return false; + }; +} + +/** + * Returns a function to use in pseudos for positionals + * @param {Function} fn + */ +function createPositionalPseudo( fn ) { + return markFunction(function( argument ) { + argument = +argument; + return markFunction(function( seed, matches ) { + var j, + matchIndexes = fn( [], seed.length, argument ), + i = matchIndexes.length; + + // Match elements found at the specified indexes + while ( i-- ) { + if ( seed[ (j = matchIndexes[i]) ] ) { + seed[j] = !(matches[j] = seed[j]); + } + } + }); + }); +} + +/** + * Checks a node for validity as a Sizzle context + * @param {Element|Object=} context + * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value + */ +function testContext( context ) { + return context && typeof context.getElementsByTagName !== "undefined" && context; +} + +// Expose support vars for convenience +support = Sizzle.support = {}; + +/** + * Detects XML nodes + * @param {Element|Object} elem An element or a document + * @returns {Boolean} True iff elem is a non-HTML XML node + */ +isXML = Sizzle.isXML = function( elem ) { + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = elem && (elem.ownerDocument || elem).documentElement; + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +/** + * Sets document-related variables once based on the current document + * @param {Element|Object} [doc] An element or document object to use to set the document + * @returns {Object} Returns the current document + */ +setDocument = Sizzle.setDocument = function( node ) { + var hasCompare, subWindow, + doc = node ? node.ownerDocument || node : preferredDoc; + + // Return early if doc is invalid or already selected + if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { + return document; + } + + // Update global variables + document = doc; + docElem = document.documentElement; + documentIsHTML = !isXML( document ); + + // Support: IE 9-11, Edge + // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) + if ( preferredDoc !== document && + (subWindow = document.defaultView) && subWindow.top !== subWindow ) { + + // Support: IE 11, Edge + if ( subWindow.addEventListener ) { + subWindow.addEventListener( "unload", unloadHandler, false ); + + // Support: IE 9 - 10 only + } else if ( subWindow.attachEvent ) { + subWindow.attachEvent( "onunload", unloadHandler ); + } + } + + /* Attributes + ---------------------------------------------------------------------- */ + + // Support: IE<8 + // Verify that getAttribute really returns attributes and not properties + // (excepting IE8 booleans) + support.attributes = assert(function( el ) { + el.className = "i"; + return !el.getAttribute("className"); + }); + + /* getElement(s)By* + ---------------------------------------------------------------------- */ + + // Check if getElementsByTagName("*") returns only elements + support.getElementsByTagName = assert(function( el ) { + el.appendChild( document.createComment("") ); + return !el.getElementsByTagName("*").length; + }); + + // Support: IE<9 + support.getElementsByClassName = rnative.test( document.getElementsByClassName ); + + // Support: IE<10 + // Check if getElementById returns elements by name + // The broken getElementById methods don't pick up programmatically-set names, + // so use a roundabout getElementsByName test + support.getById = assert(function( el ) { + docElem.appendChild( el ).id = expando; + return !document.getElementsByName || !document.getElementsByName( expando ).length; + }); + + // ID filter and find + if ( support.getById ) { + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + return elem.getAttribute("id") === attrId; + }; + }; + Expr.find["ID"] = function( id, context ) { + if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { + var elem = context.getElementById( id ); + return elem ? [ elem ] : []; + } + }; + } else { + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + var node = typeof elem.getAttributeNode !== "undefined" && + elem.getAttributeNode("id"); + return node && node.value === attrId; + }; + }; + + // Support: IE 6 - 7 only + // getElementById is not reliable as a find shortcut + Expr.find["ID"] = function( id, context ) { + if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { + var node, i, elems, + elem = context.getElementById( id ); + + if ( elem ) { + + // Verify the id attribute + node = elem.getAttributeNode("id"); + if ( node && node.value === id ) { + return [ elem ]; + } + + // Fall back on getElementsByName + elems = context.getElementsByName( id ); + i = 0; + while ( (elem = elems[i++]) ) { + node = elem.getAttributeNode("id"); + if ( node && node.value === id ) { + return [ elem ]; + } + } + } + + return []; + } + }; + } + + // Tag + Expr.find["TAG"] = support.getElementsByTagName ? + function( tag, context ) { + if ( typeof context.getElementsByTagName !== "undefined" ) { + return context.getElementsByTagName( tag ); + + // DocumentFragment nodes don't have gEBTN + } else if ( support.qsa ) { + return context.querySelectorAll( tag ); + } + } : + + function( tag, context ) { + var elem, + tmp = [], + i = 0, + // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too + results = context.getElementsByTagName( tag ); + + // Filter out possible comments + if ( tag === "*" ) { + while ( (elem = results[i++]) ) { + if ( elem.nodeType === 1 ) { + tmp.push( elem ); + } + } + + return tmp; + } + return results; + }; + + // Class + Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { + if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { + return context.getElementsByClassName( className ); + } + }; + + /* QSA/matchesSelector + ---------------------------------------------------------------------- */ + + // QSA and matchesSelector support + + // matchesSelector(:active) reports false when true (IE9/Opera 11.5) + rbuggyMatches = []; + + // qSa(:focus) reports false when true (Chrome 21) + // We allow this because of a bug in IE8/9 that throws an error + // whenever `document.activeElement` is accessed on an iframe + // So, we allow :focus to pass through QSA all the time to avoid the IE error + // See https://bugs.jquery.com/ticket/13378 + rbuggyQSA = []; + + if ( (support.qsa = rnative.test( document.querySelectorAll )) ) { + // Build QSA regex + // Regex strategy adopted from Diego Perini + assert(function( el ) { + // Select is set to empty string on purpose + // This is to test IE's treatment of not explicitly + // setting a boolean content attribute, + // since its presence should be enough + // https://bugs.jquery.com/ticket/12359 + docElem.appendChild( el ).innerHTML = "" + + ""; + + // Support: IE8, Opera 11-12.16 + // Nothing should be selected when empty strings follow ^= or $= or *= + // The test attribute must be unknown in Opera but "safe" for WinRT + // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section + if ( el.querySelectorAll("[msallowcapture^='']").length ) { + rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); + } + + // Support: IE8 + // Boolean attributes and "value" are not treated correctly + if ( !el.querySelectorAll("[selected]").length ) { + rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); + } + + // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ + if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { + rbuggyQSA.push("~="); + } + + // Webkit/Opera - :checked should return selected option elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + // IE8 throws error here and will not see later tests + if ( !el.querySelectorAll(":checked").length ) { + rbuggyQSA.push(":checked"); + } + + // Support: Safari 8+, iOS 8+ + // https://bugs.webkit.org/show_bug.cgi?id=136851 + // In-page `selector#id sibling-combinator selector` fails + if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { + rbuggyQSA.push(".#.+[+~]"); + } + }); + + assert(function( el ) { + el.innerHTML = "" + + ""; + + // Support: Windows 8 Native Apps + // The type and name attributes are restricted during .innerHTML assignment + var input = document.createElement("input"); + input.setAttribute( "type", "hidden" ); + el.appendChild( input ).setAttribute( "name", "D" ); + + // Support: IE8 + // Enforce case-sensitivity of name attribute + if ( el.querySelectorAll("[name=d]").length ) { + rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); + } + + // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) + // IE8 throws error here and will not see later tests + if ( el.querySelectorAll(":enabled").length !== 2 ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } + + // Support: IE9-11+ + // IE's :disabled selector does not pick up the children of disabled fieldsets + docElem.appendChild( el ).disabled = true; + if ( el.querySelectorAll(":disabled").length !== 2 ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } + + // Opera 10-11 does not throw on post-comma invalid pseudos + el.querySelectorAll("*,:x"); + rbuggyQSA.push(",.*:"); + }); + } + + if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || + docElem.webkitMatchesSelector || + docElem.mozMatchesSelector || + docElem.oMatchesSelector || + docElem.msMatchesSelector) )) ) { + + assert(function( el ) { + // Check to see if it's possible to do matchesSelector + // on a disconnected node (IE 9) + support.disconnectedMatch = matches.call( el, "*" ); + + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( el, "[s!='']:x" ); + rbuggyMatches.push( "!=", pseudos ); + }); + } + + rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); + rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); + + /* Contains + ---------------------------------------------------------------------- */ + hasCompare = rnative.test( docElem.compareDocumentPosition ); + + // Element contains another + // Purposefully self-exclusive + // As in, an element does not contain itself + contains = hasCompare || rnative.test( docElem.contains ) ? + function( a, b ) { + var adown = a.nodeType === 9 ? a.documentElement : a, + bup = b && b.parentNode; + return a === bup || !!( bup && bup.nodeType === 1 && ( + adown.contains ? + adown.contains( bup ) : + a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 + )); + } : + function( a, b ) { + if ( b ) { + while ( (b = b.parentNode) ) { + if ( b === a ) { + return true; + } + } + } + return false; + }; + + /* Sorting + ---------------------------------------------------------------------- */ + + // Document order sorting + sortOrder = hasCompare ? + function( a, b ) { + + // Flag for duplicate removal + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + // Sort on method existence if only one input has compareDocumentPosition + var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; + if ( compare ) { + return compare; + } + + // Calculate position if both inputs belong to the same document + compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? + a.compareDocumentPosition( b ) : + + // Otherwise we know they are disconnected + 1; + + // Disconnected nodes + if ( compare & 1 || + (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { + + // Choose the first element that is related to our preferred document + if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { + return -1; + } + if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { + return 1; + } + + // Maintain original order + return sortInput ? + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + 0; + } + + return compare & 4 ? -1 : 1; + } : + function( a, b ) { + // Exit early if the nodes are identical + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + var cur, + i = 0, + aup = a.parentNode, + bup = b.parentNode, + ap = [ a ], + bp = [ b ]; + + // Parentless nodes are either documents or disconnected + if ( !aup || !bup ) { + return a === document ? -1 : + b === document ? 1 : + aup ? -1 : + bup ? 1 : + sortInput ? + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + 0; + + // If the nodes are siblings, we can do a quick check + } else if ( aup === bup ) { + return siblingCheck( a, b ); + } + + // Otherwise we need full lists of their ancestors for comparison + cur = a; + while ( (cur = cur.parentNode) ) { + ap.unshift( cur ); + } + cur = b; + while ( (cur = cur.parentNode) ) { + bp.unshift( cur ); + } + + // Walk down the tree looking for a discrepancy + while ( ap[i] === bp[i] ) { + i++; + } + + return i ? + // Do a sibling check if the nodes have a common ancestor + siblingCheck( ap[i], bp[i] ) : + + // Otherwise nodes in our document sort first + ap[i] === preferredDoc ? -1 : + bp[i] === preferredDoc ? 1 : + 0; + }; + + return document; +}; + +Sizzle.matches = function( expr, elements ) { + return Sizzle( expr, null, null, elements ); +}; + +Sizzle.matchesSelector = function( elem, expr ) { + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + // Make sure that attribute selectors are quoted + expr = expr.replace( rattributeQuotes, "='$1']" ); + + if ( support.matchesSelector && documentIsHTML && + !compilerCache[ expr + " " ] && + ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && + ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { + + try { + var ret = matches.call( elem, expr ); + + // IE 9's matchesSelector returns false on disconnected nodes + if ( ret || support.disconnectedMatch || + // As well, disconnected nodes are said to be in a document + // fragment in IE 9 + elem.document && elem.document.nodeType !== 11 ) { + return ret; + } + } catch (e) {} + } + + return Sizzle( expr, document, null, [ elem ] ).length > 0; +}; + +Sizzle.contains = function( context, elem ) { + // Set document vars if needed + if ( ( context.ownerDocument || context ) !== document ) { + setDocument( context ); + } + return contains( context, elem ); +}; + +Sizzle.attr = function( elem, name ) { + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + var fn = Expr.attrHandle[ name.toLowerCase() ], + // Don't get fooled by Object.prototype properties (jQuery #13807) + val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? + fn( elem, name, !documentIsHTML ) : + undefined; + + return val !== undefined ? + val : + support.attributes || !documentIsHTML ? + elem.getAttribute( name ) : + (val = elem.getAttributeNode(name)) && val.specified ? + val.value : + null; +}; + +Sizzle.escape = function( sel ) { + return (sel + "").replace( rcssescape, fcssescape ); +}; + +Sizzle.error = function( msg ) { + throw new Error( "Syntax error, unrecognized expression: " + msg ); +}; + +/** + * Document sorting and removing duplicates + * @param {ArrayLike} results + */ +Sizzle.uniqueSort = function( results ) { + var elem, + duplicates = [], + j = 0, + i = 0; + + // Unless we *know* we can detect duplicates, assume their presence + hasDuplicate = !support.detectDuplicates; + sortInput = !support.sortStable && results.slice( 0 ); + results.sort( sortOrder ); + + if ( hasDuplicate ) { + while ( (elem = results[i++]) ) { + if ( elem === results[ i ] ) { + j = duplicates.push( i ); + } + } + while ( j-- ) { + results.splice( duplicates[ j ], 1 ); + } + } + + // Clear input after sorting to release objects + // See https://github.com/jquery/sizzle/pull/225 + sortInput = null; + + return results; +}; + +/** + * Utility function for retrieving the text value of an array of DOM nodes + * @param {Array|Element} elem + */ +getText = Sizzle.getText = function( elem ) { + var node, + ret = "", + i = 0, + nodeType = elem.nodeType; + + if ( !nodeType ) { + // If no nodeType, this is expected to be an array + while ( (node = elem[i++]) ) { + // Do not traverse comment nodes + ret += getText( node ); + } + } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { + // Use textContent for elements + // innerText usage removed for consistency of new lines (jQuery #11153) + if ( typeof elem.textContent === "string" ) { + return elem.textContent; + } else { + // Traverse its children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + ret += getText( elem ); + } + } + } else if ( nodeType === 3 || nodeType === 4 ) { + return elem.nodeValue; + } + // Do not include comment or processing instruction nodes + + return ret; +}; + +Expr = Sizzle.selectors = { + + // Can be adjusted by the user + cacheLength: 50, + + createPseudo: markFunction, + + match: matchExpr, + + attrHandle: {}, + + find: {}, + + relative: { + ">": { dir: "parentNode", first: true }, + " ": { dir: "parentNode" }, + "+": { dir: "previousSibling", first: true }, + "~": { dir: "previousSibling" } + }, + + preFilter: { + "ATTR": function( match ) { + match[1] = match[1].replace( runescape, funescape ); + + // Move the given value to match[3] whether quoted or unquoted + match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); + + if ( match[2] === "~=" ) { + match[3] = " " + match[3] + " "; + } + + return match.slice( 0, 4 ); + }, + + "CHILD": function( match ) { + /* matches from matchExpr["CHILD"] + 1 type (only|nth|...) + 2 what (child|of-type) + 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) + 4 xn-component of xn+y argument ([+-]?\d*n|) + 5 sign of xn-component + 6 x of xn-component + 7 sign of y-component + 8 y of y-component + */ + match[1] = match[1].toLowerCase(); + + if ( match[1].slice( 0, 3 ) === "nth" ) { + // nth-* requires argument + if ( !match[3] ) { + Sizzle.error( match[0] ); + } + + // numeric x and y parameters for Expr.filter.CHILD + // remember that false/true cast respectively to 0/1 + match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); + match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); + + // other types prohibit arguments + } else if ( match[3] ) { + Sizzle.error( match[0] ); + } + + return match; + }, + + "PSEUDO": function( match ) { + var excess, + unquoted = !match[6] && match[2]; + + if ( matchExpr["CHILD"].test( match[0] ) ) { + return null; + } + + // Accept quoted arguments as-is + if ( match[3] ) { + match[2] = match[4] || match[5] || ""; + + // Strip excess characters from unquoted arguments + } else if ( unquoted && rpseudo.test( unquoted ) && + // Get excess from tokenize (recursively) + (excess = tokenize( unquoted, true )) && + // advance to the next closing parenthesis + (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { + + // excess is a negative index + match[0] = match[0].slice( 0, excess ); + match[2] = unquoted.slice( 0, excess ); + } + + // Return only captures needed by the pseudo filter method (type and argument) + return match.slice( 0, 3 ); + } + }, + + filter: { + + "TAG": function( nodeNameSelector ) { + var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); + return nodeNameSelector === "*" ? + function() { return true; } : + function( elem ) { + return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; + }; + }, + + "CLASS": function( className ) { + var pattern = classCache[ className + " " ]; + + return pattern || + (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && + classCache( className, function( elem ) { + return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" ); + }); + }, + + "ATTR": function( name, operator, check ) { + return function( elem ) { + var result = Sizzle.attr( elem, name ); + + if ( result == null ) { + return operator === "!="; + } + if ( !operator ) { + return true; + } + + result += ""; + + return operator === "=" ? result === check : + operator === "!=" ? result !== check : + operator === "^=" ? check && result.indexOf( check ) === 0 : + operator === "*=" ? check && result.indexOf( check ) > -1 : + operator === "$=" ? check && result.slice( -check.length ) === check : + operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : + operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : + false; + }; + }, + + "CHILD": function( type, what, argument, first, last ) { + var simple = type.slice( 0, 3 ) !== "nth", + forward = type.slice( -4 ) !== "last", + ofType = what === "of-type"; + + return first === 1 && last === 0 ? + + // Shortcut for :nth-*(n) + function( elem ) { + return !!elem.parentNode; + } : + + function( elem, context, xml ) { + var cache, uniqueCache, outerCache, node, nodeIndex, start, + dir = simple !== forward ? "nextSibling" : "previousSibling", + parent = elem.parentNode, + name = ofType && elem.nodeName.toLowerCase(), + useCache = !xml && !ofType, + diff = false; + + if ( parent ) { + + // :(first|last|only)-(child|of-type) + if ( simple ) { + while ( dir ) { + node = elem; + while ( (node = node[ dir ]) ) { + if ( ofType ? + node.nodeName.toLowerCase() === name : + node.nodeType === 1 ) { + + return false; + } + } + // Reverse direction for :only-* (if we haven't yet done so) + start = dir = type === "only" && !start && "nextSibling"; + } + return true; + } + + start = [ forward ? parent.firstChild : parent.lastChild ]; + + // non-xml :nth-child(...) stores cache data on `parent` + if ( forward && useCache ) { + + // Seek `elem` from a previously-cached index + + // ...in a gzip-friendly way + node = parent; + outerCache = node[ expando ] || (node[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + (outerCache[ node.uniqueID ] = {}); + + cache = uniqueCache[ type ] || []; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex && cache[ 2 ]; + node = nodeIndex && parent.childNodes[ nodeIndex ]; + + while ( (node = ++nodeIndex && node && node[ dir ] || + + // Fallback to seeking `elem` from the start + (diff = nodeIndex = 0) || start.pop()) ) { + + // When found, cache indexes on `parent` and break + if ( node.nodeType === 1 && ++diff && node === elem ) { + uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; + break; + } + } + + } else { + // Use previously-cached element index if available + if ( useCache ) { + // ...in a gzip-friendly way + node = elem; + outerCache = node[ expando ] || (node[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + (outerCache[ node.uniqueID ] = {}); + + cache = uniqueCache[ type ] || []; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex; + } + + // xml :nth-child(...) + // or :nth-last-child(...) or :nth(-last)?-of-type(...) + if ( diff === false ) { + // Use the same loop as above to seek `elem` from the start + while ( (node = ++nodeIndex && node && node[ dir ] || + (diff = nodeIndex = 0) || start.pop()) ) { + + if ( ( ofType ? + node.nodeName.toLowerCase() === name : + node.nodeType === 1 ) && + ++diff ) { + + // Cache the index of each encountered element + if ( useCache ) { + outerCache = node[ expando ] || (node[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + (outerCache[ node.uniqueID ] = {}); + + uniqueCache[ type ] = [ dirruns, diff ]; + } + + if ( node === elem ) { + break; + } + } + } + } + } + + // Incorporate the offset, then check against cycle size + diff -= last; + return diff === first || ( diff % first === 0 && diff / first >= 0 ); + } + }; + }, + + "PSEUDO": function( pseudo, argument ) { + // pseudo-class names are case-insensitive + // http://www.w3.org/TR/selectors/#pseudo-classes + // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters + // Remember that setFilters inherits from pseudos + var args, + fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || + Sizzle.error( "unsupported pseudo: " + pseudo ); + + // The user may use createPseudo to indicate that + // arguments are needed to create the filter function + // just as Sizzle does + if ( fn[ expando ] ) { + return fn( argument ); + } + + // But maintain support for old signatures + if ( fn.length > 1 ) { + args = [ pseudo, pseudo, "", argument ]; + return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? + markFunction(function( seed, matches ) { + var idx, + matched = fn( seed, argument ), + i = matched.length; + while ( i-- ) { + idx = indexOf( seed, matched[i] ); + seed[ idx ] = !( matches[ idx ] = matched[i] ); + } + }) : + function( elem ) { + return fn( elem, 0, args ); + }; + } + + return fn; + } + }, + + pseudos: { + // Potentially complex pseudos + "not": markFunction(function( selector ) { + // Trim the selector passed to compile + // to avoid treating leading and trailing + // spaces as combinators + var input = [], + results = [], + matcher = compile( selector.replace( rtrim, "$1" ) ); + + return matcher[ expando ] ? + markFunction(function( seed, matches, context, xml ) { + var elem, + unmatched = matcher( seed, null, xml, [] ), + i = seed.length; + + // Match elements unmatched by `matcher` + while ( i-- ) { + if ( (elem = unmatched[i]) ) { + seed[i] = !(matches[i] = elem); + } + } + }) : + function( elem, context, xml ) { + input[0] = elem; + matcher( input, null, xml, results ); + // Don't keep the element (issue #299) + input[0] = null; + return !results.pop(); + }; + }), + + "has": markFunction(function( selector ) { + return function( elem ) { + return Sizzle( selector, elem ).length > 0; + }; + }), + + "contains": markFunction(function( text ) { + text = text.replace( runescape, funescape ); + return function( elem ) { + return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; + }; + }), + + // "Whether an element is represented by a :lang() selector + // is based solely on the element's language value + // being equal to the identifier C, + // or beginning with the identifier C immediately followed by "-". + // The matching of C against the element's language value is performed case-insensitively. + // The identifier C does not have to be a valid language name." + // http://www.w3.org/TR/selectors/#lang-pseudo + "lang": markFunction( function( lang ) { + // lang value must be a valid identifier + if ( !ridentifier.test(lang || "") ) { + Sizzle.error( "unsupported lang: " + lang ); + } + lang = lang.replace( runescape, funescape ).toLowerCase(); + return function( elem ) { + var elemLang; + do { + if ( (elemLang = documentIsHTML ? + elem.lang : + elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { + + elemLang = elemLang.toLowerCase(); + return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; + } + } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); + return false; + }; + }), + + // Miscellaneous + "target": function( elem ) { + var hash = window.location && window.location.hash; + return hash && hash.slice( 1 ) === elem.id; + }, + + "root": function( elem ) { + return elem === docElem; + }, + + "focus": function( elem ) { + return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); + }, + + // Boolean properties + "enabled": createDisabledPseudo( false ), + "disabled": createDisabledPseudo( true ), + + "checked": function( elem ) { + // In CSS3, :checked should return both checked and selected elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + var nodeName = elem.nodeName.toLowerCase(); + return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); + }, + + "selected": function( elem ) { + // Accessing this property makes selected-by-default + // options in Safari work properly + if ( elem.parentNode ) { + elem.parentNode.selectedIndex; + } + + return elem.selected === true; + }, + + // Contents + "empty": function( elem ) { + // http://www.w3.org/TR/selectors/#empty-pseudo + // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), + // but not by others (comment: 8; processing instruction: 7; etc.) + // nodeType < 6 works because attributes (2) do not appear as children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + if ( elem.nodeType < 6 ) { + return false; + } + } + return true; + }, + + "parent": function( elem ) { + return !Expr.pseudos["empty"]( elem ); + }, + + // Element/input types + "header": function( elem ) { + return rheader.test( elem.nodeName ); + }, + + "input": function( elem ) { + return rinputs.test( elem.nodeName ); + }, + + "button": function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === "button" || name === "button"; + }, + + "text": function( elem ) { + var attr; + return elem.nodeName.toLowerCase() === "input" && + elem.type === "text" && + + // Support: IE<8 + // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" + ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); + }, + + // Position-in-collection + "first": createPositionalPseudo(function() { + return [ 0 ]; + }), + + "last": createPositionalPseudo(function( matchIndexes, length ) { + return [ length - 1 ]; + }), + + "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { + return [ argument < 0 ? argument + length : argument ]; + }), + + "even": createPositionalPseudo(function( matchIndexes, length ) { + var i = 0; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "odd": createPositionalPseudo(function( matchIndexes, length ) { + var i = 1; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; --i >= 0; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; ++i < length; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }) + } +}; + +Expr.pseudos["nth"] = Expr.pseudos["eq"]; + +// Add button/input type pseudos +for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { + Expr.pseudos[ i ] = createInputPseudo( i ); +} +for ( i in { submit: true, reset: true } ) { + Expr.pseudos[ i ] = createButtonPseudo( i ); +} + +// Easy API for creating new setFilters +function setFilters() {} +setFilters.prototype = Expr.filters = Expr.pseudos; +Expr.setFilters = new setFilters(); + +tokenize = Sizzle.tokenize = function( selector, parseOnly ) { + var matched, match, tokens, type, + soFar, groups, preFilters, + cached = tokenCache[ selector + " " ]; + + if ( cached ) { + return parseOnly ? 0 : cached.slice( 0 ); + } + + soFar = selector; + groups = []; + preFilters = Expr.preFilter; + + while ( soFar ) { + + // Comma and first run + if ( !matched || (match = rcomma.exec( soFar )) ) { + if ( match ) { + // Don't consume trailing commas as valid + soFar = soFar.slice( match[0].length ) || soFar; + } + groups.push( (tokens = []) ); + } + + matched = false; + + // Combinators + if ( (match = rcombinators.exec( soFar )) ) { + matched = match.shift(); + tokens.push({ + value: matched, + // Cast descendant combinators to space + type: match[0].replace( rtrim, " " ) + }); + soFar = soFar.slice( matched.length ); + } + + // Filters + for ( type in Expr.filter ) { + if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || + (match = preFilters[ type ]( match ))) ) { + matched = match.shift(); + tokens.push({ + value: matched, + type: type, + matches: match + }); + soFar = soFar.slice( matched.length ); + } + } + + if ( !matched ) { + break; + } + } + + // Return the length of the invalid excess + // if we're just parsing + // Otherwise, throw an error or return tokens + return parseOnly ? + soFar.length : + soFar ? + Sizzle.error( selector ) : + // Cache the tokens + tokenCache( selector, groups ).slice( 0 ); +}; + +function toSelector( tokens ) { + var i = 0, + len = tokens.length, + selector = ""; + for ( ; i < len; i++ ) { + selector += tokens[i].value; + } + return selector; +} + +function addCombinator( matcher, combinator, base ) { + var dir = combinator.dir, + skip = combinator.next, + key = skip || dir, + checkNonElements = base && key === "parentNode", + doneName = done++; + + return combinator.first ? + // Check against closest ancestor/preceding element + function( elem, context, xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + return matcher( elem, context, xml ); + } + } + return false; + } : + + // Check against all ancestor/preceding elements + function( elem, context, xml ) { + var oldCache, uniqueCache, outerCache, + newCache = [ dirruns, doneName ]; + + // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching + if ( xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + if ( matcher( elem, context, xml ) ) { + return true; + } + } + } + } else { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + outerCache = elem[ expando ] || (elem[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {}); + + if ( skip && skip === elem.nodeName.toLowerCase() ) { + elem = elem[ dir ] || elem; + } else if ( (oldCache = uniqueCache[ key ]) && + oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { + + // Assign to newCache so results back-propagate to previous elements + return (newCache[ 2 ] = oldCache[ 2 ]); + } else { + // Reuse newcache so results back-propagate to previous elements + uniqueCache[ key ] = newCache; + + // A match means we're done; a fail means we have to keep checking + if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { + return true; + } + } + } + } + } + return false; + }; +} + +function elementMatcher( matchers ) { + return matchers.length > 1 ? + function( elem, context, xml ) { + var i = matchers.length; + while ( i-- ) { + if ( !matchers[i]( elem, context, xml ) ) { + return false; + } + } + return true; + } : + matchers[0]; +} + +function multipleContexts( selector, contexts, results ) { + var i = 0, + len = contexts.length; + for ( ; i < len; i++ ) { + Sizzle( selector, contexts[i], results ); + } + return results; +} + +function condense( unmatched, map, filter, context, xml ) { + var elem, + newUnmatched = [], + i = 0, + len = unmatched.length, + mapped = map != null; + + for ( ; i < len; i++ ) { + if ( (elem = unmatched[i]) ) { + if ( !filter || filter( elem, context, xml ) ) { + newUnmatched.push( elem ); + if ( mapped ) { + map.push( i ); + } + } + } + } + + return newUnmatched; +} + +function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { + if ( postFilter && !postFilter[ expando ] ) { + postFilter = setMatcher( postFilter ); + } + if ( postFinder && !postFinder[ expando ] ) { + postFinder = setMatcher( postFinder, postSelector ); + } + return markFunction(function( seed, results, context, xml ) { + var temp, i, elem, + preMap = [], + postMap = [], + preexisting = results.length, + + // Get initial elements from seed or context + elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), + + // Prefilter to get matcher input, preserving a map for seed-results synchronization + matcherIn = preFilter && ( seed || !selector ) ? + condense( elems, preMap, preFilter, context, xml ) : + elems, + + matcherOut = matcher ? + // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, + postFinder || ( seed ? preFilter : preexisting || postFilter ) ? + + // ...intermediate processing is necessary + [] : + + // ...otherwise use results directly + results : + matcherIn; + + // Find primary matches + if ( matcher ) { + matcher( matcherIn, matcherOut, context, xml ); + } + + // Apply postFilter + if ( postFilter ) { + temp = condense( matcherOut, postMap ); + postFilter( temp, [], context, xml ); + + // Un-match failing elements by moving them back to matcherIn + i = temp.length; + while ( i-- ) { + if ( (elem = temp[i]) ) { + matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); + } + } + } + + if ( seed ) { + if ( postFinder || preFilter ) { + if ( postFinder ) { + // Get the final matcherOut by condensing this intermediate into postFinder contexts + temp = []; + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) ) { + // Restore matcherIn since elem is not yet a final match + temp.push( (matcherIn[i] = elem) ); + } + } + postFinder( null, (matcherOut = []), temp, xml ); + } + + // Move matched elements from seed to results to keep them synchronized + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) && + (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) { + + seed[temp] = !(results[temp] = elem); + } + } + } + + // Add elements to results, through postFinder if defined + } else { + matcherOut = condense( + matcherOut === results ? + matcherOut.splice( preexisting, matcherOut.length ) : + matcherOut + ); + if ( postFinder ) { + postFinder( null, results, matcherOut, xml ); + } else { + push.apply( results, matcherOut ); + } + } + }); +} + +function matcherFromTokens( tokens ) { + var checkContext, matcher, j, + len = tokens.length, + leadingRelative = Expr.relative[ tokens[0].type ], + implicitRelative = leadingRelative || Expr.relative[" "], + i = leadingRelative ? 1 : 0, + + // The foundational matcher ensures that elements are reachable from top-level context(s) + matchContext = addCombinator( function( elem ) { + return elem === checkContext; + }, implicitRelative, true ), + matchAnyContext = addCombinator( function( elem ) { + return indexOf( checkContext, elem ) > -1; + }, implicitRelative, true ), + matchers = [ function( elem, context, xml ) { + var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( + (checkContext = context).nodeType ? + matchContext( elem, context, xml ) : + matchAnyContext( elem, context, xml ) ); + // Avoid hanging onto element (issue #299) + checkContext = null; + return ret; + } ]; + + for ( ; i < len; i++ ) { + if ( (matcher = Expr.relative[ tokens[i].type ]) ) { + matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; + } else { + matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); + + // Return special upon seeing a positional matcher + if ( matcher[ expando ] ) { + // Find the next relative operator (if any) for proper handling + j = ++i; + for ( ; j < len; j++ ) { + if ( Expr.relative[ tokens[j].type ] ) { + break; + } + } + return setMatcher( + i > 1 && elementMatcher( matchers ), + i > 1 && toSelector( + // If the preceding token was a descendant combinator, insert an implicit any-element `*` + tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) + ).replace( rtrim, "$1" ), + matcher, + i < j && matcherFromTokens( tokens.slice( i, j ) ), + j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), + j < len && toSelector( tokens ) + ); + } + matchers.push( matcher ); + } + } + + return elementMatcher( matchers ); +} + +function matcherFromGroupMatchers( elementMatchers, setMatchers ) { + var bySet = setMatchers.length > 0, + byElement = elementMatchers.length > 0, + superMatcher = function( seed, context, xml, results, outermost ) { + var elem, j, matcher, + matchedCount = 0, + i = "0", + unmatched = seed && [], + setMatched = [], + contextBackup = outermostContext, + // We must always have either seed elements or outermost context + elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), + // Use integer dirruns iff this is the outermost matcher + dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), + len = elems.length; + + if ( outermost ) { + outermostContext = context === document || context || outermost; + } + + // Add elements passing elementMatchers directly to results + // Support: IE<9, Safari + // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id + for ( ; i !== len && (elem = elems[i]) != null; i++ ) { + if ( byElement && elem ) { + j = 0; + if ( !context && elem.ownerDocument !== document ) { + setDocument( elem ); + xml = !documentIsHTML; + } + while ( (matcher = elementMatchers[j++]) ) { + if ( matcher( elem, context || document, xml) ) { + results.push( elem ); + break; + } + } + if ( outermost ) { + dirruns = dirrunsUnique; + } + } + + // Track unmatched elements for set filters + if ( bySet ) { + // They will have gone through all possible matchers + if ( (elem = !matcher && elem) ) { + matchedCount--; + } + + // Lengthen the array for every element, matched or not + if ( seed ) { + unmatched.push( elem ); + } + } + } + + // `i` is now the count of elements visited above, and adding it to `matchedCount` + // makes the latter nonnegative. + matchedCount += i; + + // Apply set filters to unmatched elements + // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` + // equals `i`), unless we didn't visit _any_ elements in the above loop because we have + // no element matchers and no seed. + // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that + // case, which will result in a "00" `matchedCount` that differs from `i` but is also + // numerically zero. + if ( bySet && i !== matchedCount ) { + j = 0; + while ( (matcher = setMatchers[j++]) ) { + matcher( unmatched, setMatched, context, xml ); + } + + if ( seed ) { + // Reintegrate element matches to eliminate the need for sorting + if ( matchedCount > 0 ) { + while ( i-- ) { + if ( !(unmatched[i] || setMatched[i]) ) { + setMatched[i] = pop.call( results ); + } + } + } + + // Discard index placeholder values to get only actual matches + setMatched = condense( setMatched ); + } + + // Add matches to results + push.apply( results, setMatched ); + + // Seedless set matches succeeding multiple successful matchers stipulate sorting + if ( outermost && !seed && setMatched.length > 0 && + ( matchedCount + setMatchers.length ) > 1 ) { + + Sizzle.uniqueSort( results ); + } + } + + // Override manipulation of globals by nested matchers + if ( outermost ) { + dirruns = dirrunsUnique; + outermostContext = contextBackup; + } + + return unmatched; + }; + + return bySet ? + markFunction( superMatcher ) : + superMatcher; +} + +compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { + var i, + setMatchers = [], + elementMatchers = [], + cached = compilerCache[ selector + " " ]; + + if ( !cached ) { + // Generate a function of recursive functions that can be used to check each element + if ( !match ) { + match = tokenize( selector ); + } + i = match.length; + while ( i-- ) { + cached = matcherFromTokens( match[i] ); + if ( cached[ expando ] ) { + setMatchers.push( cached ); + } else { + elementMatchers.push( cached ); + } + } + + // Cache the compiled function + cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); + + // Save selector and tokenization + cached.selector = selector; + } + return cached; +}; + +/** + * A low-level selection function that works with Sizzle's compiled + * selector functions + * @param {String|Function} selector A selector or a pre-compiled + * selector function built with Sizzle.compile + * @param {Element} context + * @param {Array} [results] + * @param {Array} [seed] A set of elements to match against + */ +select = Sizzle.select = function( selector, context, results, seed ) { + var i, tokens, token, type, find, + compiled = typeof selector === "function" && selector, + match = !seed && tokenize( (selector = compiled.selector || selector) ); + + results = results || []; + + // Try to minimize operations if there is only one selector in the list and no seed + // (the latter of which guarantees us context) + if ( match.length === 1 ) { + + // Reduce context if the leading compound selector is an ID + tokens = match[0] = match[0].slice( 0 ); + if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && + context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) { + + context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; + if ( !context ) { + return results; + + // Precompiled matchers will still verify ancestry, so step up a level + } else if ( compiled ) { + context = context.parentNode; + } + + selector = selector.slice( tokens.shift().value.length ); + } + + // Fetch a seed set for right-to-left matching + i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; + while ( i-- ) { + token = tokens[i]; + + // Abort if we hit a combinator + if ( Expr.relative[ (type = token.type) ] ) { + break; + } + if ( (find = Expr.find[ type ]) ) { + // Search, expanding context for leading sibling combinators + if ( (seed = find( + token.matches[0].replace( runescape, funescape ), + rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context + )) ) { + + // If seed is empty or no tokens remain, we can return early + tokens.splice( i, 1 ); + selector = seed.length && toSelector( tokens ); + if ( !selector ) { + push.apply( results, seed ); + return results; + } + + break; + } + } + } + } + + // Compile and execute a filtering function if one is not provided + // Provide `match` to avoid retokenization if we modified the selector above + ( compiled || compile( selector, match ) )( + seed, + context, + !documentIsHTML, + results, + !context || rsibling.test( selector ) && testContext( context.parentNode ) || context + ); + return results; +}; + +// One-time assignments + +// Sort stability +support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; + +// Support: Chrome 14-35+ +// Always assume duplicates if they aren't passed to the comparison function +support.detectDuplicates = !!hasDuplicate; + +// Initialize against the default document +setDocument(); + +// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) +// Detached nodes confoundingly follow *each other* +support.sortDetached = assert(function( el ) { + // Should return 1, but returns 4 (following) + return el.compareDocumentPosition( document.createElement("fieldset") ) & 1; +}); + +// Support: IE<8 +// Prevent attribute/property "interpolation" +// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx +if ( !assert(function( el ) { + el.innerHTML = ""; + return el.firstChild.getAttribute("href") === "#" ; +}) ) { + addHandle( "type|href|height|width", function( elem, name, isXML ) { + if ( !isXML ) { + return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); + } + }); +} + +// Support: IE<9 +// Use defaultValue in place of getAttribute("value") +if ( !support.attributes || !assert(function( el ) { + el.innerHTML = ""; + el.firstChild.setAttribute( "value", "" ); + return el.firstChild.getAttribute( "value" ) === ""; +}) ) { + addHandle( "value", function( elem, name, isXML ) { + if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { + return elem.defaultValue; + } + }); +} + +// Support: IE<9 +// Use getAttributeNode to fetch booleans when getAttribute lies +if ( !assert(function( el ) { + return el.getAttribute("disabled") == null; +}) ) { + addHandle( booleans, function( elem, name, isXML ) { + var val; + if ( !isXML ) { + return elem[ name ] === true ? name.toLowerCase() : + (val = elem.getAttributeNode( name )) && val.specified ? + val.value : + null; + } + }); +} + +return Sizzle; + +})( window ); + + + +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; + +// Deprecated +jQuery.expr[ ":" ] = jQuery.expr.pseudos; +jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; +jQuery.text = Sizzle.getText; +jQuery.isXMLDoc = Sizzle.isXML; +jQuery.contains = Sizzle.contains; +jQuery.escapeSelector = Sizzle.escape; + + + + +var dir = function( elem, dir, until ) { + var matched = [], + truncate = until !== undefined; + + while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { + if ( elem.nodeType === 1 ) { + if ( truncate && jQuery( elem ).is( until ) ) { + break; + } + matched.push( elem ); + } + } + return matched; +}; + + +var siblings = function( n, elem ) { + var matched = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + matched.push( n ); + } + } + + return matched; +}; + + +var rneedsContext = jQuery.expr.match.needsContext; + + + +function nodeName( elem, name ) { + + return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); + +}; +var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); + + + +var risSimple = /^.[^:#\[\.,]*$/; + +// Implement the identical functionality for filter and not +function winnow( elements, qualifier, not ) { + if ( jQuery.isFunction( qualifier ) ) { + return jQuery.grep( elements, function( elem, i ) { + return !!qualifier.call( elem, i, elem ) !== not; + } ); + } + + // Single element + if ( qualifier.nodeType ) { + return jQuery.grep( elements, function( elem ) { + return ( elem === qualifier ) !== not; + } ); + } + + // Arraylike of elements (jQuery, arguments, Array) + if ( typeof qualifier !== "string" ) { + return jQuery.grep( elements, function( elem ) { + return ( indexOf.call( qualifier, elem ) > -1 ) !== not; + } ); + } + + // Simple selector that can be filtered directly, removing non-Elements + if ( risSimple.test( qualifier ) ) { + return jQuery.filter( qualifier, elements, not ); + } + + // Complex selector, compare the two sets, removing non-Elements + qualifier = jQuery.filter( qualifier, elements ); + return jQuery.grep( elements, function( elem ) { + return ( indexOf.call( qualifier, elem ) > -1 ) !== not && elem.nodeType === 1; + } ); +} + +jQuery.filter = function( expr, elems, not ) { + var elem = elems[ 0 ]; + + if ( not ) { + expr = ":not(" + expr + ")"; + } + + if ( elems.length === 1 && elem.nodeType === 1 ) { + return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; + } + + return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { + return elem.nodeType === 1; + } ) ); +}; + +jQuery.fn.extend( { + find: function( selector ) { + var i, ret, + len = this.length, + self = this; + + if ( typeof selector !== "string" ) { + return this.pushStack( jQuery( selector ).filter( function() { + for ( i = 0; i < len; i++ ) { + if ( jQuery.contains( self[ i ], this ) ) { + return true; + } + } + } ) ); + } + + ret = this.pushStack( [] ); + + for ( i = 0; i < len; i++ ) { + jQuery.find( selector, self[ i ], ret ); + } + + return len > 1 ? jQuery.uniqueSort( ret ) : ret; + }, + filter: function( selector ) { + return this.pushStack( winnow( this, selector || [], false ) ); + }, + not: function( selector ) { + return this.pushStack( winnow( this, selector || [], true ) ); + }, + is: function( selector ) { + return !!winnow( + this, + + // If this is a positional/relative selector, check membership in the returned set + // so $("p:first").is("p:last") won't return true for a doc with two "p". + typeof selector === "string" && rneedsContext.test( selector ) ? + jQuery( selector ) : + selector || [], + false + ).length; + } +} ); + + +// Initialize a jQuery object + + +// A central reference to the root jQuery(document) +var rootjQuery, + + // A simple way to check for HTML strings + // Prioritize #id over to avoid XSS via location.hash (#9521) + // Strict HTML recognition (#11290: must start with <) + // Shortcut simple #id case for speed + rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, + + init = jQuery.fn.init = function( selector, context, root ) { + var match, elem; + + // HANDLE: $(""), $(null), $(undefined), $(false) + if ( !selector ) { + return this; + } + + // Method init() accepts an alternate rootjQuery + // so migrate can support jQuery.sub (gh-2101) + root = root || rootjQuery; + + // Handle HTML strings + if ( typeof selector === "string" ) { + if ( selector[ 0 ] === "<" && + selector[ selector.length - 1 ] === ">" && + selector.length >= 3 ) { + + // Assume that strings that start and end with <> are HTML and skip the regex check + match = [ null, selector, null ]; + + } else { + match = rquickExpr.exec( selector ); + } + + // Match html or make sure no context is specified for #id + if ( match && ( match[ 1 ] || !context ) ) { + + // HANDLE: $(html) -> $(array) + if ( match[ 1 ] ) { + context = context instanceof jQuery ? context[ 0 ] : context; + + // Option to run scripts is true for back-compat + // Intentionally let the error be thrown if parseHTML is not present + jQuery.merge( this, jQuery.parseHTML( + match[ 1 ], + context && context.nodeType ? context.ownerDocument || context : document, + true + ) ); + + // HANDLE: $(html, props) + if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { + for ( match in context ) { + + // Properties of context are called as methods if possible + if ( jQuery.isFunction( this[ match ] ) ) { + this[ match ]( context[ match ] ); + + // ...and otherwise set as attributes + } else { + this.attr( match, context[ match ] ); + } + } + } + + return this; + + // HANDLE: $(#id) + } else { + elem = document.getElementById( match[ 2 ] ); + + if ( elem ) { + + // Inject the element directly into the jQuery object + this[ 0 ] = elem; + this.length = 1; + } + return this; + } + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return ( context || root ).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return this.constructor( context ).find( selector ); + } + + // HANDLE: $(DOMElement) + } else if ( selector.nodeType ) { + this[ 0 ] = selector; + this.length = 1; + return this; + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) { + return root.ready !== undefined ? + root.ready( selector ) : + + // Execute immediately if ready is not present + selector( jQuery ); + } + + return jQuery.makeArray( selector, this ); + }; + +// Give the init function the jQuery prototype for later instantiation +init.prototype = jQuery.fn; + +// Initialize central reference +rootjQuery = jQuery( document ); + + +var rparentsprev = /^(?:parents|prev(?:Until|All))/, + + // Methods guaranteed to produce a unique set when starting from a unique set + guaranteedUnique = { + children: true, + contents: true, + next: true, + prev: true + }; + +jQuery.fn.extend( { + has: function( target ) { + var targets = jQuery( target, this ), + l = targets.length; + + return this.filter( function() { + var i = 0; + for ( ; i < l; i++ ) { + if ( jQuery.contains( this, targets[ i ] ) ) { + return true; + } + } + } ); + }, + + closest: function( selectors, context ) { + var cur, + i = 0, + l = this.length, + matched = [], + targets = typeof selectors !== "string" && jQuery( selectors ); + + // Positional selectors never match, since there's no _selection_ context + if ( !rneedsContext.test( selectors ) ) { + for ( ; i < l; i++ ) { + for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { + + // Always skip document fragments + if ( cur.nodeType < 11 && ( targets ? + targets.index( cur ) > -1 : + + // Don't pass non-elements to Sizzle + cur.nodeType === 1 && + jQuery.find.matchesSelector( cur, selectors ) ) ) { + + matched.push( cur ); + break; + } + } + } + } + + return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); + }, + + // Determine the position of an element within the set + index: function( elem ) { + + // No argument, return index in parent + if ( !elem ) { + return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; + } + + // Index in selector + if ( typeof elem === "string" ) { + return indexOf.call( jQuery( elem ), this[ 0 ] ); + } + + // Locate the position of the desired element + return indexOf.call( this, + + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[ 0 ] : elem + ); + }, + + add: function( selector, context ) { + return this.pushStack( + jQuery.uniqueSort( + jQuery.merge( this.get(), jQuery( selector, context ) ) + ) + ); + }, + + addBack: function( selector ) { + return this.add( selector == null ? + this.prevObject : this.prevObject.filter( selector ) + ); + } +} ); + +function sibling( cur, dir ) { + while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} + return cur; +} + +jQuery.each( { + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, i, until ) { + return dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return sibling( elem, "nextSibling" ); + }, + prev: function( elem ) { + return sibling( elem, "previousSibling" ); + }, + nextAll: function( elem ) { + return dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, i, until ) { + return dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, i, until ) { + return dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return siblings( ( elem.parentNode || {} ).firstChild, elem ); + }, + children: function( elem ) { + return siblings( elem.firstChild ); + }, + contents: function( elem ) { + if ( nodeName( elem, "iframe" ) ) { + return elem.contentDocument; + } + + // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only + // Treat the template element as a regular one in browsers that + // don't support it. + if ( nodeName( elem, "template" ) ) { + elem = elem.content || elem; + } + + return jQuery.merge( [], elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var matched = jQuery.map( this, fn, until ); + + if ( name.slice( -5 ) !== "Until" ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + matched = jQuery.filter( selector, matched ); + } + + if ( this.length > 1 ) { + + // Remove duplicates + if ( !guaranteedUnique[ name ] ) { + jQuery.uniqueSort( matched ); + } + + // Reverse order for parents* and prev-derivatives + if ( rparentsprev.test( name ) ) { + matched.reverse(); + } + } + + return this.pushStack( matched ); + }; +} ); +var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); + + + +// Convert String-formatted options into Object-formatted ones +function createOptions( options ) { + var object = {}; + jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { + object[ flag ] = true; + } ); + return object; +} + +/* + * Create a callback list using the following parameters: + * + * options: an optional list of space-separated options that will change how + * the callback list behaves or a more traditional option object + * + * By default a callback list will act like an event callback list and can be + * "fired" multiple times. + * + * Possible options: + * + * once: will ensure the callback list can only be fired once (like a Deferred) + * + * memory: will keep track of previous values and will call any callback added + * after the list has been fired right away with the latest "memorized" + * values (like a Deferred) + * + * unique: will ensure a callback can only be added once (no duplicate in the list) + * + * stopOnFalse: interrupt callings when a callback returns false + * + */ +jQuery.Callbacks = function( options ) { + + // Convert options from String-formatted to Object-formatted if needed + // (we check in cache first) + options = typeof options === "string" ? + createOptions( options ) : + jQuery.extend( {}, options ); + + var // Flag to know if list is currently firing + firing, + + // Last fire value for non-forgettable lists + memory, + + // Flag to know if list was already fired + fired, + + // Flag to prevent firing + locked, + + // Actual callback list + list = [], + + // Queue of execution data for repeatable lists + queue = [], + + // Index of currently firing callback (modified by add/remove as needed) + firingIndex = -1, + + // Fire callbacks + fire = function() { + + // Enforce single-firing + locked = locked || options.once; + + // Execute callbacks for all pending executions, + // respecting firingIndex overrides and runtime changes + fired = firing = true; + for ( ; queue.length; firingIndex = -1 ) { + memory = queue.shift(); + while ( ++firingIndex < list.length ) { + + // Run callback and check for early termination + if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && + options.stopOnFalse ) { + + // Jump to end and forget the data so .add doesn't re-fire + firingIndex = list.length; + memory = false; + } + } + } + + // Forget the data if we're done with it + if ( !options.memory ) { + memory = false; + } + + firing = false; + + // Clean up if we're done firing for good + if ( locked ) { + + // Keep an empty list if we have data for future add calls + if ( memory ) { + list = []; + + // Otherwise, this object is spent + } else { + list = ""; + } + } + }, + + // Actual Callbacks object + self = { + + // Add a callback or a collection of callbacks to the list + add: function() { + if ( list ) { + + // If we have memory from a past run, we should fire after adding + if ( memory && !firing ) { + firingIndex = list.length - 1; + queue.push( memory ); + } + + ( function add( args ) { + jQuery.each( args, function( _, arg ) { + if ( jQuery.isFunction( arg ) ) { + if ( !options.unique || !self.has( arg ) ) { + list.push( arg ); + } + } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) { + + // Inspect recursively + add( arg ); + } + } ); + } )( arguments ); + + if ( memory && !firing ) { + fire(); + } + } + return this; + }, + + // Remove a callback from the list + remove: function() { + jQuery.each( arguments, function( _, arg ) { + var index; + while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { + list.splice( index, 1 ); + + // Handle firing indexes + if ( index <= firingIndex ) { + firingIndex--; + } + } + } ); + return this; + }, + + // Check if a given callback is in the list. + // If no argument is given, return whether or not list has callbacks attached. + has: function( fn ) { + return fn ? + jQuery.inArray( fn, list ) > -1 : + list.length > 0; + }, + + // Remove all callbacks from the list + empty: function() { + if ( list ) { + list = []; + } + return this; + }, + + // Disable .fire and .add + // Abort any current/pending executions + // Clear all callbacks and values + disable: function() { + locked = queue = []; + list = memory = ""; + return this; + }, + disabled: function() { + return !list; + }, + + // Disable .fire + // Also disable .add unless we have memory (since it would have no effect) + // Abort any pending executions + lock: function() { + locked = queue = []; + if ( !memory && !firing ) { + list = memory = ""; + } + return this; + }, + locked: function() { + return !!locked; + }, + + // Call all callbacks with the given context and arguments + fireWith: function( context, args ) { + if ( !locked ) { + args = args || []; + args = [ context, args.slice ? args.slice() : args ]; + queue.push( args ); + if ( !firing ) { + fire(); + } + } + return this; + }, + + // Call all the callbacks with the given arguments + fire: function() { + self.fireWith( this, arguments ); + return this; + }, + + // To know if the callbacks have already been called at least once + fired: function() { + return !!fired; + } + }; + + return self; +}; + + +function Identity( v ) { + return v; +} +function Thrower( ex ) { + throw ex; +} + +function adoptValue( value, resolve, reject, noValue ) { + var method; + + try { + + // Check for promise aspect first to privilege synchronous behavior + if ( value && jQuery.isFunction( ( method = value.promise ) ) ) { + method.call( value ).done( resolve ).fail( reject ); + + // Other thenables + } else if ( value && jQuery.isFunction( ( method = value.then ) ) ) { + method.call( value, resolve, reject ); + + // Other non-thenables + } else { + + // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: + // * false: [ value ].slice( 0 ) => resolve( value ) + // * true: [ value ].slice( 1 ) => resolve() + resolve.apply( undefined, [ value ].slice( noValue ) ); + } + + // For Promises/A+, convert exceptions into rejections + // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in + // Deferred#then to conditionally suppress rejection. + } catch ( value ) { + + // Support: Android 4.0 only + // Strict mode functions invoked without .call/.apply get global-object context + reject.apply( undefined, [ value ] ); + } +} + +jQuery.extend( { + + Deferred: function( func ) { + var tuples = [ + + // action, add listener, callbacks, + // ... .then handlers, argument index, [final state] + [ "notify", "progress", jQuery.Callbacks( "memory" ), + jQuery.Callbacks( "memory" ), 2 ], + [ "resolve", "done", jQuery.Callbacks( "once memory" ), + jQuery.Callbacks( "once memory" ), 0, "resolved" ], + [ "reject", "fail", jQuery.Callbacks( "once memory" ), + jQuery.Callbacks( "once memory" ), 1, "rejected" ] + ], + state = "pending", + promise = { + state: function() { + return state; + }, + always: function() { + deferred.done( arguments ).fail( arguments ); + return this; + }, + "catch": function( fn ) { + return promise.then( null, fn ); + }, + + // Keep pipe for back-compat + pipe: function( /* fnDone, fnFail, fnProgress */ ) { + var fns = arguments; + + return jQuery.Deferred( function( newDefer ) { + jQuery.each( tuples, function( i, tuple ) { + + // Map tuples (progress, done, fail) to arguments (done, fail, progress) + var fn = jQuery.isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; + + // deferred.progress(function() { bind to newDefer or newDefer.notify }) + // deferred.done(function() { bind to newDefer or newDefer.resolve }) + // deferred.fail(function() { bind to newDefer or newDefer.reject }) + deferred[ tuple[ 1 ] ]( function() { + var returned = fn && fn.apply( this, arguments ); + if ( returned && jQuery.isFunction( returned.promise ) ) { + returned.promise() + .progress( newDefer.notify ) + .done( newDefer.resolve ) + .fail( newDefer.reject ); + } else { + newDefer[ tuple[ 0 ] + "With" ]( + this, + fn ? [ returned ] : arguments + ); + } + } ); + } ); + fns = null; + } ).promise(); + }, + then: function( onFulfilled, onRejected, onProgress ) { + var maxDepth = 0; + function resolve( depth, deferred, handler, special ) { + return function() { + var that = this, + args = arguments, + mightThrow = function() { + var returned, then; + + // Support: Promises/A+ section 2.3.3.3.3 + // https://promisesaplus.com/#point-59 + // Ignore double-resolution attempts + if ( depth < maxDepth ) { + return; + } + + returned = handler.apply( that, args ); + + // Support: Promises/A+ section 2.3.1 + // https://promisesaplus.com/#point-48 + if ( returned === deferred.promise() ) { + throw new TypeError( "Thenable self-resolution" ); + } + + // Support: Promises/A+ sections 2.3.3.1, 3.5 + // https://promisesaplus.com/#point-54 + // https://promisesaplus.com/#point-75 + // Retrieve `then` only once + then = returned && + + // Support: Promises/A+ section 2.3.4 + // https://promisesaplus.com/#point-64 + // Only check objects and functions for thenability + ( typeof returned === "object" || + typeof returned === "function" ) && + returned.then; + + // Handle a returned thenable + if ( jQuery.isFunction( then ) ) { + + // Special processors (notify) just wait for resolution + if ( special ) { + then.call( + returned, + resolve( maxDepth, deferred, Identity, special ), + resolve( maxDepth, deferred, Thrower, special ) + ); + + // Normal processors (resolve) also hook into progress + } else { + + // ...and disregard older resolution values + maxDepth++; + + then.call( + returned, + resolve( maxDepth, deferred, Identity, special ), + resolve( maxDepth, deferred, Thrower, special ), + resolve( maxDepth, deferred, Identity, + deferred.notifyWith ) + ); + } + + // Handle all other returned values + } else { + + // Only substitute handlers pass on context + // and multiple values (non-spec behavior) + if ( handler !== Identity ) { + that = undefined; + args = [ returned ]; + } + + // Process the value(s) + // Default process is resolve + ( special || deferred.resolveWith )( that, args ); + } + }, + + // Only normal processors (resolve) catch and reject exceptions + process = special ? + mightThrow : + function() { + try { + mightThrow(); + } catch ( e ) { + + if ( jQuery.Deferred.exceptionHook ) { + jQuery.Deferred.exceptionHook( e, + process.stackTrace ); + } + + // Support: Promises/A+ section 2.3.3.3.4.1 + // https://promisesaplus.com/#point-61 + // Ignore post-resolution exceptions + if ( depth + 1 >= maxDepth ) { + + // Only substitute handlers pass on context + // and multiple values (non-spec behavior) + if ( handler !== Thrower ) { + that = undefined; + args = [ e ]; + } + + deferred.rejectWith( that, args ); + } + } + }; + + // Support: Promises/A+ section 2.3.3.3.1 + // https://promisesaplus.com/#point-57 + // Re-resolve promises immediately to dodge false rejection from + // subsequent errors + if ( depth ) { + process(); + } else { + + // Call an optional hook to record the stack, in case of exception + // since it's otherwise lost when execution goes async + if ( jQuery.Deferred.getStackHook ) { + process.stackTrace = jQuery.Deferred.getStackHook(); + } + window.setTimeout( process ); + } + }; + } + + return jQuery.Deferred( function( newDefer ) { + + // progress_handlers.add( ... ) + tuples[ 0 ][ 3 ].add( + resolve( + 0, + newDefer, + jQuery.isFunction( onProgress ) ? + onProgress : + Identity, + newDefer.notifyWith + ) + ); + + // fulfilled_handlers.add( ... ) + tuples[ 1 ][ 3 ].add( + resolve( + 0, + newDefer, + jQuery.isFunction( onFulfilled ) ? + onFulfilled : + Identity + ) + ); + + // rejected_handlers.add( ... ) + tuples[ 2 ][ 3 ].add( + resolve( + 0, + newDefer, + jQuery.isFunction( onRejected ) ? + onRejected : + Thrower + ) + ); + } ).promise(); + }, + + // Get a promise for this deferred + // If obj is provided, the promise aspect is added to the object + promise: function( obj ) { + return obj != null ? jQuery.extend( obj, promise ) : promise; + } + }, + deferred = {}; + + // Add list-specific methods + jQuery.each( tuples, function( i, tuple ) { + var list = tuple[ 2 ], + stateString = tuple[ 5 ]; + + // promise.progress = list.add + // promise.done = list.add + // promise.fail = list.add + promise[ tuple[ 1 ] ] = list.add; + + // Handle state + if ( stateString ) { + list.add( + function() { + + // state = "resolved" (i.e., fulfilled) + // state = "rejected" + state = stateString; + }, + + // rejected_callbacks.disable + // fulfilled_callbacks.disable + tuples[ 3 - i ][ 2 ].disable, + + // progress_callbacks.lock + tuples[ 0 ][ 2 ].lock + ); + } + + // progress_handlers.fire + // fulfilled_handlers.fire + // rejected_handlers.fire + list.add( tuple[ 3 ].fire ); + + // deferred.notify = function() { deferred.notifyWith(...) } + // deferred.resolve = function() { deferred.resolveWith(...) } + // deferred.reject = function() { deferred.rejectWith(...) } + deferred[ tuple[ 0 ] ] = function() { + deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); + return this; + }; + + // deferred.notifyWith = list.fireWith + // deferred.resolveWith = list.fireWith + // deferred.rejectWith = list.fireWith + deferred[ tuple[ 0 ] + "With" ] = list.fireWith; + } ); + + // Make the deferred a promise + promise.promise( deferred ); + + // Call given func if any + if ( func ) { + func.call( deferred, deferred ); + } + + // All done! + return deferred; + }, + + // Deferred helper + when: function( singleValue ) { + var + + // count of uncompleted subordinates + remaining = arguments.length, + + // count of unprocessed arguments + i = remaining, + + // subordinate fulfillment data + resolveContexts = Array( i ), + resolveValues = slice.call( arguments ), + + // the master Deferred + master = jQuery.Deferred(), + + // subordinate callback factory + updateFunc = function( i ) { + return function( value ) { + resolveContexts[ i ] = this; + resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; + if ( !( --remaining ) ) { + master.resolveWith( resolveContexts, resolveValues ); + } + }; + }; + + // Single- and empty arguments are adopted like Promise.resolve + if ( remaining <= 1 ) { + adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject, + !remaining ); + + // Use .then() to unwrap secondary thenables (cf. gh-3000) + if ( master.state() === "pending" || + jQuery.isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { + + return master.then(); + } + } + + // Multiple arguments are aggregated like Promise.all array elements + while ( i-- ) { + adoptValue( resolveValues[ i ], updateFunc( i ), master.reject ); + } + + return master.promise(); + } +} ); + + +// These usually indicate a programmer mistake during development, +// warn about them ASAP rather than swallowing them by default. +var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; + +jQuery.Deferred.exceptionHook = function( error, stack ) { + + // Support: IE 8 - 9 only + // Console exists when dev tools are open, which can happen at any time + if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { + window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); + } +}; + + + + +jQuery.readyException = function( error ) { + window.setTimeout( function() { + throw error; + } ); +}; + + + + +// The deferred used on DOM ready +var readyList = jQuery.Deferred(); + +jQuery.fn.ready = function( fn ) { + + readyList + .then( fn ) + + // Wrap jQuery.readyException in a function so that the lookup + // happens at the time of error handling instead of callback + // registration. + .catch( function( error ) { + jQuery.readyException( error ); + } ); + + return this; +}; + +jQuery.extend( { + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Handle when the DOM is ready + ready: function( wait ) { + + // Abort if there are pending holds or we're already ready + if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { + return; + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + readyList.resolveWith( document, [ jQuery ] ); + } +} ); + +jQuery.ready.then = readyList.then; + +// The ready event handler and self cleanup method +function completed() { + document.removeEventListener( "DOMContentLoaded", completed ); + window.removeEventListener( "load", completed ); + jQuery.ready(); +} + +// Catch cases where $(document).ready() is called +// after the browser event has already occurred. +// Support: IE <=9 - 10 only +// Older IE sometimes signals "interactive" too soon +if ( document.readyState === "complete" || + ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { + + // Handle it asynchronously to allow scripts the opportunity to delay ready + window.setTimeout( jQuery.ready ); + +} else { + + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", completed ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", completed ); +} + + + + +// Multifunctional method to get and set values of a collection +// The value/s can optionally be executed if it's a function +var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { + var i = 0, + len = elems.length, + bulk = key == null; + + // Sets many values + if ( jQuery.type( key ) === "object" ) { + chainable = true; + for ( i in key ) { + access( elems, fn, i, key[ i ], true, emptyGet, raw ); + } + + // Sets one value + } else if ( value !== undefined ) { + chainable = true; + + if ( !jQuery.isFunction( value ) ) { + raw = true; + } + + if ( bulk ) { + + // Bulk operations run against the entire set + if ( raw ) { + fn.call( elems, value ); + fn = null; + + // ...except when executing function values + } else { + bulk = fn; + fn = function( elem, key, value ) { + return bulk.call( jQuery( elem ), value ); + }; + } + } + + if ( fn ) { + for ( ; i < len; i++ ) { + fn( + elems[ i ], key, raw ? + value : + value.call( elems[ i ], i, fn( elems[ i ], key ) ) + ); + } + } + } + + if ( chainable ) { + return elems; + } + + // Gets + if ( bulk ) { + return fn.call( elems ); + } + + return len ? fn( elems[ 0 ], key ) : emptyGet; +}; +var acceptData = function( owner ) { + + // Accepts only: + // - Node + // - Node.ELEMENT_NODE + // - Node.DOCUMENT_NODE + // - Object + // - Any + return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); +}; + + + + +function Data() { + this.expando = jQuery.expando + Data.uid++; +} + +Data.uid = 1; + +Data.prototype = { + + cache: function( owner ) { + + // Check if the owner object already has a cache + var value = owner[ this.expando ]; + + // If not, create one + if ( !value ) { + value = {}; + + // We can accept data for non-element nodes in modern browsers, + // but we should not, see #8335. + // Always return an empty object. + if ( acceptData( owner ) ) { + + // If it is a node unlikely to be stringify-ed or looped over + // use plain assignment + if ( owner.nodeType ) { + owner[ this.expando ] = value; + + // Otherwise secure it in a non-enumerable property + // configurable must be true to allow the property to be + // deleted when data is removed + } else { + Object.defineProperty( owner, this.expando, { + value: value, + configurable: true + } ); + } + } + } + + return value; + }, + set: function( owner, data, value ) { + var prop, + cache = this.cache( owner ); + + // Handle: [ owner, key, value ] args + // Always use camelCase key (gh-2257) + if ( typeof data === "string" ) { + cache[ jQuery.camelCase( data ) ] = value; + + // Handle: [ owner, { properties } ] args + } else { + + // Copy the properties one-by-one to the cache object + for ( prop in data ) { + cache[ jQuery.camelCase( prop ) ] = data[ prop ]; + } + } + return cache; + }, + get: function( owner, key ) { + return key === undefined ? + this.cache( owner ) : + + // Always use camelCase key (gh-2257) + owner[ this.expando ] && owner[ this.expando ][ jQuery.camelCase( key ) ]; + }, + access: function( owner, key, value ) { + + // In cases where either: + // + // 1. No key was specified + // 2. A string key was specified, but no value provided + // + // Take the "read" path and allow the get method to determine + // which value to return, respectively either: + // + // 1. The entire cache object + // 2. The data stored at the key + // + if ( key === undefined || + ( ( key && typeof key === "string" ) && value === undefined ) ) { + + return this.get( owner, key ); + } + + // When the key is not a string, or both a key and value + // are specified, set or extend (existing objects) with either: + // + // 1. An object of properties + // 2. A key and value + // + this.set( owner, key, value ); + + // Since the "set" path can have two possible entry points + // return the expected data based on which path was taken[*] + return value !== undefined ? value : key; + }, + remove: function( owner, key ) { + var i, + cache = owner[ this.expando ]; + + if ( cache === undefined ) { + return; + } + + if ( key !== undefined ) { + + // Support array or space separated string of keys + if ( Array.isArray( key ) ) { + + // If key is an array of keys... + // We always set camelCase keys, so remove that. + key = key.map( jQuery.camelCase ); + } else { + key = jQuery.camelCase( key ); + + // If a key with the spaces exists, use it. + // Otherwise, create an array by matching non-whitespace + key = key in cache ? + [ key ] : + ( key.match( rnothtmlwhite ) || [] ); + } + + i = key.length; + + while ( i-- ) { + delete cache[ key[ i ] ]; + } + } + + // Remove the expando if there's no more data + if ( key === undefined || jQuery.isEmptyObject( cache ) ) { + + // Support: Chrome <=35 - 45 + // Webkit & Blink performance suffers when deleting properties + // from DOM nodes, so set to undefined instead + // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) + if ( owner.nodeType ) { + owner[ this.expando ] = undefined; + } else { + delete owner[ this.expando ]; + } + } + }, + hasData: function( owner ) { + var cache = owner[ this.expando ]; + return cache !== undefined && !jQuery.isEmptyObject( cache ); + } +}; +var dataPriv = new Data(); + +var dataUser = new Data(); + + + +// Implementation Summary +// +// 1. Enforce API surface and semantic compatibility with 1.9.x branch +// 2. Improve the module's maintainability by reducing the storage +// paths to a single mechanism. +// 3. Use the same single mechanism to support "private" and "user" data. +// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) +// 5. Avoid exposing implementation details on user objects (eg. expando properties) +// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 + +var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, + rmultiDash = /[A-Z]/g; + +function getData( data ) { + if ( data === "true" ) { + return true; + } + + if ( data === "false" ) { + return false; + } + + if ( data === "null" ) { + return null; + } + + // Only convert to a number if it doesn't change the string + if ( data === +data + "" ) { + return +data; + } + + if ( rbrace.test( data ) ) { + return JSON.parse( data ); + } + + return data; +} + +function dataAttr( elem, key, data ) { + var name; + + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); + data = elem.getAttribute( name ); + + if ( typeof data === "string" ) { + try { + data = getData( data ); + } catch ( e ) {} + + // Make sure we set the data so it isn't changed later + dataUser.set( elem, key, data ); + } else { + data = undefined; + } + } + return data; +} + +jQuery.extend( { + hasData: function( elem ) { + return dataUser.hasData( elem ) || dataPriv.hasData( elem ); + }, + + data: function( elem, name, data ) { + return dataUser.access( elem, name, data ); + }, + + removeData: function( elem, name ) { + dataUser.remove( elem, name ); + }, + + // TODO: Now that all calls to _data and _removeData have been replaced + // with direct calls to dataPriv methods, these can be deprecated. + _data: function( elem, name, data ) { + return dataPriv.access( elem, name, data ); + }, + + _removeData: function( elem, name ) { + dataPriv.remove( elem, name ); + } +} ); + +jQuery.fn.extend( { + data: function( key, value ) { + var i, name, data, + elem = this[ 0 ], + attrs = elem && elem.attributes; + + // Gets all values + if ( key === undefined ) { + if ( this.length ) { + data = dataUser.get( elem ); + + if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { + i = attrs.length; + while ( i-- ) { + + // Support: IE 11 only + // The attrs elements can be null (#14894) + if ( attrs[ i ] ) { + name = attrs[ i ].name; + if ( name.indexOf( "data-" ) === 0 ) { + name = jQuery.camelCase( name.slice( 5 ) ); + dataAttr( elem, name, data[ name ] ); + } + } + } + dataPriv.set( elem, "hasDataAttrs", true ); + } + } + + return data; + } + + // Sets multiple values + if ( typeof key === "object" ) { + return this.each( function() { + dataUser.set( this, key ); + } ); + } + + return access( this, function( value ) { + var data; + + // The calling jQuery object (element matches) is not empty + // (and therefore has an element appears at this[ 0 ]) and the + // `value` parameter was not undefined. An empty jQuery object + // will result in `undefined` for elem = this[ 0 ] which will + // throw an exception if an attempt to read a data cache is made. + if ( elem && value === undefined ) { + + // Attempt to get data from the cache + // The key will always be camelCased in Data + data = dataUser.get( elem, key ); + if ( data !== undefined ) { + return data; + } + + // Attempt to "discover" the data in + // HTML5 custom data-* attrs + data = dataAttr( elem, key ); + if ( data !== undefined ) { + return data; + } + + // We tried really hard, but the data doesn't exist. + return; + } + + // Set the data... + this.each( function() { + + // We always store the camelCased key + dataUser.set( this, key, value ); + } ); + }, null, value, arguments.length > 1, null, true ); + }, + + removeData: function( key ) { + return this.each( function() { + dataUser.remove( this, key ); + } ); + } +} ); + + +jQuery.extend( { + queue: function( elem, type, data ) { + var queue; + + if ( elem ) { + type = ( type || "fx" ) + "queue"; + queue = dataPriv.get( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( data ) { + if ( !queue || Array.isArray( data ) ) { + queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); + } else { + queue.push( data ); + } + } + return queue || []; + } + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), + startLength = queue.length, + fn = queue.shift(), + hooks = jQuery._queueHooks( elem, type ), + next = function() { + jQuery.dequeue( elem, type ); + }; + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + startLength--; + } + + if ( fn ) { + + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift( "inprogress" ); + } + + // Clear up the last queue stop function + delete hooks.stop; + fn.call( elem, next, hooks ); + } + + if ( !startLength && hooks ) { + hooks.empty.fire(); + } + }, + + // Not public - generate a queueHooks object, or return the current one + _queueHooks: function( elem, type ) { + var key = type + "queueHooks"; + return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { + empty: jQuery.Callbacks( "once memory" ).add( function() { + dataPriv.remove( elem, [ type + "queue", key ] ); + } ) + } ); + } +} ); + +jQuery.fn.extend( { + queue: function( type, data ) { + var setter = 2; + + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + setter--; + } + + if ( arguments.length < setter ) { + return jQuery.queue( this[ 0 ], type ); + } + + return data === undefined ? + this : + this.each( function() { + var queue = jQuery.queue( this, type, data ); + + // Ensure a hooks for this queue + jQuery._queueHooks( this, type ); + + if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + } ); + }, + dequeue: function( type ) { + return this.each( function() { + jQuery.dequeue( this, type ); + } ); + }, + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + }, + + // Get a promise resolved when queues of a certain type + // are emptied (fx is the type by default) + promise: function( type, obj ) { + var tmp, + count = 1, + defer = jQuery.Deferred(), + elements = this, + i = this.length, + resolve = function() { + if ( !( --count ) ) { + defer.resolveWith( elements, [ elements ] ); + } + }; + + if ( typeof type !== "string" ) { + obj = type; + type = undefined; + } + type = type || "fx"; + + while ( i-- ) { + tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); + if ( tmp && tmp.empty ) { + count++; + tmp.empty.add( resolve ); + } + } + resolve(); + return defer.promise( obj ); + } +} ); +var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; + +var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); + + +var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; + +var isHiddenWithinTree = function( elem, el ) { + + // isHiddenWithinTree might be called from jQuery#filter function; + // in that case, element will be second argument + elem = el || elem; + + // Inline style trumps all + return elem.style.display === "none" || + elem.style.display === "" && + + // Otherwise, check computed style + // Support: Firefox <=43 - 45 + // Disconnected elements can have computed display: none, so first confirm that elem is + // in the document. + jQuery.contains( elem.ownerDocument, elem ) && + + jQuery.css( elem, "display" ) === "none"; + }; + +var swap = function( elem, options, callback, args ) { + var ret, name, + old = {}; + + // Remember the old values, and insert the new ones + for ( name in options ) { + old[ name ] = elem.style[ name ]; + elem.style[ name ] = options[ name ]; + } + + ret = callback.apply( elem, args || [] ); + + // Revert the old values + for ( name in options ) { + elem.style[ name ] = old[ name ]; + } + + return ret; +}; + + + + +function adjustCSS( elem, prop, valueParts, tween ) { + var adjusted, + scale = 1, + maxIterations = 20, + currentValue = tween ? + function() { + return tween.cur(); + } : + function() { + return jQuery.css( elem, prop, "" ); + }, + initial = currentValue(), + unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), + + // Starting value computation is required for potential unit mismatches + initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && + rcssNum.exec( jQuery.css( elem, prop ) ); + + if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { + + // Trust units reported by jQuery.css + unit = unit || initialInUnit[ 3 ]; + + // Make sure we update the tween properties later on + valueParts = valueParts || []; + + // Iteratively approximate from a nonzero starting point + initialInUnit = +initial || 1; + + do { + + // If previous iteration zeroed out, double until we get *something*. + // Use string for doubling so we don't accidentally see scale as unchanged below + scale = scale || ".5"; + + // Adjust and apply + initialInUnit = initialInUnit / scale; + jQuery.style( elem, prop, initialInUnit + unit ); + + // Update scale, tolerating zero or NaN from tween.cur() + // Break the loop if scale is unchanged or perfect, or if we've just had enough. + } while ( + scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations + ); + } + + if ( valueParts ) { + initialInUnit = +initialInUnit || +initial || 0; + + // Apply relative offset (+=/-=) if specified + adjusted = valueParts[ 1 ] ? + initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : + +valueParts[ 2 ]; + if ( tween ) { + tween.unit = unit; + tween.start = initialInUnit; + tween.end = adjusted; + } + } + return adjusted; +} + + +var defaultDisplayMap = {}; + +function getDefaultDisplay( elem ) { + var temp, + doc = elem.ownerDocument, + nodeName = elem.nodeName, + display = defaultDisplayMap[ nodeName ]; + + if ( display ) { + return display; + } + + temp = doc.body.appendChild( doc.createElement( nodeName ) ); + display = jQuery.css( temp, "display" ); + + temp.parentNode.removeChild( temp ); + + if ( display === "none" ) { + display = "block"; + } + defaultDisplayMap[ nodeName ] = display; + + return display; +} + +function showHide( elements, show ) { + var display, elem, + values = [], + index = 0, + length = elements.length; + + // Determine new display value for elements that need to change + for ( ; index < length; index++ ) { + elem = elements[ index ]; + if ( !elem.style ) { + continue; + } + + display = elem.style.display; + if ( show ) { + + // Since we force visibility upon cascade-hidden elements, an immediate (and slow) + // check is required in this first loop unless we have a nonempty display value (either + // inline or about-to-be-restored) + if ( display === "none" ) { + values[ index ] = dataPriv.get( elem, "display" ) || null; + if ( !values[ index ] ) { + elem.style.display = ""; + } + } + if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { + values[ index ] = getDefaultDisplay( elem ); + } + } else { + if ( display !== "none" ) { + values[ index ] = "none"; + + // Remember what we're overwriting + dataPriv.set( elem, "display", display ); + } + } + } + + // Set the display of the elements in a second loop to avoid constant reflow + for ( index = 0; index < length; index++ ) { + if ( values[ index ] != null ) { + elements[ index ].style.display = values[ index ]; + } + } + + return elements; +} + +jQuery.fn.extend( { + show: function() { + return showHide( this, true ); + }, + hide: function() { + return showHide( this ); + }, + toggle: function( state ) { + if ( typeof state === "boolean" ) { + return state ? this.show() : this.hide(); + } + + return this.each( function() { + if ( isHiddenWithinTree( this ) ) { + jQuery( this ).show(); + } else { + jQuery( this ).hide(); + } + } ); + } +} ); +var rcheckableType = ( /^(?:checkbox|radio)$/i ); + +var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]+)/i ); + +var rscriptType = ( /^$|\/(?:java|ecma)script/i ); + + + +// We have to close these tags to support XHTML (#13200) +var wrapMap = { + + // Support: IE <=9 only + option: [ 1, "" ], + + // XHTML parsers do not magically insert elements in the + // same way that tag soup parsers do. So we cannot shorten + // this by omitting or other required elements. + thead: [ 1, "", "
" ], + col: [ 2, "", "
" ], + tr: [ 2, "", "
" ], + td: [ 3, "", "
" ], + + _default: [ 0, "", "" ] +}; + +// Support: IE <=9 only +wrapMap.optgroup = wrapMap.option; + +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + + +function getAll( context, tag ) { + + // Support: IE <=9 - 11 only + // Use typeof to avoid zero-argument method invocation on host objects (#15151) + var ret; + + if ( typeof context.getElementsByTagName !== "undefined" ) { + ret = context.getElementsByTagName( tag || "*" ); + + } else if ( typeof context.querySelectorAll !== "undefined" ) { + ret = context.querySelectorAll( tag || "*" ); + + } else { + ret = []; + } + + if ( tag === undefined || tag && nodeName( context, tag ) ) { + return jQuery.merge( [ context ], ret ); + } + + return ret; +} + + +// Mark scripts as having already been evaluated +function setGlobalEval( elems, refElements ) { + var i = 0, + l = elems.length; + + for ( ; i < l; i++ ) { + dataPriv.set( + elems[ i ], + "globalEval", + !refElements || dataPriv.get( refElements[ i ], "globalEval" ) + ); + } +} + + +var rhtml = /<|&#?\w+;/; + +function buildFragment( elems, context, scripts, selection, ignored ) { + var elem, tmp, tag, wrap, contains, j, + fragment = context.createDocumentFragment(), + nodes = [], + i = 0, + l = elems.length; + + for ( ; i < l; i++ ) { + elem = elems[ i ]; + + if ( elem || elem === 0 ) { + + // Add nodes directly + if ( jQuery.type( elem ) === "object" ) { + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); + + // Convert non-html into a text node + } else if ( !rhtml.test( elem ) ) { + nodes.push( context.createTextNode( elem ) ); + + // Convert html into DOM nodes + } else { + tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); + + // Deserialize a standard representation + tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); + wrap = wrapMap[ tag ] || wrapMap._default; + tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; + + // Descend through wrappers to the right content + j = wrap[ 0 ]; + while ( j-- ) { + tmp = tmp.lastChild; + } + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( nodes, tmp.childNodes ); + + // Remember the top-level container + tmp = fragment.firstChild; + + // Ensure the created nodes are orphaned (#12392) + tmp.textContent = ""; + } + } + } + + // Remove wrapper from fragment + fragment.textContent = ""; + + i = 0; + while ( ( elem = nodes[ i++ ] ) ) { + + // Skip elements already in the context collection (trac-4087) + if ( selection && jQuery.inArray( elem, selection ) > -1 ) { + if ( ignored ) { + ignored.push( elem ); + } + continue; + } + + contains = jQuery.contains( elem.ownerDocument, elem ); + + // Append to fragment + tmp = getAll( fragment.appendChild( elem ), "script" ); + + // Preserve script evaluation history + if ( contains ) { + setGlobalEval( tmp ); + } + + // Capture executables + if ( scripts ) { + j = 0; + while ( ( elem = tmp[ j++ ] ) ) { + if ( rscriptType.test( elem.type || "" ) ) { + scripts.push( elem ); + } + } + } + } + + return fragment; +} + + +( function() { + var fragment = document.createDocumentFragment(), + div = fragment.appendChild( document.createElement( "div" ) ), + input = document.createElement( "input" ); + + // Support: Android 4.0 - 4.3 only + // Check state lost if the name is set (#11217) + // Support: Windows Web Apps (WWA) + // `name` and `type` must use .setAttribute for WWA (#14901) + input.setAttribute( "type", "radio" ); + input.setAttribute( "checked", "checked" ); + input.setAttribute( "name", "t" ); + + div.appendChild( input ); + + // Support: Android <=4.1 only + // Older WebKit doesn't clone checked state correctly in fragments + support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; + + // Support: IE <=11 only + // Make sure textarea (and checkbox) defaultValue is properly cloned + div.innerHTML = ""; + support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; +} )(); +var documentElement = document.documentElement; + + + +var + rkeyEvent = /^key/, + rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, + rtypenamespace = /^([^.]*)(?:\.(.+)|)/; + +function returnTrue() { + return true; +} + +function returnFalse() { + return false; +} + +// Support: IE <=9 only +// See #13393 for more info +function safeActiveElement() { + try { + return document.activeElement; + } catch ( err ) { } +} + +function on( elem, types, selector, data, fn, one ) { + var origFn, type; + + // Types can be a map of types/handlers + if ( typeof types === "object" ) { + + // ( types-Object, selector, data ) + if ( typeof selector !== "string" ) { + + // ( types-Object, data ) + data = data || selector; + selector = undefined; + } + for ( type in types ) { + on( elem, type, selector, data, types[ type ], one ); + } + return elem; + } + + if ( data == null && fn == null ) { + + // ( types, fn ) + fn = selector; + data = selector = undefined; + } else if ( fn == null ) { + if ( typeof selector === "string" ) { + + // ( types, selector, fn ) + fn = data; + data = undefined; + } else { + + // ( types, data, fn ) + fn = data; + data = selector; + selector = undefined; + } + } + if ( fn === false ) { + fn = returnFalse; + } else if ( !fn ) { + return elem; + } + + if ( one === 1 ) { + origFn = fn; + fn = function( event ) { + + // Can use an empty set, since event contains the info + jQuery().off( event ); + return origFn.apply( this, arguments ); + }; + + // Use same guid so caller can remove using origFn + fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); + } + return elem.each( function() { + jQuery.event.add( this, types, fn, data, selector ); + } ); +} + +/* + * Helper functions for managing events -- not part of the public interface. + * Props to Dean Edwards' addEvent library for many of the ideas. + */ +jQuery.event = { + + global: {}, + + add: function( elem, types, handler, data, selector ) { + + var handleObjIn, eventHandle, tmp, + events, t, handleObj, + special, handlers, type, namespaces, origType, + elemData = dataPriv.get( elem ); + + // Don't attach events to noData or text/comment nodes (but allow plain objects) + if ( !elemData ) { + return; + } + + // Caller can pass in an object of custom data in lieu of the handler + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + selector = handleObjIn.selector; + } + + // Ensure that invalid selectors throw exceptions at attach time + // Evaluate against documentElement in case elem is a non-element node (e.g., document) + if ( selector ) { + jQuery.find.matchesSelector( documentElement, selector ); + } + + // Make sure that the handler has a unique ID, used to find/remove it later + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure and main handler, if this is the first + if ( !( events = elemData.events ) ) { + events = elemData.events = {}; + } + if ( !( eventHandle = elemData.handle ) ) { + eventHandle = elemData.handle = function( e ) { + + // Discard the second event of a jQuery.event.trigger() and + // when an event is called after a page has unloaded + return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? + jQuery.event.dispatch.apply( elem, arguments ) : undefined; + }; + } + + // Handle multiple events separated by a space + types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); + + // There *must* be a type, no attaching namespace-only handlers + if ( !type ) { + continue; + } + + // If event changes its type, use the special event handlers for the changed type + special = jQuery.event.special[ type ] || {}; + + // If selector defined, determine special event api type, otherwise given type + type = ( selector ? special.delegateType : special.bindType ) || type; + + // Update special based on newly reset type + special = jQuery.event.special[ type ] || {}; + + // handleObj is passed to all event handlers + handleObj = jQuery.extend( { + type: type, + origType: origType, + data: data, + handler: handler, + guid: handler.guid, + selector: selector, + needsContext: selector && jQuery.expr.match.needsContext.test( selector ), + namespace: namespaces.join( "." ) + }, handleObjIn ); + + // Init the event handler queue if we're the first + if ( !( handlers = events[ type ] ) ) { + handlers = events[ type ] = []; + handlers.delegateCount = 0; + + // Only use addEventListener if the special events handler returns false + if ( !special.setup || + special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add to the element's handler list, delegates in front + if ( selector ) { + handlers.splice( handlers.delegateCount++, 0, handleObj ); + } else { + handlers.push( handleObj ); + } + + // Keep track of which events have ever been used, for event optimization + jQuery.event.global[ type ] = true; + } + + }, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, selector, mappedTypes ) { + + var j, origCount, tmp, + events, t, handleObj, + special, handlers, type, namespaces, origType, + elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); + + if ( !elemData || !( events = elemData.events ) ) { + return; + } + + // Once for each type.namespace in types; type may be omitted + types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); + + // Unbind all events (on this namespace, if provided) for the element + if ( !type ) { + for ( type in events ) { + jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); + } + continue; + } + + special = jQuery.event.special[ type ] || {}; + type = ( selector ? special.delegateType : special.bindType ) || type; + handlers = events[ type ] || []; + tmp = tmp[ 2 ] && + new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); + + // Remove matching events + origCount = j = handlers.length; + while ( j-- ) { + handleObj = handlers[ j ]; + + if ( ( mappedTypes || origType === handleObj.origType ) && + ( !handler || handler.guid === handleObj.guid ) && + ( !tmp || tmp.test( handleObj.namespace ) ) && + ( !selector || selector === handleObj.selector || + selector === "**" && handleObj.selector ) ) { + handlers.splice( j, 1 ); + + if ( handleObj.selector ) { + handlers.delegateCount--; + } + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + } + + // Remove generic event handler if we removed something and no more handlers exist + // (avoids potential for endless recursion during removal of special event handlers) + if ( origCount && !handlers.length ) { + if ( !special.teardown || + special.teardown.call( elem, namespaces, elemData.handle ) === false ) { + + jQuery.removeEvent( elem, type, elemData.handle ); + } + + delete events[ type ]; + } + } + + // Remove data and the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + dataPriv.remove( elem, "handle events" ); + } + }, + + dispatch: function( nativeEvent ) { + + // Make a writable jQuery.Event from the native event object + var event = jQuery.event.fix( nativeEvent ); + + var i, j, ret, matched, handleObj, handlerQueue, + args = new Array( arguments.length ), + handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [], + special = jQuery.event.special[ event.type ] || {}; + + // Use the fix-ed jQuery.Event rather than the (read-only) native event + args[ 0 ] = event; + + for ( i = 1; i < arguments.length; i++ ) { + args[ i ] = arguments[ i ]; + } + + event.delegateTarget = this; + + // Call the preDispatch hook for the mapped type, and let it bail if desired + if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { + return; + } + + // Determine handlers + handlerQueue = jQuery.event.handlers.call( this, event, handlers ); + + // Run delegates first; they may want to stop propagation beneath us + i = 0; + while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { + event.currentTarget = matched.elem; + + j = 0; + while ( ( handleObj = matched.handlers[ j++ ] ) && + !event.isImmediatePropagationStopped() ) { + + // Triggered event must either 1) have no namespace, or 2) have namespace(s) + // a subset or equal to those in the bound event (both can have no namespace). + if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) { + + event.handleObj = handleObj; + event.data = handleObj.data; + + ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || + handleObj.handler ).apply( matched.elem, args ); + + if ( ret !== undefined ) { + if ( ( event.result = ret ) === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + } + } + } + + // Call the postDispatch hook for the mapped type + if ( special.postDispatch ) { + special.postDispatch.call( this, event ); + } + + return event.result; + }, + + handlers: function( event, handlers ) { + var i, handleObj, sel, matchedHandlers, matchedSelectors, + handlerQueue = [], + delegateCount = handlers.delegateCount, + cur = event.target; + + // Find delegate handlers + if ( delegateCount && + + // Support: IE <=9 + // Black-hole SVG instance trees (trac-13180) + cur.nodeType && + + // Support: Firefox <=42 + // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) + // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click + // Support: IE 11 only + // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) + !( event.type === "click" && event.button >= 1 ) ) { + + for ( ; cur !== this; cur = cur.parentNode || this ) { + + // Don't check non-elements (#13208) + // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) + if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { + matchedHandlers = []; + matchedSelectors = {}; + for ( i = 0; i < delegateCount; i++ ) { + handleObj = handlers[ i ]; + + // Don't conflict with Object.prototype properties (#13203) + sel = handleObj.selector + " "; + + if ( matchedSelectors[ sel ] === undefined ) { + matchedSelectors[ sel ] = handleObj.needsContext ? + jQuery( sel, this ).index( cur ) > -1 : + jQuery.find( sel, this, null, [ cur ] ).length; + } + if ( matchedSelectors[ sel ] ) { + matchedHandlers.push( handleObj ); + } + } + if ( matchedHandlers.length ) { + handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); + } + } + } + } + + // Add the remaining (directly-bound) handlers + cur = this; + if ( delegateCount < handlers.length ) { + handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); + } + + return handlerQueue; + }, + + addProp: function( name, hook ) { + Object.defineProperty( jQuery.Event.prototype, name, { + enumerable: true, + configurable: true, + + get: jQuery.isFunction( hook ) ? + function() { + if ( this.originalEvent ) { + return hook( this.originalEvent ); + } + } : + function() { + if ( this.originalEvent ) { + return this.originalEvent[ name ]; + } + }, + + set: function( value ) { + Object.defineProperty( this, name, { + enumerable: true, + configurable: true, + writable: true, + value: value + } ); + } + } ); + }, + + fix: function( originalEvent ) { + return originalEvent[ jQuery.expando ] ? + originalEvent : + new jQuery.Event( originalEvent ); + }, + + special: { + load: { + + // Prevent triggered image.load events from bubbling to window.load + noBubble: true + }, + focus: { + + // Fire native event if possible so blur/focus sequence is correct + trigger: function() { + if ( this !== safeActiveElement() && this.focus ) { + this.focus(); + return false; + } + }, + delegateType: "focusin" + }, + blur: { + trigger: function() { + if ( this === safeActiveElement() && this.blur ) { + this.blur(); + return false; + } + }, + delegateType: "focusout" + }, + click: { + + // For checkbox, fire native event so checked state will be right + trigger: function() { + if ( this.type === "checkbox" && this.click && nodeName( this, "input" ) ) { + this.click(); + return false; + } + }, + + // For cross-browser consistency, don't fire native .click() on links + _default: function( event ) { + return nodeName( event.target, "a" ); + } + }, + + beforeunload: { + postDispatch: function( event ) { + + // Support: Firefox 20+ + // Firefox doesn't alert if the returnValue field is not set. + if ( event.result !== undefined && event.originalEvent ) { + event.originalEvent.returnValue = event.result; + } + } + } + } +}; + +jQuery.removeEvent = function( elem, type, handle ) { + + // This "if" is needed for plain objects + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle ); + } +}; + +jQuery.Event = function( src, props ) { + + // Allow instantiation without the 'new' keyword + if ( !( this instanceof jQuery.Event ) ) { + return new jQuery.Event( src, props ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + + // Events bubbling up the document may have been marked as prevented + // by a handler lower down the tree; reflect the correct value. + this.isDefaultPrevented = src.defaultPrevented || + src.defaultPrevented === undefined && + + // Support: Android <=2.3 only + src.returnValue === false ? + returnTrue : + returnFalse; + + // Create target properties + // Support: Safari <=6 - 7 only + // Target should not be a text node (#504, #13143) + this.target = ( src.target && src.target.nodeType === 3 ) ? + src.target.parentNode : + src.target; + + this.currentTarget = src.currentTarget; + this.relatedTarget = src.relatedTarget; + + // Event type + } else { + this.type = src; + } + + // Put explicitly provided properties onto the event object + if ( props ) { + jQuery.extend( this, props ); + } + + // Create a timestamp if incoming event doesn't have one + this.timeStamp = src && src.timeStamp || jQuery.now(); + + // Mark it as fixed + this[ jQuery.expando ] = true; +}; + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + constructor: jQuery.Event, + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse, + isSimulated: false, + + preventDefault: function() { + var e = this.originalEvent; + + this.isDefaultPrevented = returnTrue; + + if ( e && !this.isSimulated ) { + e.preventDefault(); + } + }, + stopPropagation: function() { + var e = this.originalEvent; + + this.isPropagationStopped = returnTrue; + + if ( e && !this.isSimulated ) { + e.stopPropagation(); + } + }, + stopImmediatePropagation: function() { + var e = this.originalEvent; + + this.isImmediatePropagationStopped = returnTrue; + + if ( e && !this.isSimulated ) { + e.stopImmediatePropagation(); + } + + this.stopPropagation(); + } +}; + +// Includes all common event props including KeyEvent and MouseEvent specific props +jQuery.each( { + altKey: true, + bubbles: true, + cancelable: true, + changedTouches: true, + ctrlKey: true, + detail: true, + eventPhase: true, + metaKey: true, + pageX: true, + pageY: true, + shiftKey: true, + view: true, + "char": true, + charCode: true, + key: true, + keyCode: true, + button: true, + buttons: true, + clientX: true, + clientY: true, + offsetX: true, + offsetY: true, + pointerId: true, + pointerType: true, + screenX: true, + screenY: true, + targetTouches: true, + toElement: true, + touches: true, + + which: function( event ) { + var button = event.button; + + // Add which for key events + if ( event.which == null && rkeyEvent.test( event.type ) ) { + return event.charCode != null ? event.charCode : event.keyCode; + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) { + if ( button & 1 ) { + return 1; + } + + if ( button & 2 ) { + return 3; + } + + if ( button & 4 ) { + return 2; + } + + return 0; + } + + return event.which; + } +}, jQuery.event.addProp ); + +// Create mouseenter/leave events using mouseover/out and event-time checks +// so that event delegation works in jQuery. +// Do the same for pointerenter/pointerleave and pointerover/pointerout +// +// Support: Safari 7 only +// Safari sends mouseenter too often; see: +// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 +// for the description of the bug (it existed in older Chrome versions as well). +jQuery.each( { + mouseenter: "mouseover", + mouseleave: "mouseout", + pointerenter: "pointerover", + pointerleave: "pointerout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + delegateType: fix, + bindType: fix, + + handle: function( event ) { + var ret, + target = this, + related = event.relatedTarget, + handleObj = event.handleObj; + + // For mouseenter/leave call the handler if related is outside the target. + // NB: No relatedTarget if the mouse left/entered the browser window + if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { + event.type = handleObj.origType; + ret = handleObj.handler.apply( this, arguments ); + event.type = fix; + } + return ret; + } + }; +} ); + +jQuery.fn.extend( { + + on: function( types, selector, data, fn ) { + return on( this, types, selector, data, fn ); + }, + one: function( types, selector, data, fn ) { + return on( this, types, selector, data, fn, 1 ); + }, + off: function( types, selector, fn ) { + var handleObj, type; + if ( types && types.preventDefault && types.handleObj ) { + + // ( event ) dispatched jQuery.Event + handleObj = types.handleObj; + jQuery( types.delegateTarget ).off( + handleObj.namespace ? + handleObj.origType + "." + handleObj.namespace : + handleObj.origType, + handleObj.selector, + handleObj.handler + ); + return this; + } + if ( typeof types === "object" ) { + + // ( types-object [, selector] ) + for ( type in types ) { + this.off( type, selector, types[ type ] ); + } + return this; + } + if ( selector === false || typeof selector === "function" ) { + + // ( types [, fn] ) + fn = selector; + selector = undefined; + } + if ( fn === false ) { + fn = returnFalse; + } + return this.each( function() { + jQuery.event.remove( this, types, fn, selector ); + } ); + } +} ); + + +var + + /* eslint-disable max-len */ + + // See https://github.com/eslint/eslint/issues/3229 + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi, + + /* eslint-enable */ + + // Support: IE <=10 - 11, Edge 12 - 13 + // In IE/Edge using regex groups here causes severe slowdowns. + // See https://connect.microsoft.com/IE/feedback/details/1736512/ + rnoInnerhtml = /\s*$/g; + +// Prefer a tbody over its parent table for containing new rows +function manipulationTarget( elem, content ) { + if ( nodeName( elem, "table" ) && + nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { + + return jQuery( ">tbody", elem )[ 0 ] || elem; + } + + return elem; +} + +// Replace/restore the type attribute of script elements for safe DOM manipulation +function disableScript( elem ) { + elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; + return elem; +} +function restoreScript( elem ) { + var match = rscriptTypeMasked.exec( elem.type ); + + if ( match ) { + elem.type = match[ 1 ]; + } else { + elem.removeAttribute( "type" ); + } + + return elem; +} + +function cloneCopyEvent( src, dest ) { + var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events; + + if ( dest.nodeType !== 1 ) { + return; + } + + // 1. Copy private data: events, handlers, etc. + if ( dataPriv.hasData( src ) ) { + pdataOld = dataPriv.access( src ); + pdataCur = dataPriv.set( dest, pdataOld ); + events = pdataOld.events; + + if ( events ) { + delete pdataCur.handle; + pdataCur.events = {}; + + for ( type in events ) { + for ( i = 0, l = events[ type ].length; i < l; i++ ) { + jQuery.event.add( dest, type, events[ type ][ i ] ); + } + } + } + } + + // 2. Copy user data + if ( dataUser.hasData( src ) ) { + udataOld = dataUser.access( src ); + udataCur = jQuery.extend( {}, udataOld ); + + dataUser.set( dest, udataCur ); + } +} + +// Fix IE bugs, see support tests +function fixInput( src, dest ) { + var nodeName = dest.nodeName.toLowerCase(); + + // Fails to persist the checked state of a cloned checkbox or radio button. + if ( nodeName === "input" && rcheckableType.test( src.type ) ) { + dest.checked = src.checked; + + // Fails to return the selected option to the default selected state when cloning options + } else if ( nodeName === "input" || nodeName === "textarea" ) { + dest.defaultValue = src.defaultValue; + } +} + +function domManip( collection, args, callback, ignored ) { + + // Flatten any nested arrays + args = concat.apply( [], args ); + + var fragment, first, scripts, hasScripts, node, doc, + i = 0, + l = collection.length, + iNoClone = l - 1, + value = args[ 0 ], + isFunction = jQuery.isFunction( value ); + + // We can't cloneNode fragments that contain checked, in WebKit + if ( isFunction || + ( l > 1 && typeof value === "string" && + !support.checkClone && rchecked.test( value ) ) ) { + return collection.each( function( index ) { + var self = collection.eq( index ); + if ( isFunction ) { + args[ 0 ] = value.call( this, index, self.html() ); + } + domManip( self, args, callback, ignored ); + } ); + } + + if ( l ) { + fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); + first = fragment.firstChild; + + if ( fragment.childNodes.length === 1 ) { + fragment = first; + } + + // Require either new content or an interest in ignored elements to invoke the callback + if ( first || ignored ) { + scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); + hasScripts = scripts.length; + + // Use the original fragment for the last item + // instead of the first because it can end up + // being emptied incorrectly in certain situations (#8070). + for ( ; i < l; i++ ) { + node = fragment; + + if ( i !== iNoClone ) { + node = jQuery.clone( node, true, true ); + + // Keep references to cloned scripts for later restoration + if ( hasScripts ) { + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( scripts, getAll( node, "script" ) ); + } + } + + callback.call( collection[ i ], node, i ); + } + + if ( hasScripts ) { + doc = scripts[ scripts.length - 1 ].ownerDocument; + + // Reenable scripts + jQuery.map( scripts, restoreScript ); + + // Evaluate executable scripts on first document insertion + for ( i = 0; i < hasScripts; i++ ) { + node = scripts[ i ]; + if ( rscriptType.test( node.type || "" ) && + !dataPriv.access( node, "globalEval" ) && + jQuery.contains( doc, node ) ) { + + if ( node.src ) { + + // Optional AJAX dependency, but won't run scripts if not present + if ( jQuery._evalUrl ) { + jQuery._evalUrl( node.src ); + } + } else { + DOMEval( node.textContent.replace( rcleanScript, "" ), doc ); + } + } + } + } + } + } + + return collection; +} + +function remove( elem, selector, keepData ) { + var node, + nodes = selector ? jQuery.filter( selector, elem ) : elem, + i = 0; + + for ( ; ( node = nodes[ i ] ) != null; i++ ) { + if ( !keepData && node.nodeType === 1 ) { + jQuery.cleanData( getAll( node ) ); + } + + if ( node.parentNode ) { + if ( keepData && jQuery.contains( node.ownerDocument, node ) ) { + setGlobalEval( getAll( node, "script" ) ); + } + node.parentNode.removeChild( node ); + } + } + + return elem; +} + +jQuery.extend( { + htmlPrefilter: function( html ) { + return html.replace( rxhtmlTag, "<$1>" ); + }, + + clone: function( elem, dataAndEvents, deepDataAndEvents ) { + var i, l, srcElements, destElements, + clone = elem.cloneNode( true ), + inPage = jQuery.contains( elem.ownerDocument, elem ); + + // Fix IE cloning issues + if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && + !jQuery.isXMLDoc( elem ) ) { + + // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 + destElements = getAll( clone ); + srcElements = getAll( elem ); + + for ( i = 0, l = srcElements.length; i < l; i++ ) { + fixInput( srcElements[ i ], destElements[ i ] ); + } + } + + // Copy the events from the original to the clone + if ( dataAndEvents ) { + if ( deepDataAndEvents ) { + srcElements = srcElements || getAll( elem ); + destElements = destElements || getAll( clone ); + + for ( i = 0, l = srcElements.length; i < l; i++ ) { + cloneCopyEvent( srcElements[ i ], destElements[ i ] ); + } + } else { + cloneCopyEvent( elem, clone ); + } + } + + // Preserve script evaluation history + destElements = getAll( clone, "script" ); + if ( destElements.length > 0 ) { + setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); + } + + // Return the cloned set + return clone; + }, + + cleanData: function( elems ) { + var data, elem, type, + special = jQuery.event.special, + i = 0; + + for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { + if ( acceptData( elem ) ) { + if ( ( data = elem[ dataPriv.expando ] ) ) { + if ( data.events ) { + for ( type in data.events ) { + if ( special[ type ] ) { + jQuery.event.remove( elem, type ); + + // This is a shortcut to avoid jQuery.event.remove's overhead + } else { + jQuery.removeEvent( elem, type, data.handle ); + } + } + } + + // Support: Chrome <=35 - 45+ + // Assign undefined instead of using delete, see Data#remove + elem[ dataPriv.expando ] = undefined; + } + if ( elem[ dataUser.expando ] ) { + + // Support: Chrome <=35 - 45+ + // Assign undefined instead of using delete, see Data#remove + elem[ dataUser.expando ] = undefined; + } + } + } + } +} ); + +jQuery.fn.extend( { + detach: function( selector ) { + return remove( this, selector, true ); + }, + + remove: function( selector ) { + return remove( this, selector ); + }, + + text: function( value ) { + return access( this, function( value ) { + return value === undefined ? + jQuery.text( this ) : + this.empty().each( function() { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + this.textContent = value; + } + } ); + }, null, value, arguments.length ); + }, + + append: function() { + return domManip( this, arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.appendChild( elem ); + } + } ); + }, + + prepend: function() { + return domManip( this, arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.insertBefore( elem, target.firstChild ); + } + } ); + }, + + before: function() { + return domManip( this, arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this ); + } + } ); + }, + + after: function() { + return domManip( this, arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this.nextSibling ); + } + } ); + }, + + empty: function() { + var elem, + i = 0; + + for ( ; ( elem = this[ i ] ) != null; i++ ) { + if ( elem.nodeType === 1 ) { + + // Prevent memory leaks + jQuery.cleanData( getAll( elem, false ) ); + + // Remove any remaining nodes + elem.textContent = ""; + } + } + + return this; + }, + + clone: function( dataAndEvents, deepDataAndEvents ) { + dataAndEvents = dataAndEvents == null ? false : dataAndEvents; + deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; + + return this.map( function() { + return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); + } ); + }, + + html: function( value ) { + return access( this, function( value ) { + var elem = this[ 0 ] || {}, + i = 0, + l = this.length; + + if ( value === undefined && elem.nodeType === 1 ) { + return elem.innerHTML; + } + + // See if we can take a shortcut and just use innerHTML + if ( typeof value === "string" && !rnoInnerhtml.test( value ) && + !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { + + value = jQuery.htmlPrefilter( value ); + + try { + for ( ; i < l; i++ ) { + elem = this[ i ] || {}; + + // Remove element nodes and prevent memory leaks + if ( elem.nodeType === 1 ) { + jQuery.cleanData( getAll( elem, false ) ); + elem.innerHTML = value; + } + } + + elem = 0; + + // If using innerHTML throws an exception, use the fallback method + } catch ( e ) {} + } + + if ( elem ) { + this.empty().append( value ); + } + }, null, value, arguments.length ); + }, + + replaceWith: function() { + var ignored = []; + + // Make the changes, replacing each non-ignored context element with the new content + return domManip( this, arguments, function( elem ) { + var parent = this.parentNode; + + if ( jQuery.inArray( this, ignored ) < 0 ) { + jQuery.cleanData( getAll( this ) ); + if ( parent ) { + parent.replaceChild( elem, this ); + } + } + + // Force callback invocation + }, ignored ); + } +} ); + +jQuery.each( { + appendTo: "append", + prependTo: "prepend", + insertBefore: "before", + insertAfter: "after", + replaceAll: "replaceWith" +}, function( name, original ) { + jQuery.fn[ name ] = function( selector ) { + var elems, + ret = [], + insert = jQuery( selector ), + last = insert.length - 1, + i = 0; + + for ( ; i <= last; i++ ) { + elems = i === last ? this : this.clone( true ); + jQuery( insert[ i ] )[ original ]( elems ); + + // Support: Android <=4.0 only, PhantomJS 1 only + // .get() because push.apply(_, arraylike) throws on ancient WebKit + push.apply( ret, elems.get() ); + } + + return this.pushStack( ret ); + }; +} ); +var rmargin = ( /^margin/ ); + +var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); + +var getStyles = function( elem ) { + + // Support: IE <=11 only, Firefox <=30 (#15098, #14150) + // IE throws on elements created in popups + // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" + var view = elem.ownerDocument.defaultView; + + if ( !view || !view.opener ) { + view = window; + } + + return view.getComputedStyle( elem ); + }; + + + +( function() { + + // Executing both pixelPosition & boxSizingReliable tests require only one layout + // so they're executed at the same time to save the second computation. + function computeStyleTests() { + + // This is a singleton, we need to execute it only once + if ( !div ) { + return; + } + + div.style.cssText = + "box-sizing:border-box;" + + "position:relative;display:block;" + + "margin:auto;border:1px;padding:1px;" + + "top:1%;width:50%"; + div.innerHTML = ""; + documentElement.appendChild( container ); + + var divStyle = window.getComputedStyle( div ); + pixelPositionVal = divStyle.top !== "1%"; + + // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 + reliableMarginLeftVal = divStyle.marginLeft === "2px"; + boxSizingReliableVal = divStyle.width === "4px"; + + // Support: Android 4.0 - 4.3 only + // Some styles come back with percentage values, even though they shouldn't + div.style.marginRight = "50%"; + pixelMarginRightVal = divStyle.marginRight === "4px"; + + documentElement.removeChild( container ); + + // Nullify the div so it wouldn't be stored in the memory and + // it will also be a sign that checks already performed + div = null; + } + + var pixelPositionVal, boxSizingReliableVal, pixelMarginRightVal, reliableMarginLeftVal, + container = document.createElement( "div" ), + div = document.createElement( "div" ); + + // Finish early in limited (non-browser) environments + if ( !div.style ) { + return; + } + + // Support: IE <=9 - 11 only + // Style of cloned element affects source element cloned (#8908) + div.style.backgroundClip = "content-box"; + div.cloneNode( true ).style.backgroundClip = ""; + support.clearCloneStyle = div.style.backgroundClip === "content-box"; + + container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" + + "padding:0;margin-top:1px;position:absolute"; + container.appendChild( div ); + + jQuery.extend( support, { + pixelPosition: function() { + computeStyleTests(); + return pixelPositionVal; + }, + boxSizingReliable: function() { + computeStyleTests(); + return boxSizingReliableVal; + }, + pixelMarginRight: function() { + computeStyleTests(); + return pixelMarginRightVal; + }, + reliableMarginLeft: function() { + computeStyleTests(); + return reliableMarginLeftVal; + } + } ); +} )(); + + +function curCSS( elem, name, computed ) { + var width, minWidth, maxWidth, ret, + + // Support: Firefox 51+ + // Retrieving style before computed somehow + // fixes an issue with getting wrong values + // on detached elements + style = elem.style; + + computed = computed || getStyles( elem ); + + // getPropertyValue is needed for: + // .css('filter') (IE 9 only, #12537) + // .css('--customProperty) (#3144) + if ( computed ) { + ret = computed.getPropertyValue( name ) || computed[ name ]; + + if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { + ret = jQuery.style( elem, name ); + } + + // A tribute to the "awesome hack by Dean Edwards" + // Android Browser returns percentage for some values, + // but width seems to be reliably pixels. + // This is against the CSSOM draft spec: + // https://drafts.csswg.org/cssom/#resolved-values + if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) { + + // Remember the original values + width = style.width; + minWidth = style.minWidth; + maxWidth = style.maxWidth; + + // Put in the new values to get a computed value out + style.minWidth = style.maxWidth = style.width = ret; + ret = computed.width; + + // Revert the changed values + style.width = width; + style.minWidth = minWidth; + style.maxWidth = maxWidth; + } + } + + return ret !== undefined ? + + // Support: IE <=9 - 11 only + // IE returns zIndex value as an integer. + ret + "" : + ret; +} + + +function addGetHookIf( conditionFn, hookFn ) { + + // Define the hook, we'll check on the first run if it's really needed. + return { + get: function() { + if ( conditionFn() ) { + + // Hook not needed (or it's not possible to use it due + // to missing dependency), remove it. + delete this.get; + return; + } + + // Hook needed; redefine it so that the support test is not executed again. + return ( this.get = hookFn ).apply( this, arguments ); + } + }; +} + + +var + + // Swappable if display is none or starts with table + // except "table", "table-cell", or "table-caption" + // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display + rdisplayswap = /^(none|table(?!-c[ea]).+)/, + rcustomProp = /^--/, + cssShow = { position: "absolute", visibility: "hidden", display: "block" }, + cssNormalTransform = { + letterSpacing: "0", + fontWeight: "400" + }, + + cssPrefixes = [ "Webkit", "Moz", "ms" ], + emptyStyle = document.createElement( "div" ).style; + +// Return a css property mapped to a potentially vendor prefixed property +function vendorPropName( name ) { + + // Shortcut for names that are not vendor prefixed + if ( name in emptyStyle ) { + return name; + } + + // Check for vendor prefixed names + var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), + i = cssPrefixes.length; + + while ( i-- ) { + name = cssPrefixes[ i ] + capName; + if ( name in emptyStyle ) { + return name; + } + } +} + +// Return a property mapped along what jQuery.cssProps suggests or to +// a vendor prefixed property. +function finalPropName( name ) { + var ret = jQuery.cssProps[ name ]; + if ( !ret ) { + ret = jQuery.cssProps[ name ] = vendorPropName( name ) || name; + } + return ret; +} + +function setPositiveNumber( elem, value, subtract ) { + + // Any relative (+/-) values have already been + // normalized at this point + var matches = rcssNum.exec( value ); + return matches ? + + // Guard against undefined "subtract", e.g., when used as in cssHooks + Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : + value; +} + +function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { + var i, + val = 0; + + // If we already have the right measurement, avoid augmentation + if ( extra === ( isBorderBox ? "border" : "content" ) ) { + i = 4; + + // Otherwise initialize for horizontal or vertical properties + } else { + i = name === "width" ? 1 : 0; + } + + for ( ; i < 4; i += 2 ) { + + // Both box models exclude margin, so add it if we want it + if ( extra === "margin" ) { + val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); + } + + if ( isBorderBox ) { + + // border-box includes padding, so remove it if we want content + if ( extra === "content" ) { + val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); + } + + // At this point, extra isn't border nor margin, so remove border + if ( extra !== "margin" ) { + val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + } + } else { + + // At this point, extra isn't content, so add padding + val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); + + // At this point, extra isn't content nor padding, so add border + if ( extra !== "padding" ) { + val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + } + } + } + + return val; +} + +function getWidthOrHeight( elem, name, extra ) { + + // Start with computed style + var valueIsBorderBox, + styles = getStyles( elem ), + val = curCSS( elem, name, styles ), + isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; + + // Computed unit is not pixels. Stop here and return. + if ( rnumnonpx.test( val ) ) { + return val; + } + + // Check for style in case a browser which returns unreliable values + // for getComputedStyle silently falls back to the reliable elem.style + valueIsBorderBox = isBorderBox && + ( support.boxSizingReliable() || val === elem.style[ name ] ); + + // Fall back to offsetWidth/Height when value is "auto" + // This happens for inline elements with no explicit setting (gh-3571) + if ( val === "auto" ) { + val = elem[ "offset" + name[ 0 ].toUpperCase() + name.slice( 1 ) ]; + } + + // Normalize "", auto, and prepare for extra + val = parseFloat( val ) || 0; + + // Use the active box-sizing model to add/subtract irrelevant styles + return ( val + + augmentWidthOrHeight( + elem, + name, + extra || ( isBorderBox ? "border" : "content" ), + valueIsBorderBox, + styles + ) + ) + "px"; +} + +jQuery.extend( { + + // Add in style property hooks for overriding the default + // behavior of getting and setting a style property + cssHooks: { + opacity: { + get: function( elem, computed ) { + if ( computed ) { + + // We should always get a number back from opacity + var ret = curCSS( elem, "opacity" ); + return ret === "" ? "1" : ret; + } + } + } + }, + + // Don't automatically add "px" to these possibly-unitless properties + cssNumber: { + "animationIterationCount": true, + "columnCount": true, + "fillOpacity": true, + "flexGrow": true, + "flexShrink": true, + "fontWeight": true, + "lineHeight": true, + "opacity": true, + "order": true, + "orphans": true, + "widows": true, + "zIndex": true, + "zoom": true + }, + + // Add in properties whose names you wish to fix before + // setting or getting the value + cssProps: { + "float": "cssFloat" + }, + + // Get and set the style property on a DOM Node + style: function( elem, name, value, extra ) { + + // Don't set styles on text and comment nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { + return; + } + + // Make sure that we're working with the right name + var ret, type, hooks, + origName = jQuery.camelCase( name ), + isCustomProp = rcustomProp.test( name ), + style = elem.style; + + // Make sure that we're working with the right name. We don't + // want to query the value if it is a CSS custom property + // since they are user-defined. + if ( !isCustomProp ) { + name = finalPropName( origName ); + } + + // Gets hook for the prefixed version, then unprefixed version + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; + + // Check if we're setting a value + if ( value !== undefined ) { + type = typeof value; + + // Convert "+=" or "-=" to relative numbers (#7345) + if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { + value = adjustCSS( elem, name, ret ); + + // Fixes bug #9237 + type = "number"; + } + + // Make sure that null and NaN values aren't set (#7116) + if ( value == null || value !== value ) { + return; + } + + // If a number was passed in, add the unit (except for certain CSS properties) + if ( type === "number" ) { + value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); + } + + // background-* props affect original clone's values + if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { + style[ name ] = "inherit"; + } + + // If a hook was provided, use that value, otherwise just set the specified value + if ( !hooks || !( "set" in hooks ) || + ( value = hooks.set( elem, value, extra ) ) !== undefined ) { + + if ( isCustomProp ) { + style.setProperty( name, value ); + } else { + style[ name ] = value; + } + } + + } else { + + // If a hook was provided get the non-computed value from there + if ( hooks && "get" in hooks && + ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { + + return ret; + } + + // Otherwise just get the value from the style object + return style[ name ]; + } + }, + + css: function( elem, name, extra, styles ) { + var val, num, hooks, + origName = jQuery.camelCase( name ), + isCustomProp = rcustomProp.test( name ); + + // Make sure that we're working with the right name. We don't + // want to modify the value if it is a CSS custom property + // since they are user-defined. + if ( !isCustomProp ) { + name = finalPropName( origName ); + } + + // Try prefixed name followed by the unprefixed name + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; + + // If a hook was provided get the computed value from there + if ( hooks && "get" in hooks ) { + val = hooks.get( elem, true, extra ); + } + + // Otherwise, if a way to get the computed value exists, use that + if ( val === undefined ) { + val = curCSS( elem, name, styles ); + } + + // Convert "normal" to computed value + if ( val === "normal" && name in cssNormalTransform ) { + val = cssNormalTransform[ name ]; + } + + // Make numeric if forced or a qualifier was provided and val looks numeric + if ( extra === "" || extra ) { + num = parseFloat( val ); + return extra === true || isFinite( num ) ? num || 0 : val; + } + + return val; + } +} ); + +jQuery.each( [ "height", "width" ], function( i, name ) { + jQuery.cssHooks[ name ] = { + get: function( elem, computed, extra ) { + if ( computed ) { + + // Certain elements can have dimension info if we invisibly show them + // but it must have a current display style that would benefit + return rdisplayswap.test( jQuery.css( elem, "display" ) ) && + + // Support: Safari 8+ + // Table columns in Safari have non-zero offsetWidth & zero + // getBoundingClientRect().width unless display is changed. + // Support: IE <=11 only + // Running getBoundingClientRect on a disconnected node + // in IE throws an error. + ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? + swap( elem, cssShow, function() { + return getWidthOrHeight( elem, name, extra ); + } ) : + getWidthOrHeight( elem, name, extra ); + } + }, + + set: function( elem, value, extra ) { + var matches, + styles = extra && getStyles( elem ), + subtract = extra && augmentWidthOrHeight( + elem, + name, + extra, + jQuery.css( elem, "boxSizing", false, styles ) === "border-box", + styles + ); + + // Convert to pixels if value adjustment is needed + if ( subtract && ( matches = rcssNum.exec( value ) ) && + ( matches[ 3 ] || "px" ) !== "px" ) { + + elem.style[ name ] = value; + value = jQuery.css( elem, name ); + } + + return setPositiveNumber( elem, value, subtract ); + } + }; +} ); + +jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, + function( elem, computed ) { + if ( computed ) { + return ( parseFloat( curCSS( elem, "marginLeft" ) ) || + elem.getBoundingClientRect().left - + swap( elem, { marginLeft: 0 }, function() { + return elem.getBoundingClientRect().left; + } ) + ) + "px"; + } + } +); + +// These hooks are used by animate to expand properties +jQuery.each( { + margin: "", + padding: "", + border: "Width" +}, function( prefix, suffix ) { + jQuery.cssHooks[ prefix + suffix ] = { + expand: function( value ) { + var i = 0, + expanded = {}, + + // Assumes a single number if not a string + parts = typeof value === "string" ? value.split( " " ) : [ value ]; + + for ( ; i < 4; i++ ) { + expanded[ prefix + cssExpand[ i ] + suffix ] = + parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; + } + + return expanded; + } + }; + + if ( !rmargin.test( prefix ) ) { + jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; + } +} ); + +jQuery.fn.extend( { + css: function( name, value ) { + return access( this, function( elem, name, value ) { + var styles, len, + map = {}, + i = 0; + + if ( Array.isArray( name ) ) { + styles = getStyles( elem ); + len = name.length; + + for ( ; i < len; i++ ) { + map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); + } + + return map; + } + + return value !== undefined ? + jQuery.style( elem, name, value ) : + jQuery.css( elem, name ); + }, name, value, arguments.length > 1 ); + } +} ); + + +function Tween( elem, options, prop, end, easing ) { + return new Tween.prototype.init( elem, options, prop, end, easing ); +} +jQuery.Tween = Tween; + +Tween.prototype = { + constructor: Tween, + init: function( elem, options, prop, end, easing, unit ) { + this.elem = elem; + this.prop = prop; + this.easing = easing || jQuery.easing._default; + this.options = options; + this.start = this.now = this.cur(); + this.end = end; + this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); + }, + cur: function() { + var hooks = Tween.propHooks[ this.prop ]; + + return hooks && hooks.get ? + hooks.get( this ) : + Tween.propHooks._default.get( this ); + }, + run: function( percent ) { + var eased, + hooks = Tween.propHooks[ this.prop ]; + + if ( this.options.duration ) { + this.pos = eased = jQuery.easing[ this.easing ]( + percent, this.options.duration * percent, 0, 1, this.options.duration + ); + } else { + this.pos = eased = percent; + } + this.now = ( this.end - this.start ) * eased + this.start; + + if ( this.options.step ) { + this.options.step.call( this.elem, this.now, this ); + } + + if ( hooks && hooks.set ) { + hooks.set( this ); + } else { + Tween.propHooks._default.set( this ); + } + return this; + } +}; + +Tween.prototype.init.prototype = Tween.prototype; + +Tween.propHooks = { + _default: { + get: function( tween ) { + var result; + + // Use a property on the element directly when it is not a DOM element, + // or when there is no matching style property that exists. + if ( tween.elem.nodeType !== 1 || + tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { + return tween.elem[ tween.prop ]; + } + + // Passing an empty string as a 3rd parameter to .css will automatically + // attempt a parseFloat and fallback to a string if the parse fails. + // Simple values such as "10px" are parsed to Float; + // complex values such as "rotate(1rad)" are returned as-is. + result = jQuery.css( tween.elem, tween.prop, "" ); + + // Empty strings, null, undefined and "auto" are converted to 0. + return !result || result === "auto" ? 0 : result; + }, + set: function( tween ) { + + // Use step hook for back compat. + // Use cssHook if its there. + // Use .style if available and use plain properties where available. + if ( jQuery.fx.step[ tween.prop ] ) { + jQuery.fx.step[ tween.prop ]( tween ); + } else if ( tween.elem.nodeType === 1 && + ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || + jQuery.cssHooks[ tween.prop ] ) ) { + jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); + } else { + tween.elem[ tween.prop ] = tween.now; + } + } + } +}; + +// Support: IE <=9 only +// Panic based approach to setting things on disconnected nodes +Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { + set: function( tween ) { + if ( tween.elem.nodeType && tween.elem.parentNode ) { + tween.elem[ tween.prop ] = tween.now; + } + } +}; + +jQuery.easing = { + linear: function( p ) { + return p; + }, + swing: function( p ) { + return 0.5 - Math.cos( p * Math.PI ) / 2; + }, + _default: "swing" +}; + +jQuery.fx = Tween.prototype.init; + +// Back compat <1.8 extension point +jQuery.fx.step = {}; + + + + +var + fxNow, inProgress, + rfxtypes = /^(?:toggle|show|hide)$/, + rrun = /queueHooks$/; + +function schedule() { + if ( inProgress ) { + if ( document.hidden === false && window.requestAnimationFrame ) { + window.requestAnimationFrame( schedule ); + } else { + window.setTimeout( schedule, jQuery.fx.interval ); + } + + jQuery.fx.tick(); + } +} + +// Animations created synchronously will run synchronously +function createFxNow() { + window.setTimeout( function() { + fxNow = undefined; + } ); + return ( fxNow = jQuery.now() ); +} + +// Generate parameters to create a standard animation +function genFx( type, includeWidth ) { + var which, + i = 0, + attrs = { height: type }; + + // If we include width, step value is 1 to do all cssExpand values, + // otherwise step value is 2 to skip over Left and Right + includeWidth = includeWidth ? 1 : 0; + for ( ; i < 4; i += 2 - includeWidth ) { + which = cssExpand[ i ]; + attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; + } + + if ( includeWidth ) { + attrs.opacity = attrs.width = type; + } + + return attrs; +} + +function createTween( value, prop, animation ) { + var tween, + collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), + index = 0, + length = collection.length; + for ( ; index < length; index++ ) { + if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { + + // We're done with this property + return tween; + } + } +} + +function defaultPrefilter( elem, props, opts ) { + var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, + isBox = "width" in props || "height" in props, + anim = this, + orig = {}, + style = elem.style, + hidden = elem.nodeType && isHiddenWithinTree( elem ), + dataShow = dataPriv.get( elem, "fxshow" ); + + // Queue-skipping animations hijack the fx hooks + if ( !opts.queue ) { + hooks = jQuery._queueHooks( elem, "fx" ); + if ( hooks.unqueued == null ) { + hooks.unqueued = 0; + oldfire = hooks.empty.fire; + hooks.empty.fire = function() { + if ( !hooks.unqueued ) { + oldfire(); + } + }; + } + hooks.unqueued++; + + anim.always( function() { + + // Ensure the complete handler is called before this completes + anim.always( function() { + hooks.unqueued--; + if ( !jQuery.queue( elem, "fx" ).length ) { + hooks.empty.fire(); + } + } ); + } ); + } + + // Detect show/hide animations + for ( prop in props ) { + value = props[ prop ]; + if ( rfxtypes.test( value ) ) { + delete props[ prop ]; + toggle = toggle || value === "toggle"; + if ( value === ( hidden ? "hide" : "show" ) ) { + + // Pretend to be hidden if this is a "show" and + // there is still data from a stopped show/hide + if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { + hidden = true; + + // Ignore all other no-op show/hide data + } else { + continue; + } + } + orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); + } + } + + // Bail out if this is a no-op like .hide().hide() + propTween = !jQuery.isEmptyObject( props ); + if ( !propTween && jQuery.isEmptyObject( orig ) ) { + return; + } + + // Restrict "overflow" and "display" styles during box animations + if ( isBox && elem.nodeType === 1 ) { + + // Support: IE <=9 - 11, Edge 12 - 13 + // Record all 3 overflow attributes because IE does not infer the shorthand + // from identically-valued overflowX and overflowY + opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; + + // Identify a display type, preferring old show/hide data over the CSS cascade + restoreDisplay = dataShow && dataShow.display; + if ( restoreDisplay == null ) { + restoreDisplay = dataPriv.get( elem, "display" ); + } + display = jQuery.css( elem, "display" ); + if ( display === "none" ) { + if ( restoreDisplay ) { + display = restoreDisplay; + } else { + + // Get nonempty value(s) by temporarily forcing visibility + showHide( [ elem ], true ); + restoreDisplay = elem.style.display || restoreDisplay; + display = jQuery.css( elem, "display" ); + showHide( [ elem ] ); + } + } + + // Animate inline elements as inline-block + if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { + if ( jQuery.css( elem, "float" ) === "none" ) { + + // Restore the original display value at the end of pure show/hide animations + if ( !propTween ) { + anim.done( function() { + style.display = restoreDisplay; + } ); + if ( restoreDisplay == null ) { + display = style.display; + restoreDisplay = display === "none" ? "" : display; + } + } + style.display = "inline-block"; + } + } + } + + if ( opts.overflow ) { + style.overflow = "hidden"; + anim.always( function() { + style.overflow = opts.overflow[ 0 ]; + style.overflowX = opts.overflow[ 1 ]; + style.overflowY = opts.overflow[ 2 ]; + } ); + } + + // Implement show/hide animations + propTween = false; + for ( prop in orig ) { + + // General show/hide setup for this element animation + if ( !propTween ) { + if ( dataShow ) { + if ( "hidden" in dataShow ) { + hidden = dataShow.hidden; + } + } else { + dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); + } + + // Store hidden/visible for toggle so `.stop().toggle()` "reverses" + if ( toggle ) { + dataShow.hidden = !hidden; + } + + // Show elements before animating them + if ( hidden ) { + showHide( [ elem ], true ); + } + + /* eslint-disable no-loop-func */ + + anim.done( function() { + + /* eslint-enable no-loop-func */ + + // The final step of a "hide" animation is actually hiding the element + if ( !hidden ) { + showHide( [ elem ] ); + } + dataPriv.remove( elem, "fxshow" ); + for ( prop in orig ) { + jQuery.style( elem, prop, orig[ prop ] ); + } + } ); + } + + // Per-property setup + propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); + if ( !( prop in dataShow ) ) { + dataShow[ prop ] = propTween.start; + if ( hidden ) { + propTween.end = propTween.start; + propTween.start = 0; + } + } + } +} + +function propFilter( props, specialEasing ) { + var index, name, easing, value, hooks; + + // camelCase, specialEasing and expand cssHook pass + for ( index in props ) { + name = jQuery.camelCase( index ); + easing = specialEasing[ name ]; + value = props[ index ]; + if ( Array.isArray( value ) ) { + easing = value[ 1 ]; + value = props[ index ] = value[ 0 ]; + } + + if ( index !== name ) { + props[ name ] = value; + delete props[ index ]; + } + + hooks = jQuery.cssHooks[ name ]; + if ( hooks && "expand" in hooks ) { + value = hooks.expand( value ); + delete props[ name ]; + + // Not quite $.extend, this won't overwrite existing keys. + // Reusing 'index' because we have the correct "name" + for ( index in value ) { + if ( !( index in props ) ) { + props[ index ] = value[ index ]; + specialEasing[ index ] = easing; + } + } + } else { + specialEasing[ name ] = easing; + } + } +} + +function Animation( elem, properties, options ) { + var result, + stopped, + index = 0, + length = Animation.prefilters.length, + deferred = jQuery.Deferred().always( function() { + + // Don't match elem in the :animated selector + delete tick.elem; + } ), + tick = function() { + if ( stopped ) { + return false; + } + var currentTime = fxNow || createFxNow(), + remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), + + // Support: Android 2.3 only + // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) + temp = remaining / animation.duration || 0, + percent = 1 - temp, + index = 0, + length = animation.tweens.length; + + for ( ; index < length; index++ ) { + animation.tweens[ index ].run( percent ); + } + + deferred.notifyWith( elem, [ animation, percent, remaining ] ); + + // If there's more to do, yield + if ( percent < 1 && length ) { + return remaining; + } + + // If this was an empty animation, synthesize a final progress notification + if ( !length ) { + deferred.notifyWith( elem, [ animation, 1, 0 ] ); + } + + // Resolve the animation and report its conclusion + deferred.resolveWith( elem, [ animation ] ); + return false; + }, + animation = deferred.promise( { + elem: elem, + props: jQuery.extend( {}, properties ), + opts: jQuery.extend( true, { + specialEasing: {}, + easing: jQuery.easing._default + }, options ), + originalProperties: properties, + originalOptions: options, + startTime: fxNow || createFxNow(), + duration: options.duration, + tweens: [], + createTween: function( prop, end ) { + var tween = jQuery.Tween( elem, animation.opts, prop, end, + animation.opts.specialEasing[ prop ] || animation.opts.easing ); + animation.tweens.push( tween ); + return tween; + }, + stop: function( gotoEnd ) { + var index = 0, + + // If we are going to the end, we want to run all the tweens + // otherwise we skip this part + length = gotoEnd ? animation.tweens.length : 0; + if ( stopped ) { + return this; + } + stopped = true; + for ( ; index < length; index++ ) { + animation.tweens[ index ].run( 1 ); + } + + // Resolve when we played the last frame; otherwise, reject + if ( gotoEnd ) { + deferred.notifyWith( elem, [ animation, 1, 0 ] ); + deferred.resolveWith( elem, [ animation, gotoEnd ] ); + } else { + deferred.rejectWith( elem, [ animation, gotoEnd ] ); + } + return this; + } + } ), + props = animation.props; + + propFilter( props, animation.opts.specialEasing ); + + for ( ; index < length; index++ ) { + result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); + if ( result ) { + if ( jQuery.isFunction( result.stop ) ) { + jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = + jQuery.proxy( result.stop, result ); + } + return result; + } + } + + jQuery.map( props, createTween, animation ); + + if ( jQuery.isFunction( animation.opts.start ) ) { + animation.opts.start.call( elem, animation ); + } + + // Attach callbacks from options + animation + .progress( animation.opts.progress ) + .done( animation.opts.done, animation.opts.complete ) + .fail( animation.opts.fail ) + .always( animation.opts.always ); + + jQuery.fx.timer( + jQuery.extend( tick, { + elem: elem, + anim: animation, + queue: animation.opts.queue + } ) + ); + + return animation; +} + +jQuery.Animation = jQuery.extend( Animation, { + + tweeners: { + "*": [ function( prop, value ) { + var tween = this.createTween( prop, value ); + adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); + return tween; + } ] + }, + + tweener: function( props, callback ) { + if ( jQuery.isFunction( props ) ) { + callback = props; + props = [ "*" ]; + } else { + props = props.match( rnothtmlwhite ); + } + + var prop, + index = 0, + length = props.length; + + for ( ; index < length; index++ ) { + prop = props[ index ]; + Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; + Animation.tweeners[ prop ].unshift( callback ); + } + }, + + prefilters: [ defaultPrefilter ], + + prefilter: function( callback, prepend ) { + if ( prepend ) { + Animation.prefilters.unshift( callback ); + } else { + Animation.prefilters.push( callback ); + } + } +} ); + +jQuery.speed = function( speed, easing, fn ) { + var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { + complete: fn || !fn && easing || + jQuery.isFunction( speed ) && speed, + duration: speed, + easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing + }; + + // Go to the end state if fx are off + if ( jQuery.fx.off ) { + opt.duration = 0; + + } else { + if ( typeof opt.duration !== "number" ) { + if ( opt.duration in jQuery.fx.speeds ) { + opt.duration = jQuery.fx.speeds[ opt.duration ]; + + } else { + opt.duration = jQuery.fx.speeds._default; + } + } + } + + // Normalize opt.queue - true/undefined/null -> "fx" + if ( opt.queue == null || opt.queue === true ) { + opt.queue = "fx"; + } + + // Queueing + opt.old = opt.complete; + + opt.complete = function() { + if ( jQuery.isFunction( opt.old ) ) { + opt.old.call( this ); + } + + if ( opt.queue ) { + jQuery.dequeue( this, opt.queue ); + } + }; + + return opt; +}; + +jQuery.fn.extend( { + fadeTo: function( speed, to, easing, callback ) { + + // Show any hidden elements after setting opacity to 0 + return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() + + // Animate to the value specified + .end().animate( { opacity: to }, speed, easing, callback ); + }, + animate: function( prop, speed, easing, callback ) { + var empty = jQuery.isEmptyObject( prop ), + optall = jQuery.speed( speed, easing, callback ), + doAnimation = function() { + + // Operate on a copy of prop so per-property easing won't be lost + var anim = Animation( this, jQuery.extend( {}, prop ), optall ); + + // Empty animations, or finishing resolves immediately + if ( empty || dataPriv.get( this, "finish" ) ) { + anim.stop( true ); + } + }; + doAnimation.finish = doAnimation; + + return empty || optall.queue === false ? + this.each( doAnimation ) : + this.queue( optall.queue, doAnimation ); + }, + stop: function( type, clearQueue, gotoEnd ) { + var stopQueue = function( hooks ) { + var stop = hooks.stop; + delete hooks.stop; + stop( gotoEnd ); + }; + + if ( typeof type !== "string" ) { + gotoEnd = clearQueue; + clearQueue = type; + type = undefined; + } + if ( clearQueue && type !== false ) { + this.queue( type || "fx", [] ); + } + + return this.each( function() { + var dequeue = true, + index = type != null && type + "queueHooks", + timers = jQuery.timers, + data = dataPriv.get( this ); + + if ( index ) { + if ( data[ index ] && data[ index ].stop ) { + stopQueue( data[ index ] ); + } + } else { + for ( index in data ) { + if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { + stopQueue( data[ index ] ); + } + } + } + + for ( index = timers.length; index--; ) { + if ( timers[ index ].elem === this && + ( type == null || timers[ index ].queue === type ) ) { + + timers[ index ].anim.stop( gotoEnd ); + dequeue = false; + timers.splice( index, 1 ); + } + } + + // Start the next in the queue if the last step wasn't forced. + // Timers currently will call their complete callbacks, which + // will dequeue but only if they were gotoEnd. + if ( dequeue || !gotoEnd ) { + jQuery.dequeue( this, type ); + } + } ); + }, + finish: function( type ) { + if ( type !== false ) { + type = type || "fx"; + } + return this.each( function() { + var index, + data = dataPriv.get( this ), + queue = data[ type + "queue" ], + hooks = data[ type + "queueHooks" ], + timers = jQuery.timers, + length = queue ? queue.length : 0; + + // Enable finishing flag on private data + data.finish = true; + + // Empty the queue first + jQuery.queue( this, type, [] ); + + if ( hooks && hooks.stop ) { + hooks.stop.call( this, true ); + } + + // Look for any active animations, and finish them + for ( index = timers.length; index--; ) { + if ( timers[ index ].elem === this && timers[ index ].queue === type ) { + timers[ index ].anim.stop( true ); + timers.splice( index, 1 ); + } + } + + // Look for any animations in the old queue and finish them + for ( index = 0; index < length; index++ ) { + if ( queue[ index ] && queue[ index ].finish ) { + queue[ index ].finish.call( this ); + } + } + + // Turn off finishing flag + delete data.finish; + } ); + } +} ); + +jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) { + var cssFn = jQuery.fn[ name ]; + jQuery.fn[ name ] = function( speed, easing, callback ) { + return speed == null || typeof speed === "boolean" ? + cssFn.apply( this, arguments ) : + this.animate( genFx( name, true ), speed, easing, callback ); + }; +} ); + +// Generate shortcuts for custom animations +jQuery.each( { + slideDown: genFx( "show" ), + slideUp: genFx( "hide" ), + slideToggle: genFx( "toggle" ), + fadeIn: { opacity: "show" }, + fadeOut: { opacity: "hide" }, + fadeToggle: { opacity: "toggle" } +}, function( name, props ) { + jQuery.fn[ name ] = function( speed, easing, callback ) { + return this.animate( props, speed, easing, callback ); + }; +} ); + +jQuery.timers = []; +jQuery.fx.tick = function() { + var timer, + i = 0, + timers = jQuery.timers; + + fxNow = jQuery.now(); + + for ( ; i < timers.length; i++ ) { + timer = timers[ i ]; + + // Run the timer and safely remove it when done (allowing for external removal) + if ( !timer() && timers[ i ] === timer ) { + timers.splice( i--, 1 ); + } + } + + if ( !timers.length ) { + jQuery.fx.stop(); + } + fxNow = undefined; +}; + +jQuery.fx.timer = function( timer ) { + jQuery.timers.push( timer ); + jQuery.fx.start(); +}; + +jQuery.fx.interval = 13; +jQuery.fx.start = function() { + if ( inProgress ) { + return; + } + + inProgress = true; + schedule(); +}; + +jQuery.fx.stop = function() { + inProgress = null; +}; + +jQuery.fx.speeds = { + slow: 600, + fast: 200, + + // Default speed + _default: 400 +}; + + +// Based off of the plugin by Clint Helfers, with permission. +// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ +jQuery.fn.delay = function( time, type ) { + time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; + type = type || "fx"; + + return this.queue( type, function( next, hooks ) { + var timeout = window.setTimeout( next, time ); + hooks.stop = function() { + window.clearTimeout( timeout ); + }; + } ); +}; + + +( function() { + var input = document.createElement( "input" ), + select = document.createElement( "select" ), + opt = select.appendChild( document.createElement( "option" ) ); + + input.type = "checkbox"; + + // Support: Android <=4.3 only + // Default value for a checkbox should be "on" + support.checkOn = input.value !== ""; + + // Support: IE <=11 only + // Must access selectedIndex to make default options select + support.optSelected = opt.selected; + + // Support: IE <=11 only + // An input loses its value after becoming a radio + input = document.createElement( "input" ); + input.value = "t"; + input.type = "radio"; + support.radioValue = input.value === "t"; +} )(); + + +var boolHook, + attrHandle = jQuery.expr.attrHandle; + +jQuery.fn.extend( { + attr: function( name, value ) { + return access( this, jQuery.attr, name, value, arguments.length > 1 ); + }, + + removeAttr: function( name ) { + return this.each( function() { + jQuery.removeAttr( this, name ); + } ); + } +} ); + +jQuery.extend( { + attr: function( elem, name, value ) { + var ret, hooks, + nType = elem.nodeType; + + // Don't get/set attributes on text, comment and attribute nodes + if ( nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + // Fallback to prop when attributes are not supported + if ( typeof elem.getAttribute === "undefined" ) { + return jQuery.prop( elem, name, value ); + } + + // Attribute hooks are determined by the lowercase version + // Grab necessary hook if one is defined + if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { + hooks = jQuery.attrHooks[ name.toLowerCase() ] || + ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); + } + + if ( value !== undefined ) { + if ( value === null ) { + jQuery.removeAttr( elem, name ); + return; + } + + if ( hooks && "set" in hooks && + ( ret = hooks.set( elem, value, name ) ) !== undefined ) { + return ret; + } + + elem.setAttribute( name, value + "" ); + return value; + } + + if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { + return ret; + } + + ret = jQuery.find.attr( elem, name ); + + // Non-existent attributes return null, we normalize to undefined + return ret == null ? undefined : ret; + }, + + attrHooks: { + type: { + set: function( elem, value ) { + if ( !support.radioValue && value === "radio" && + nodeName( elem, "input" ) ) { + var val = elem.value; + elem.setAttribute( "type", value ); + if ( val ) { + elem.value = val; + } + return value; + } + } + } + }, + + removeAttr: function( elem, value ) { + var name, + i = 0, + + // Attribute names can contain non-HTML whitespace characters + // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 + attrNames = value && value.match( rnothtmlwhite ); + + if ( attrNames && elem.nodeType === 1 ) { + while ( ( name = attrNames[ i++ ] ) ) { + elem.removeAttribute( name ); + } + } + } +} ); + +// Hooks for boolean attributes +boolHook = { + set: function( elem, value, name ) { + if ( value === false ) { + + // Remove boolean attributes when set to false + jQuery.removeAttr( elem, name ); + } else { + elem.setAttribute( name, name ); + } + return name; + } +}; + +jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { + var getter = attrHandle[ name ] || jQuery.find.attr; + + attrHandle[ name ] = function( elem, name, isXML ) { + var ret, handle, + lowercaseName = name.toLowerCase(); + + if ( !isXML ) { + + // Avoid an infinite loop by temporarily removing this function from the getter + handle = attrHandle[ lowercaseName ]; + attrHandle[ lowercaseName ] = ret; + ret = getter( elem, name, isXML ) != null ? + lowercaseName : + null; + attrHandle[ lowercaseName ] = handle; + } + return ret; + }; +} ); + + + + +var rfocusable = /^(?:input|select|textarea|button)$/i, + rclickable = /^(?:a|area)$/i; + +jQuery.fn.extend( { + prop: function( name, value ) { + return access( this, jQuery.prop, name, value, arguments.length > 1 ); + }, + + removeProp: function( name ) { + return this.each( function() { + delete this[ jQuery.propFix[ name ] || name ]; + } ); + } +} ); + +jQuery.extend( { + prop: function( elem, name, value ) { + var ret, hooks, + nType = elem.nodeType; + + // Don't get/set properties on text, comment and attribute nodes + if ( nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { + + // Fix name and attach hooks + name = jQuery.propFix[ name ] || name; + hooks = jQuery.propHooks[ name ]; + } + + if ( value !== undefined ) { + if ( hooks && "set" in hooks && + ( ret = hooks.set( elem, value, name ) ) !== undefined ) { + return ret; + } + + return ( elem[ name ] = value ); + } + + if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { + return ret; + } + + return elem[ name ]; + }, + + propHooks: { + tabIndex: { + get: function( elem ) { + + // Support: IE <=9 - 11 only + // elem.tabIndex doesn't always return the + // correct value when it hasn't been explicitly set + // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ + // Use proper attribute retrieval(#12072) + var tabindex = jQuery.find.attr( elem, "tabindex" ); + + if ( tabindex ) { + return parseInt( tabindex, 10 ); + } + + if ( + rfocusable.test( elem.nodeName ) || + rclickable.test( elem.nodeName ) && + elem.href + ) { + return 0; + } + + return -1; + } + } + }, + + propFix: { + "for": "htmlFor", + "class": "className" + } +} ); + +// Support: IE <=11 only +// Accessing the selectedIndex property +// forces the browser to respect setting selected +// on the option +// The getter ensures a default option is selected +// when in an optgroup +// eslint rule "no-unused-expressions" is disabled for this code +// since it considers such accessions noop +if ( !support.optSelected ) { + jQuery.propHooks.selected = { + get: function( elem ) { + + /* eslint no-unused-expressions: "off" */ + + var parent = elem.parentNode; + if ( parent && parent.parentNode ) { + parent.parentNode.selectedIndex; + } + return null; + }, + set: function( elem ) { + + /* eslint no-unused-expressions: "off" */ + + var parent = elem.parentNode; + if ( parent ) { + parent.selectedIndex; + + if ( parent.parentNode ) { + parent.parentNode.selectedIndex; + } + } + } + }; +} + +jQuery.each( [ + "tabIndex", + "readOnly", + "maxLength", + "cellSpacing", + "cellPadding", + "rowSpan", + "colSpan", + "useMap", + "frameBorder", + "contentEditable" +], function() { + jQuery.propFix[ this.toLowerCase() ] = this; +} ); + + + + + // Strip and collapse whitespace according to HTML spec + // https://html.spec.whatwg.org/multipage/infrastructure.html#strip-and-collapse-whitespace + function stripAndCollapse( value ) { + var tokens = value.match( rnothtmlwhite ) || []; + return tokens.join( " " ); + } + + +function getClass( elem ) { + return elem.getAttribute && elem.getAttribute( "class" ) || ""; +} + +jQuery.fn.extend( { + addClass: function( value ) { + var classes, elem, cur, curValue, clazz, j, finalValue, + i = 0; + + if ( jQuery.isFunction( value ) ) { + return this.each( function( j ) { + jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); + } ); + } + + if ( typeof value === "string" && value ) { + classes = value.match( rnothtmlwhite ) || []; + + while ( ( elem = this[ i++ ] ) ) { + curValue = getClass( elem ); + cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); + + if ( cur ) { + j = 0; + while ( ( clazz = classes[ j++ ] ) ) { + if ( cur.indexOf( " " + clazz + " " ) < 0 ) { + cur += clazz + " "; + } + } + + // Only assign if different to avoid unneeded rendering. + finalValue = stripAndCollapse( cur ); + if ( curValue !== finalValue ) { + elem.setAttribute( "class", finalValue ); + } + } + } + } + + return this; + }, + + removeClass: function( value ) { + var classes, elem, cur, curValue, clazz, j, finalValue, + i = 0; + + if ( jQuery.isFunction( value ) ) { + return this.each( function( j ) { + jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); + } ); + } + + if ( !arguments.length ) { + return this.attr( "class", "" ); + } + + if ( typeof value === "string" && value ) { + classes = value.match( rnothtmlwhite ) || []; + + while ( ( elem = this[ i++ ] ) ) { + curValue = getClass( elem ); + + // This expression is here for better compressibility (see addClass) + cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); + + if ( cur ) { + j = 0; + while ( ( clazz = classes[ j++ ] ) ) { + + // Remove *all* instances + while ( cur.indexOf( " " + clazz + " " ) > -1 ) { + cur = cur.replace( " " + clazz + " ", " " ); + } + } + + // Only assign if different to avoid unneeded rendering. + finalValue = stripAndCollapse( cur ); + if ( curValue !== finalValue ) { + elem.setAttribute( "class", finalValue ); + } + } + } + } + + return this; + }, + + toggleClass: function( value, stateVal ) { + var type = typeof value; + + if ( typeof stateVal === "boolean" && type === "string" ) { + return stateVal ? this.addClass( value ) : this.removeClass( value ); + } + + if ( jQuery.isFunction( value ) ) { + return this.each( function( i ) { + jQuery( this ).toggleClass( + value.call( this, i, getClass( this ), stateVal ), + stateVal + ); + } ); + } + + return this.each( function() { + var className, i, self, classNames; + + if ( type === "string" ) { + + // Toggle individual class names + i = 0; + self = jQuery( this ); + classNames = value.match( rnothtmlwhite ) || []; + + while ( ( className = classNames[ i++ ] ) ) { + + // Check each className given, space separated list + if ( self.hasClass( className ) ) { + self.removeClass( className ); + } else { + self.addClass( className ); + } + } + + // Toggle whole class name + } else if ( value === undefined || type === "boolean" ) { + className = getClass( this ); + if ( className ) { + + // Store className if set + dataPriv.set( this, "__className__", className ); + } + + // If the element has a class name or if we're passed `false`, + // then remove the whole classname (if there was one, the above saved it). + // Otherwise bring back whatever was previously saved (if anything), + // falling back to the empty string if nothing was stored. + if ( this.setAttribute ) { + this.setAttribute( "class", + className || value === false ? + "" : + dataPriv.get( this, "__className__" ) || "" + ); + } + } + } ); + }, + + hasClass: function( selector ) { + var className, elem, + i = 0; + + className = " " + selector + " "; + while ( ( elem = this[ i++ ] ) ) { + if ( elem.nodeType === 1 && + ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { + return true; + } + } + + return false; + } +} ); + + + + +var rreturn = /\r/g; + +jQuery.fn.extend( { + val: function( value ) { + var hooks, ret, isFunction, + elem = this[ 0 ]; + + if ( !arguments.length ) { + if ( elem ) { + hooks = jQuery.valHooks[ elem.type ] || + jQuery.valHooks[ elem.nodeName.toLowerCase() ]; + + if ( hooks && + "get" in hooks && + ( ret = hooks.get( elem, "value" ) ) !== undefined + ) { + return ret; + } + + ret = elem.value; + + // Handle most common string cases + if ( typeof ret === "string" ) { + return ret.replace( rreturn, "" ); + } + + // Handle cases where value is null/undef or number + return ret == null ? "" : ret; + } + + return; + } + + isFunction = jQuery.isFunction( value ); + + return this.each( function( i ) { + var val; + + if ( this.nodeType !== 1 ) { + return; + } + + if ( isFunction ) { + val = value.call( this, i, jQuery( this ).val() ); + } else { + val = value; + } + + // Treat null/undefined as ""; convert numbers to string + if ( val == null ) { + val = ""; + + } else if ( typeof val === "number" ) { + val += ""; + + } else if ( Array.isArray( val ) ) { + val = jQuery.map( val, function( value ) { + return value == null ? "" : value + ""; + } ); + } + + hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; + + // If set returns undefined, fall back to normal setting + if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { + this.value = val; + } + } ); + } +} ); + +jQuery.extend( { + valHooks: { + option: { + get: function( elem ) { + + var val = jQuery.find.attr( elem, "value" ); + return val != null ? + val : + + // Support: IE <=10 - 11 only + // option.text throws exceptions (#14686, #14858) + // Strip and collapse whitespace + // https://html.spec.whatwg.org/#strip-and-collapse-whitespace + stripAndCollapse( jQuery.text( elem ) ); + } + }, + select: { + get: function( elem ) { + var value, option, i, + options = elem.options, + index = elem.selectedIndex, + one = elem.type === "select-one", + values = one ? null : [], + max = one ? index + 1 : options.length; + + if ( index < 0 ) { + i = max; + + } else { + i = one ? index : 0; + } + + // Loop through all the selected options + for ( ; i < max; i++ ) { + option = options[ i ]; + + // Support: IE <=9 only + // IE8-9 doesn't update selected after form reset (#2551) + if ( ( option.selected || i === index ) && + + // Don't return options that are disabled or in a disabled optgroup + !option.disabled && + ( !option.parentNode.disabled || + !nodeName( option.parentNode, "optgroup" ) ) ) { + + // Get the specific value for the option + value = jQuery( option ).val(); + + // We don't need an array for one selects + if ( one ) { + return value; + } + + // Multi-Selects return an array + values.push( value ); + } + } + + return values; + }, + + set: function( elem, value ) { + var optionSet, option, + options = elem.options, + values = jQuery.makeArray( value ), + i = options.length; + + while ( i-- ) { + option = options[ i ]; + + /* eslint-disable no-cond-assign */ + + if ( option.selected = + jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 + ) { + optionSet = true; + } + + /* eslint-enable no-cond-assign */ + } + + // Force browsers to behave consistently when non-matching value is set + if ( !optionSet ) { + elem.selectedIndex = -1; + } + return values; + } + } + } +} ); + +// Radios and checkboxes getter/setter +jQuery.each( [ "radio", "checkbox" ], function() { + jQuery.valHooks[ this ] = { + set: function( elem, value ) { + if ( Array.isArray( value ) ) { + return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); + } + } + }; + if ( !support.checkOn ) { + jQuery.valHooks[ this ].get = function( elem ) { + return elem.getAttribute( "value" ) === null ? "on" : elem.value; + }; + } +} ); + + + + +// Return jQuery for attributes-only inclusion + + +var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/; + +jQuery.extend( jQuery.event, { + + trigger: function( event, data, elem, onlyHandlers ) { + + var i, cur, tmp, bubbleType, ontype, handle, special, + eventPath = [ elem || document ], + type = hasOwn.call( event, "type" ) ? event.type : event, + namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; + + cur = tmp = elem = elem || document; + + // Don't do events on text and comment nodes + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + // focus/blur morphs to focusin/out; ensure we're not firing them right now + if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { + return; + } + + if ( type.indexOf( "." ) > -1 ) { + + // Namespaced trigger; create a regexp to match event type in handle() + namespaces = type.split( "." ); + type = namespaces.shift(); + namespaces.sort(); + } + ontype = type.indexOf( ":" ) < 0 && "on" + type; + + // Caller can pass in a jQuery.Event object, Object, or just an event type string + event = event[ jQuery.expando ] ? + event : + new jQuery.Event( type, typeof event === "object" && event ); + + // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) + event.isTrigger = onlyHandlers ? 2 : 3; + event.namespace = namespaces.join( "." ); + event.rnamespace = event.namespace ? + new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : + null; + + // Clean up the event in case it is being reused + event.result = undefined; + if ( !event.target ) { + event.target = elem; + } + + // Clone any incoming data and prepend the event, creating the handler arg list + data = data == null ? + [ event ] : + jQuery.makeArray( data, [ event ] ); + + // Allow special events to draw outside the lines + special = jQuery.event.special[ type ] || {}; + if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { + return; + } + + // Determine event propagation path in advance, per W3C events spec (#9951) + // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) + if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { + + bubbleType = special.delegateType || type; + if ( !rfocusMorph.test( bubbleType + type ) ) { + cur = cur.parentNode; + } + for ( ; cur; cur = cur.parentNode ) { + eventPath.push( cur ); + tmp = cur; + } + + // Only add window if we got to document (e.g., not plain obj or detached DOM) + if ( tmp === ( elem.ownerDocument || document ) ) { + eventPath.push( tmp.defaultView || tmp.parentWindow || window ); + } + } + + // Fire handlers on the event path + i = 0; + while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { + + event.type = i > 1 ? + bubbleType : + special.bindType || type; + + // jQuery handler + handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] && + dataPriv.get( cur, "handle" ); + if ( handle ) { + handle.apply( cur, data ); + } + + // Native handler + handle = ontype && cur[ ontype ]; + if ( handle && handle.apply && acceptData( cur ) ) { + event.result = handle.apply( cur, data ); + if ( event.result === false ) { + event.preventDefault(); + } + } + } + event.type = type; + + // If nobody prevented the default action, do it now + if ( !onlyHandlers && !event.isDefaultPrevented() ) { + + if ( ( !special._default || + special._default.apply( eventPath.pop(), data ) === false ) && + acceptData( elem ) ) { + + // Call a native DOM method on the target with the same name as the event. + // Don't do default actions on window, that's where global variables be (#6170) + if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) { + + // Don't re-trigger an onFOO event when we call its FOO() method + tmp = elem[ ontype ]; + + if ( tmp ) { + elem[ ontype ] = null; + } + + // Prevent re-triggering of the same event, since we already bubbled it above + jQuery.event.triggered = type; + elem[ type ](); + jQuery.event.triggered = undefined; + + if ( tmp ) { + elem[ ontype ] = tmp; + } + } + } + } + + return event.result; + }, + + // Piggyback on a donor event to simulate a different one + // Used only for `focus(in | out)` events + simulate: function( type, elem, event ) { + var e = jQuery.extend( + new jQuery.Event(), + event, + { + type: type, + isSimulated: true + } + ); + + jQuery.event.trigger( e, null, elem ); + } + +} ); + +jQuery.fn.extend( { + + trigger: function( type, data ) { + return this.each( function() { + jQuery.event.trigger( type, data, this ); + } ); + }, + triggerHandler: function( type, data ) { + var elem = this[ 0 ]; + if ( elem ) { + return jQuery.event.trigger( type, data, elem, true ); + } + } +} ); + + +jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " + + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + + "change select submit keydown keypress keyup contextmenu" ).split( " " ), + function( i, name ) { + + // Handle event binding + jQuery.fn[ name ] = function( data, fn ) { + return arguments.length > 0 ? + this.on( name, null, data, fn ) : + this.trigger( name ); + }; +} ); + +jQuery.fn.extend( { + hover: function( fnOver, fnOut ) { + return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); + } +} ); + + + + +support.focusin = "onfocusin" in window; + + +// Support: Firefox <=44 +// Firefox doesn't have focus(in | out) events +// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 +// +// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 +// focus(in | out) events fire after focus & blur events, +// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order +// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 +if ( !support.focusin ) { + jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { + + // Attach a single capturing handler on the document while someone wants focusin/focusout + var handler = function( event ) { + jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); + }; + + jQuery.event.special[ fix ] = { + setup: function() { + var doc = this.ownerDocument || this, + attaches = dataPriv.access( doc, fix ); + + if ( !attaches ) { + doc.addEventListener( orig, handler, true ); + } + dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); + }, + teardown: function() { + var doc = this.ownerDocument || this, + attaches = dataPriv.access( doc, fix ) - 1; + + if ( !attaches ) { + doc.removeEventListener( orig, handler, true ); + dataPriv.remove( doc, fix ); + + } else { + dataPriv.access( doc, fix, attaches ); + } + } + }; + } ); +} +var location = window.location; + +var nonce = jQuery.now(); + +var rquery = ( /\?/ ); + + + +// Cross-browser xml parsing +jQuery.parseXML = function( data ) { + var xml; + if ( !data || typeof data !== "string" ) { + return null; + } + + // Support: IE 9 - 11 only + // IE throws on parseFromString with invalid input. + try { + xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); + } catch ( e ) { + xml = undefined; + } + + if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { + jQuery.error( "Invalid XML: " + data ); + } + return xml; +}; + + +var + rbracket = /\[\]$/, + rCRLF = /\r?\n/g, + rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, + rsubmittable = /^(?:input|select|textarea|keygen)/i; + +function buildParams( prefix, obj, traditional, add ) { + var name; + + if ( Array.isArray( obj ) ) { + + // Serialize array item. + jQuery.each( obj, function( i, v ) { + if ( traditional || rbracket.test( prefix ) ) { + + // Treat each array item as a scalar. + add( prefix, v ); + + } else { + + // Item is non-scalar (array or object), encode its numeric index. + buildParams( + prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", + v, + traditional, + add + ); + } + } ); + + } else if ( !traditional && jQuery.type( obj ) === "object" ) { + + // Serialize object item. + for ( name in obj ) { + buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); + } + + } else { + + // Serialize scalar item. + add( prefix, obj ); + } +} + +// Serialize an array of form elements or a set of +// key/values into a query string +jQuery.param = function( a, traditional ) { + var prefix, + s = [], + add = function( key, valueOrFunction ) { + + // If value is a function, invoke it and use its return value + var value = jQuery.isFunction( valueOrFunction ) ? + valueOrFunction() : + valueOrFunction; + + s[ s.length ] = encodeURIComponent( key ) + "=" + + encodeURIComponent( value == null ? "" : value ); + }; + + // If an array was passed in, assume that it is an array of form elements. + if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { + + // Serialize the form elements + jQuery.each( a, function() { + add( this.name, this.value ); + } ); + + } else { + + // If traditional, encode the "old" way (the way 1.3.2 or older + // did it), otherwise encode params recursively. + for ( prefix in a ) { + buildParams( prefix, a[ prefix ], traditional, add ); + } + } + + // Return the resulting serialization + return s.join( "&" ); +}; + +jQuery.fn.extend( { + serialize: function() { + return jQuery.param( this.serializeArray() ); + }, + serializeArray: function() { + return this.map( function() { + + // Can add propHook for "elements" to filter or add form elements + var elements = jQuery.prop( this, "elements" ); + return elements ? jQuery.makeArray( elements ) : this; + } ) + .filter( function() { + var type = this.type; + + // Use .is( ":disabled" ) so that fieldset[disabled] works + return this.name && !jQuery( this ).is( ":disabled" ) && + rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && + ( this.checked || !rcheckableType.test( type ) ); + } ) + .map( function( i, elem ) { + var val = jQuery( this ).val(); + + if ( val == null ) { + return null; + } + + if ( Array.isArray( val ) ) { + return jQuery.map( val, function( val ) { + return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; + } ); + } + + return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; + } ).get(); + } +} ); + + +var + r20 = /%20/g, + rhash = /#.*$/, + rantiCache = /([?&])_=[^&]*/, + rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, + + // #7653, #8125, #8152: local protocol detection + rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, + rnoContent = /^(?:GET|HEAD)$/, + rprotocol = /^\/\//, + + /* Prefilters + * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) + * 2) These are called: + * - BEFORE asking for a transport + * - AFTER param serialization (s.data is a string if s.processData is true) + * 3) key is the dataType + * 4) the catchall symbol "*" can be used + * 5) execution will start with transport dataType and THEN continue down to "*" if needed + */ + prefilters = {}, + + /* Transports bindings + * 1) key is the dataType + * 2) the catchall symbol "*" can be used + * 3) selection will start with transport dataType and THEN go to "*" if needed + */ + transports = {}, + + // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression + allTypes = "*/".concat( "*" ), + + // Anchor tag for parsing the document origin + originAnchor = document.createElement( "a" ); + originAnchor.href = location.href; + +// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport +function addToPrefiltersOrTransports( structure ) { + + // dataTypeExpression is optional and defaults to "*" + return function( dataTypeExpression, func ) { + + if ( typeof dataTypeExpression !== "string" ) { + func = dataTypeExpression; + dataTypeExpression = "*"; + } + + var dataType, + i = 0, + dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; + + if ( jQuery.isFunction( func ) ) { + + // For each dataType in the dataTypeExpression + while ( ( dataType = dataTypes[ i++ ] ) ) { + + // Prepend if requested + if ( dataType[ 0 ] === "+" ) { + dataType = dataType.slice( 1 ) || "*"; + ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); + + // Otherwise append + } else { + ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); + } + } + } + }; +} + +// Base inspection function for prefilters and transports +function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { + + var inspected = {}, + seekingTransport = ( structure === transports ); + + function inspect( dataType ) { + var selected; + inspected[ dataType ] = true; + jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { + var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); + if ( typeof dataTypeOrTransport === "string" && + !seekingTransport && !inspected[ dataTypeOrTransport ] ) { + + options.dataTypes.unshift( dataTypeOrTransport ); + inspect( dataTypeOrTransport ); + return false; + } else if ( seekingTransport ) { + return !( selected = dataTypeOrTransport ); + } + } ); + return selected; + } + + return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); +} + +// A special extend for ajax options +// that takes "flat" options (not to be deep extended) +// Fixes #9887 +function ajaxExtend( target, src ) { + var key, deep, + flatOptions = jQuery.ajaxSettings.flatOptions || {}; + + for ( key in src ) { + if ( src[ key ] !== undefined ) { + ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; + } + } + if ( deep ) { + jQuery.extend( true, target, deep ); + } + + return target; +} + +/* Handles responses to an ajax request: + * - finds the right dataType (mediates between content-type and expected dataType) + * - returns the corresponding response + */ +function ajaxHandleResponses( s, jqXHR, responses ) { + + var ct, type, finalDataType, firstDataType, + contents = s.contents, + dataTypes = s.dataTypes; + + // Remove auto dataType and get content-type in the process + while ( dataTypes[ 0 ] === "*" ) { + dataTypes.shift(); + if ( ct === undefined ) { + ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); + } + } + + // Check if we're dealing with a known content-type + if ( ct ) { + for ( type in contents ) { + if ( contents[ type ] && contents[ type ].test( ct ) ) { + dataTypes.unshift( type ); + break; + } + } + } + + // Check to see if we have a response for the expected dataType + if ( dataTypes[ 0 ] in responses ) { + finalDataType = dataTypes[ 0 ]; + } else { + + // Try convertible dataTypes + for ( type in responses ) { + if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { + finalDataType = type; + break; + } + if ( !firstDataType ) { + firstDataType = type; + } + } + + // Or just use first one + finalDataType = finalDataType || firstDataType; + } + + // If we found a dataType + // We add the dataType to the list if needed + // and return the corresponding response + if ( finalDataType ) { + if ( finalDataType !== dataTypes[ 0 ] ) { + dataTypes.unshift( finalDataType ); + } + return responses[ finalDataType ]; + } +} + +/* Chain conversions given the request and the original response + * Also sets the responseXXX fields on the jqXHR instance + */ +function ajaxConvert( s, response, jqXHR, isSuccess ) { + var conv2, current, conv, tmp, prev, + converters = {}, + + // Work with a copy of dataTypes in case we need to modify it for conversion + dataTypes = s.dataTypes.slice(); + + // Create converters map with lowercased keys + if ( dataTypes[ 1 ] ) { + for ( conv in s.converters ) { + converters[ conv.toLowerCase() ] = s.converters[ conv ]; + } + } + + current = dataTypes.shift(); + + // Convert to each sequential dataType + while ( current ) { + + if ( s.responseFields[ current ] ) { + jqXHR[ s.responseFields[ current ] ] = response; + } + + // Apply the dataFilter if provided + if ( !prev && isSuccess && s.dataFilter ) { + response = s.dataFilter( response, s.dataType ); + } + + prev = current; + current = dataTypes.shift(); + + if ( current ) { + + // There's only work to do if current dataType is non-auto + if ( current === "*" ) { + + current = prev; + + // Convert response if prev dataType is non-auto and differs from current + } else if ( prev !== "*" && prev !== current ) { + + // Seek a direct converter + conv = converters[ prev + " " + current ] || converters[ "* " + current ]; + + // If none found, seek a pair + if ( !conv ) { + for ( conv2 in converters ) { + + // If conv2 outputs current + tmp = conv2.split( " " ); + if ( tmp[ 1 ] === current ) { + + // If prev can be converted to accepted input + conv = converters[ prev + " " + tmp[ 0 ] ] || + converters[ "* " + tmp[ 0 ] ]; + if ( conv ) { + + // Condense equivalence converters + if ( conv === true ) { + conv = converters[ conv2 ]; + + // Otherwise, insert the intermediate dataType + } else if ( converters[ conv2 ] !== true ) { + current = tmp[ 0 ]; + dataTypes.unshift( tmp[ 1 ] ); + } + break; + } + } + } + } + + // Apply converter (if not an equivalence) + if ( conv !== true ) { + + // Unless errors are allowed to bubble, catch and return them + if ( conv && s.throws ) { + response = conv( response ); + } else { + try { + response = conv( response ); + } catch ( e ) { + return { + state: "parsererror", + error: conv ? e : "No conversion from " + prev + " to " + current + }; + } + } + } + } + } + } + + return { state: "success", data: response }; +} + +jQuery.extend( { + + // Counter for holding the number of active queries + active: 0, + + // Last-Modified header cache for next request + lastModified: {}, + etag: {}, + + ajaxSettings: { + url: location.href, + type: "GET", + isLocal: rlocalProtocol.test( location.protocol ), + global: true, + processData: true, + async: true, + contentType: "application/x-www-form-urlencoded; charset=UTF-8", + + /* + timeout: 0, + data: null, + dataType: null, + username: null, + password: null, + cache: null, + throws: false, + traditional: false, + headers: {}, + */ + + accepts: { + "*": allTypes, + text: "text/plain", + html: "text/html", + xml: "application/xml, text/xml", + json: "application/json, text/javascript" + }, + + contents: { + xml: /\bxml\b/, + html: /\bhtml/, + json: /\bjson\b/ + }, + + responseFields: { + xml: "responseXML", + text: "responseText", + json: "responseJSON" + }, + + // Data converters + // Keys separate source (or catchall "*") and destination types with a single space + converters: { + + // Convert anything to text + "* text": String, + + // Text to html (true = no transformation) + "text html": true, + + // Evaluate text as a json expression + "text json": JSON.parse, + + // Parse text as xml + "text xml": jQuery.parseXML + }, + + // For options that shouldn't be deep extended: + // you can add your own custom options here if + // and when you create one that shouldn't be + // deep extended (see ajaxExtend) + flatOptions: { + url: true, + context: true + } + }, + + // Creates a full fledged settings object into target + // with both ajaxSettings and settings fields. + // If target is omitted, writes into ajaxSettings. + ajaxSetup: function( target, settings ) { + return settings ? + + // Building a settings object + ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : + + // Extending ajaxSettings + ajaxExtend( jQuery.ajaxSettings, target ); + }, + + ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), + ajaxTransport: addToPrefiltersOrTransports( transports ), + + // Main method + ajax: function( url, options ) { + + // If url is an object, simulate pre-1.5 signature + if ( typeof url === "object" ) { + options = url; + url = undefined; + } + + // Force options to be an object + options = options || {}; + + var transport, + + // URL without anti-cache param + cacheURL, + + // Response headers + responseHeadersString, + responseHeaders, + + // timeout handle + timeoutTimer, + + // Url cleanup var + urlAnchor, + + // Request state (becomes false upon send and true upon completion) + completed, + + // To know if global events are to be dispatched + fireGlobals, + + // Loop variable + i, + + // uncached part of the url + uncached, + + // Create the final options object + s = jQuery.ajaxSetup( {}, options ), + + // Callbacks context + callbackContext = s.context || s, + + // Context for global events is callbackContext if it is a DOM node or jQuery collection + globalEventContext = s.context && + ( callbackContext.nodeType || callbackContext.jquery ) ? + jQuery( callbackContext ) : + jQuery.event, + + // Deferreds + deferred = jQuery.Deferred(), + completeDeferred = jQuery.Callbacks( "once memory" ), + + // Status-dependent callbacks + statusCode = s.statusCode || {}, + + // Headers (they are sent all at once) + requestHeaders = {}, + requestHeadersNames = {}, + + // Default abort message + strAbort = "canceled", + + // Fake xhr + jqXHR = { + readyState: 0, + + // Builds headers hashtable if needed + getResponseHeader: function( key ) { + var match; + if ( completed ) { + if ( !responseHeaders ) { + responseHeaders = {}; + while ( ( match = rheaders.exec( responseHeadersString ) ) ) { + responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ]; + } + } + match = responseHeaders[ key.toLowerCase() ]; + } + return match == null ? null : match; + }, + + // Raw string + getAllResponseHeaders: function() { + return completed ? responseHeadersString : null; + }, + + // Caches the header + setRequestHeader: function( name, value ) { + if ( completed == null ) { + name = requestHeadersNames[ name.toLowerCase() ] = + requestHeadersNames[ name.toLowerCase() ] || name; + requestHeaders[ name ] = value; + } + return this; + }, + + // Overrides response content-type header + overrideMimeType: function( type ) { + if ( completed == null ) { + s.mimeType = type; + } + return this; + }, + + // Status-dependent callbacks + statusCode: function( map ) { + var code; + if ( map ) { + if ( completed ) { + + // Execute the appropriate callbacks + jqXHR.always( map[ jqXHR.status ] ); + } else { + + // Lazy-add the new callbacks in a way that preserves old ones + for ( code in map ) { + statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; + } + } + } + return this; + }, + + // Cancel the request + abort: function( statusText ) { + var finalText = statusText || strAbort; + if ( transport ) { + transport.abort( finalText ); + } + done( 0, finalText ); + return this; + } + }; + + // Attach deferreds + deferred.promise( jqXHR ); + + // Add protocol if not provided (prefilters might expect it) + // Handle falsy url in the settings object (#10093: consistency with old signature) + // We also use the url parameter if available + s.url = ( ( url || s.url || location.href ) + "" ) + .replace( rprotocol, location.protocol + "//" ); + + // Alias method option to type as per ticket #12004 + s.type = options.method || options.type || s.method || s.type; + + // Extract dataTypes list + s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; + + // A cross-domain request is in order when the origin doesn't match the current origin. + if ( s.crossDomain == null ) { + urlAnchor = document.createElement( "a" ); + + // Support: IE <=8 - 11, Edge 12 - 13 + // IE throws exception on accessing the href property if url is malformed, + // e.g. http://example.com:80x/ + try { + urlAnchor.href = s.url; + + // Support: IE <=8 - 11 only + // Anchor's host property isn't correctly set when s.url is relative + urlAnchor.href = urlAnchor.href; + s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== + urlAnchor.protocol + "//" + urlAnchor.host; + } catch ( e ) { + + // If there is an error parsing the URL, assume it is crossDomain, + // it can be rejected by the transport if it is invalid + s.crossDomain = true; + } + } + + // Convert data if not already a string + if ( s.data && s.processData && typeof s.data !== "string" ) { + s.data = jQuery.param( s.data, s.traditional ); + } + + // Apply prefilters + inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); + + // If request was aborted inside a prefilter, stop there + if ( completed ) { + return jqXHR; + } + + // We can fire global events as of now if asked to + // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) + fireGlobals = jQuery.event && s.global; + + // Watch for a new set of requests + if ( fireGlobals && jQuery.active++ === 0 ) { + jQuery.event.trigger( "ajaxStart" ); + } + + // Uppercase the type + s.type = s.type.toUpperCase(); + + // Determine if request has content + s.hasContent = !rnoContent.test( s.type ); + + // Save the URL in case we're toying with the If-Modified-Since + // and/or If-None-Match header later on + // Remove hash to simplify url manipulation + cacheURL = s.url.replace( rhash, "" ); + + // More options handling for requests with no content + if ( !s.hasContent ) { + + // Remember the hash so we can put it back + uncached = s.url.slice( cacheURL.length ); + + // If data is available, append data to url + if ( s.data ) { + cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; + + // #9682: remove data so that it's not used in an eventual retry + delete s.data; + } + + // Add or update anti-cache param if needed + if ( s.cache === false ) { + cacheURL = cacheURL.replace( rantiCache, "$1" ); + uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached; + } + + // Put hash and anti-cache on the URL that will be requested (gh-1732) + s.url = cacheURL + uncached; + + // Change '%20' to '+' if this is encoded form body content (gh-2658) + } else if ( s.data && s.processData && + ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { + s.data = s.data.replace( r20, "+" ); + } + + // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. + if ( s.ifModified ) { + if ( jQuery.lastModified[ cacheURL ] ) { + jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); + } + if ( jQuery.etag[ cacheURL ] ) { + jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); + } + } + + // Set the correct header, if data is being sent + if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { + jqXHR.setRequestHeader( "Content-Type", s.contentType ); + } + + // Set the Accepts header for the server, depending on the dataType + jqXHR.setRequestHeader( + "Accept", + s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? + s.accepts[ s.dataTypes[ 0 ] ] + + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : + s.accepts[ "*" ] + ); + + // Check for headers option + for ( i in s.headers ) { + jqXHR.setRequestHeader( i, s.headers[ i ] ); + } + + // Allow custom headers/mimetypes and early abort + if ( s.beforeSend && + ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { + + // Abort if not done already and return + return jqXHR.abort(); + } + + // Aborting is no longer a cancellation + strAbort = "abort"; + + // Install callbacks on deferreds + completeDeferred.add( s.complete ); + jqXHR.done( s.success ); + jqXHR.fail( s.error ); + + // Get transport + transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); + + // If no transport, we auto-abort + if ( !transport ) { + done( -1, "No Transport" ); + } else { + jqXHR.readyState = 1; + + // Send global event + if ( fireGlobals ) { + globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); + } + + // If request was aborted inside ajaxSend, stop there + if ( completed ) { + return jqXHR; + } + + // Timeout + if ( s.async && s.timeout > 0 ) { + timeoutTimer = window.setTimeout( function() { + jqXHR.abort( "timeout" ); + }, s.timeout ); + } + + try { + completed = false; + transport.send( requestHeaders, done ); + } catch ( e ) { + + // Rethrow post-completion exceptions + if ( completed ) { + throw e; + } + + // Propagate others as results + done( -1, e ); + } + } + + // Callback for when everything is done + function done( status, nativeStatusText, responses, headers ) { + var isSuccess, success, error, response, modified, + statusText = nativeStatusText; + + // Ignore repeat invocations + if ( completed ) { + return; + } + + completed = true; + + // Clear timeout if it exists + if ( timeoutTimer ) { + window.clearTimeout( timeoutTimer ); + } + + // Dereference transport for early garbage collection + // (no matter how long the jqXHR object will be used) + transport = undefined; + + // Cache response headers + responseHeadersString = headers || ""; + + // Set readyState + jqXHR.readyState = status > 0 ? 4 : 0; + + // Determine if successful + isSuccess = status >= 200 && status < 300 || status === 304; + + // Get response data + if ( responses ) { + response = ajaxHandleResponses( s, jqXHR, responses ); + } + + // Convert no matter what (that way responseXXX fields are always set) + response = ajaxConvert( s, response, jqXHR, isSuccess ); + + // If successful, handle type chaining + if ( isSuccess ) { + + // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. + if ( s.ifModified ) { + modified = jqXHR.getResponseHeader( "Last-Modified" ); + if ( modified ) { + jQuery.lastModified[ cacheURL ] = modified; + } + modified = jqXHR.getResponseHeader( "etag" ); + if ( modified ) { + jQuery.etag[ cacheURL ] = modified; + } + } + + // if no content + if ( status === 204 || s.type === "HEAD" ) { + statusText = "nocontent"; + + // if not modified + } else if ( status === 304 ) { + statusText = "notmodified"; + + // If we have data, let's convert it + } else { + statusText = response.state; + success = response.data; + error = response.error; + isSuccess = !error; + } + } else { + + // Extract error from statusText and normalize for non-aborts + error = statusText; + if ( status || !statusText ) { + statusText = "error"; + if ( status < 0 ) { + status = 0; + } + } + } + + // Set data for the fake xhr object + jqXHR.status = status; + jqXHR.statusText = ( nativeStatusText || statusText ) + ""; + + // Success/Error + if ( isSuccess ) { + deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); + } else { + deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); + } + + // Status-dependent callbacks + jqXHR.statusCode( statusCode ); + statusCode = undefined; + + if ( fireGlobals ) { + globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", + [ jqXHR, s, isSuccess ? success : error ] ); + } + + // Complete + completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); + + if ( fireGlobals ) { + globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); + + // Handle the global AJAX counter + if ( !( --jQuery.active ) ) { + jQuery.event.trigger( "ajaxStop" ); + } + } + } + + return jqXHR; + }, + + getJSON: function( url, data, callback ) { + return jQuery.get( url, data, callback, "json" ); + }, + + getScript: function( url, callback ) { + return jQuery.get( url, undefined, callback, "script" ); + } +} ); + +jQuery.each( [ "get", "post" ], function( i, method ) { + jQuery[ method ] = function( url, data, callback, type ) { + + // Shift arguments if data argument was omitted + if ( jQuery.isFunction( data ) ) { + type = type || callback; + callback = data; + data = undefined; + } + + // The url can be an options object (which then must have .url) + return jQuery.ajax( jQuery.extend( { + url: url, + type: method, + dataType: type, + data: data, + success: callback + }, jQuery.isPlainObject( url ) && url ) ); + }; +} ); + + +jQuery._evalUrl = function( url ) { + return jQuery.ajax( { + url: url, + + // Make this explicit, since user can override this through ajaxSetup (#11264) + type: "GET", + dataType: "script", + cache: true, + async: false, + global: false, + "throws": true + } ); +}; + + +jQuery.fn.extend( { + wrapAll: function( html ) { + var wrap; + + if ( this[ 0 ] ) { + if ( jQuery.isFunction( html ) ) { + html = html.call( this[ 0 ] ); + } + + // The elements to wrap the target around + wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); + + if ( this[ 0 ].parentNode ) { + wrap.insertBefore( this[ 0 ] ); + } + + wrap.map( function() { + var elem = this; + + while ( elem.firstElementChild ) { + elem = elem.firstElementChild; + } + + return elem; + } ).append( this ); + } + + return this; + }, + + wrapInner: function( html ) { + if ( jQuery.isFunction( html ) ) { + return this.each( function( i ) { + jQuery( this ).wrapInner( html.call( this, i ) ); + } ); + } + + return this.each( function() { + var self = jQuery( this ), + contents = self.contents(); + + if ( contents.length ) { + contents.wrapAll( html ); + + } else { + self.append( html ); + } + } ); + }, + + wrap: function( html ) { + var isFunction = jQuery.isFunction( html ); + + return this.each( function( i ) { + jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html ); + } ); + }, + + unwrap: function( selector ) { + this.parent( selector ).not( "body" ).each( function() { + jQuery( this ).replaceWith( this.childNodes ); + } ); + return this; + } +} ); + + +jQuery.expr.pseudos.hidden = function( elem ) { + return !jQuery.expr.pseudos.visible( elem ); +}; +jQuery.expr.pseudos.visible = function( elem ) { + return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); +}; + + + + +jQuery.ajaxSettings.xhr = function() { + try { + return new window.XMLHttpRequest(); + } catch ( e ) {} +}; + +var xhrSuccessStatus = { + + // File protocol always yields status code 0, assume 200 + 0: 200, + + // Support: IE <=9 only + // #1450: sometimes IE returns 1223 when it should be 204 + 1223: 204 + }, + xhrSupported = jQuery.ajaxSettings.xhr(); + +support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); +support.ajax = xhrSupported = !!xhrSupported; + +jQuery.ajaxTransport( function( options ) { + var callback, errorCallback; + + // Cross domain only allowed if supported through XMLHttpRequest + if ( support.cors || xhrSupported && !options.crossDomain ) { + return { + send: function( headers, complete ) { + var i, + xhr = options.xhr(); + + xhr.open( + options.type, + options.url, + options.async, + options.username, + options.password + ); + + // Apply custom fields if provided + if ( options.xhrFields ) { + for ( i in options.xhrFields ) { + xhr[ i ] = options.xhrFields[ i ]; + } + } + + // Override mime type if needed + if ( options.mimeType && xhr.overrideMimeType ) { + xhr.overrideMimeType( options.mimeType ); + } + + // X-Requested-With header + // For cross-domain requests, seeing as conditions for a preflight are + // akin to a jigsaw puzzle, we simply never set it to be sure. + // (it can always be set on a per-request basis or even using ajaxSetup) + // For same-domain requests, won't change header if already provided. + if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { + headers[ "X-Requested-With" ] = "XMLHttpRequest"; + } + + // Set headers + for ( i in headers ) { + xhr.setRequestHeader( i, headers[ i ] ); + } + + // Callback + callback = function( type ) { + return function() { + if ( callback ) { + callback = errorCallback = xhr.onload = + xhr.onerror = xhr.onabort = xhr.onreadystatechange = null; + + if ( type === "abort" ) { + xhr.abort(); + } else if ( type === "error" ) { + + // Support: IE <=9 only + // On a manual native abort, IE9 throws + // errors on any property access that is not readyState + if ( typeof xhr.status !== "number" ) { + complete( 0, "error" ); + } else { + complete( + + // File: protocol always yields status 0; see #8605, #14207 + xhr.status, + xhr.statusText + ); + } + } else { + complete( + xhrSuccessStatus[ xhr.status ] || xhr.status, + xhr.statusText, + + // Support: IE <=9 only + // IE9 has no XHR2 but throws on binary (trac-11426) + // For XHR2 non-text, let the caller handle it (gh-2498) + ( xhr.responseType || "text" ) !== "text" || + typeof xhr.responseText !== "string" ? + { binary: xhr.response } : + { text: xhr.responseText }, + xhr.getAllResponseHeaders() + ); + } + } + }; + }; + + // Listen to events + xhr.onload = callback(); + errorCallback = xhr.onerror = callback( "error" ); + + // Support: IE 9 only + // Use onreadystatechange to replace onabort + // to handle uncaught aborts + if ( xhr.onabort !== undefined ) { + xhr.onabort = errorCallback; + } else { + xhr.onreadystatechange = function() { + + // Check readyState before timeout as it changes + if ( xhr.readyState === 4 ) { + + // Allow onerror to be called first, + // but that will not handle a native abort + // Also, save errorCallback to a variable + // as xhr.onerror cannot be accessed + window.setTimeout( function() { + if ( callback ) { + errorCallback(); + } + } ); + } + }; + } + + // Create the abort callback + callback = callback( "abort" ); + + try { + + // Do send the request (this may raise an exception) + xhr.send( options.hasContent && options.data || null ); + } catch ( e ) { + + // #14683: Only rethrow if this hasn't been notified as an error yet + if ( callback ) { + throw e; + } + } + }, + + abort: function() { + if ( callback ) { + callback(); + } + } + }; + } +} ); + + + + +// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) +jQuery.ajaxPrefilter( function( s ) { + if ( s.crossDomain ) { + s.contents.script = false; + } +} ); + +// Install script dataType +jQuery.ajaxSetup( { + accepts: { + script: "text/javascript, application/javascript, " + + "application/ecmascript, application/x-ecmascript" + }, + contents: { + script: /\b(?:java|ecma)script\b/ + }, + converters: { + "text script": function( text ) { + jQuery.globalEval( text ); + return text; + } + } +} ); + +// Handle cache's special case and crossDomain +jQuery.ajaxPrefilter( "script", function( s ) { + if ( s.cache === undefined ) { + s.cache = false; + } + if ( s.crossDomain ) { + s.type = "GET"; + } +} ); + +// Bind script tag hack transport +jQuery.ajaxTransport( "script", function( s ) { + + // This transport only deals with cross domain requests + if ( s.crossDomain ) { + var script, callback; + return { + send: function( _, complete ) { + script = jQuery( " + + + + + + + + + + + + + + + +
+
+
+
+ + +

Index

+ +
+ A + | B + | C + | D + | E + | F + | G + | H + | I + | J + | K + | L + | M + | N + | O + | P + | Q + | R + | S + | T + | U + | V + | W + | Y + +
+

A

+ + + +
+ +

B

+ + + +
+ +

C

+ + + +
+ +

D

+ + + +
+ +

E

+ + + +
+ +

F

+ + + +
+ +

G

+ + + +
+ +

H

+ + + +
+ +

I

+ + + +
+ +

J

+ + + +
+ +

K

+ + + +
+ +

L

+ + + +
+ +

M

+ + + +
+ +

N

+ + + +
+ +

O

+ + + +
+ +

P

+ + + +
+ +

Q

+ + + +
+ +

R

+ + + +
+ +

S

+ + + +
+ +

T

+ + + +
+ +

U

+ + + +
+ +

V

+ + + +
+ +

W

+ + + +
+ +

Y

+ + +
+ + + +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/index.html b/_build/html/index.html new file mode 100644 index 000000000..e56272e33 --- /dev/null +++ b/_build/html/index.html @@ -0,0 +1,104 @@ + + + + + + + + Welcome to QUANTAXIS's documentation! — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

Welcome to QUANTAXIS's documentation!

+
+
+
+
+

Indices and tables

+ +
+ + +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/objects.inv b/_build/html/objects.inv new file mode 100644 index 000000000..7b1db6829 Binary files /dev/null and b/_build/html/objects.inv differ diff --git a/_build/html/py-modindex.html b/_build/html/py-modindex.html new file mode 100644 index 000000000..723005d03 --- /dev/null +++ b/_build/html/py-modindex.html @@ -0,0 +1,616 @@ + + + + + + + + Python Module Index — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + +

Python Module Index

+ +
+ q +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
+ q
+ QUANTAXIS +
    + QUANTAXIS.QAAnalysis +
    + QUANTAXIS.QAAnalysis.QAAnalysis_block +
    + QUANTAXIS.QAAnalysis.QAAnalysis_dataframe +
    + QUANTAXIS.QAAnalysis.QAAnalysis_machinelearning +
    + QUANTAXIS.QAAnalysis.QAAnalysis_series +
    + QUANTAXIS.QAAnalysis.QAAnalysis_tick +
    + QUANTAXIS.QAAnalysis.QAAnalysis_trade +
    + QUANTAXIS.QAARP +
    + QUANTAXIS.QAARP.QAAccount +
    + QUANTAXIS.QAARP.QAPortfolio +
    + QUANTAXIS.QAARP.QARisk +
    + QUANTAXIS.QAARP.QAStrategy +
    + QUANTAXIS.QAARP.QAUser +
    + QUANTAXIS.QABacktest +
    + QUANTAXIS.QABacktest.backtest_setting +
    + QUANTAXIS.QABacktest.QAAnalysis +
    + QUANTAXIS.QABacktest.QABacktest +
    + QUANTAXIS.QABacktest.QAResult +
    + QUANTAXIS.QACmd +
    + QUANTAXIS.QACmd.backtest +
    + QUANTAXIS.QAData +
    + QUANTAXIS.QAData.base_datastruct +
    + QUANTAXIS.QAData.data_fq +
    + QUANTAXIS.QAData.data_resample +
    + QUANTAXIS.QAData.dsmethods +
    + QUANTAXIS.QAData.proto +
    + QUANTAXIS.QAData.proto.order_pb2 +
    + QUANTAXIS.QAData.proto.stock_day_pb2 +
    + QUANTAXIS.QAData.proto.stock_min_pb2 +
    + QUANTAXIS.QAData.QADataStruct +
    + QUANTAXIS.QAData.realtimedata +
    + QUANTAXIS.QAData.schema +
    + QUANTAXIS.QAData.serialize +
    + QUANTAXIS.QAEngine +
    + QUANTAXIS.QAEngine.QAEvent +
    + QUANTAXIS.QAEngine.QATask +
    + QUANTAXIS.QAEngine.QAThreadEngine +
    + QUANTAXIS.QAFetch +
    + QUANTAXIS.QAFetch.base +
    + QUANTAXIS.QAFetch.data_list +
    + QUANTAXIS.QAFetch.Fetcher +
    + QUANTAXIS.QAFetch.QACrawler +
    + QUANTAXIS.QAFetch.QAEastMoney +
    + QUANTAXIS.QAFetch.QAfinancial +
    + QUANTAXIS.QAFetch.QAQuery +
    + QUANTAXIS.QAFetch.QAQuery_Advance +
    + QUANTAXIS.QAFetch.QATdx +
    + QUANTAXIS.QAFetch.QATdx_adv +
    + QUANTAXIS.QAFetch.QAThs +
    + QUANTAXIS.QAFetch.QATushare +
    + QUANTAXIS.QAFetch.QAWind +
    + QUANTAXIS.QAFetch.realtime +
    + QUANTAXIS.QAIndicator +
    + QUANTAXIS.QAIndicator.base +
    + QUANTAXIS.QAIndicator.indicators +
    + QUANTAXIS.QAMarket +
    + QUANTAXIS.QAMarket.QABacktestBroker +
    + QUANTAXIS.QAMarket.QABroker +
    + QUANTAXIS.QAMarket.QADealer +
    + QUANTAXIS.QAMarket.QAMarket +
    + QUANTAXIS.QAMarket.QAOrder +
    + QUANTAXIS.QAMarket.QAOrderHandler +
    + QUANTAXIS.QAMarket.QARandomBroker +
    + QUANTAXIS.QAMarket.QARealBroker +
    + QUANTAXIS.QAMarket.QASimulatedBroker +
    + QUANTAXIS.QAMarket.QATrade +
    + QUANTAXIS.QAMarket.shipaneBroker +
    + QUANTAXIS.QAMarket.shipaneclient +
    + QUANTAXIS.QAMarket.tdxRealBroker +
    + QUANTAXIS.QASU +
    + QUANTAXIS.QASU.main +
    + QUANTAXIS.QASU.save_account +
    + QUANTAXIS.QASU.save_backtest +
    + QUANTAXIS.QASU.save_local +
    + QUANTAXIS.QASU.save_tdx +
    + QUANTAXIS.QASU.save_tdx_file +
    + QUANTAXIS.QASU.save_tushare +
    + QUANTAXIS.QASU.user +
    + QUANTAXIS.QAUtil +
    + QUANTAXIS.QAUtil.host +
    + QUANTAXIS.QAUtil.QAAuth +
    + QUANTAXIS.QAUtil.QABar +
    + QUANTAXIS.QAUtil.QACfg +
    + QUANTAXIS.QAUtil.QACode +
    + QUANTAXIS.QAUtil.QACsv +
    + QUANTAXIS.QAUtil.QADate +
    + QUANTAXIS.QAUtil.QADate_trade +
    + QUANTAXIS.QAUtil.QADict +
    + QUANTAXIS.QAUtil.QAList +
    + QUANTAXIS.QAUtil.QALocalize +
    + QUANTAXIS.QAUtil.QALogs +
    + QUANTAXIS.QAUtil.QAMail +
    + QUANTAXIS.QAUtil.QAMongo +
    + QUANTAXIS.QAUtil.QAParameter +
    + QUANTAXIS.QAUtil.QAPlot +
    + QUANTAXIS.QAUtil.QARandom +
    + QUANTAXIS.QAUtil.QASetting +
    + QUANTAXIS.QAUtil.QASql +
    + QUANTAXIS.QAUtil.QAText +
    + QUANTAXIS.QAUtil.QATransform +
    + QUANTAXIS.QAUtil.QAWeb +
    + QUANTAXIS.QAWeb +
    + QUANTAXIS.QAWeb.chain +
    + QUANTAXIS.QAWeb.QA_Web +
+ + +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/search.html b/_build/html/search.html new file mode 100644 index 000000000..dfde4c01e --- /dev/null +++ b/_build/html/search.html @@ -0,0 +1,93 @@ + + + + + + + + Search — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Search

+
+ +

+ Please activate JavaScript to enable the search + functionality. +

+
+

+ From here you can search these documents. Enter your search + words into the box below and click "search". Note that the search + function will automatically search for all of the words. Pages + containing fewer words won't appear in the result list. +

+
+ + + +
+ +
+ +
+ +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/searchindex.js b/_build/html/searchindex.js new file mode 100644 index 000000000..cee5e214e --- /dev/null +++ b/_build/html/searchindex.js @@ -0,0 +1 @@ +Search.setIndex({docnames:["QUANTAXIS_Trade/README","QUANTAXIS_Webkit/web/node_modules/highlight.js/docs/api","QUANTAXIS_Webkit/web/node_modules/highlight.js/docs/building-testing","QUANTAXIS_Webkit/web/node_modules/highlight.js/docs/css-classes-reference","QUANTAXIS_Webkit/web/node_modules/highlight.js/docs/index","QUANTAXIS_Webkit/web/node_modules/highlight.js/docs/language-contribution","QUANTAXIS_Webkit/web/node_modules/highlight.js/docs/language-guide","QUANTAXIS_Webkit/web/node_modules/highlight.js/docs/language-requests","QUANTAXIS_Webkit/web/node_modules/highlight.js/docs/line-numbers","QUANTAXIS_Webkit/web/node_modules/highlight.js/docs/reference","QUANTAXIS_Webkit/web/node_modules/highlight.js/docs/release-process","QUANTAXIS_Webkit/web/node_modules/highlight.js/docs/style-guide","README","index","source/QUANTAXIS","source/QUANTAXIS.QAARP","source/QUANTAXIS.QAAnalysis","source/QUANTAXIS.QABacktest","source/QUANTAXIS.QACmd","source/QUANTAXIS.QAData","source/QUANTAXIS.QAData.proto","source/QUANTAXIS.QAEngine","source/QUANTAXIS.QAFetch","source/QUANTAXIS.QAIndicator","source/QUANTAXIS.QAMarket","source/QUANTAXIS.QASU","source/QUANTAXIS.QAUtil","source/QUANTAXIS.QAWeb","source/modules"],envversion:53,filenames:["QUANTAXIS_Trade\\README.rst","QUANTAXIS_Webkit\\web\\node_modules\\highlight.js\\docs\\api.rst","QUANTAXIS_Webkit\\web\\node_modules\\highlight.js\\docs\\building-testing.rst","QUANTAXIS_Webkit\\web\\node_modules\\highlight.js\\docs\\css-classes-reference.rst","QUANTAXIS_Webkit\\web\\node_modules\\highlight.js\\docs\\index.rst","QUANTAXIS_Webkit\\web\\node_modules\\highlight.js\\docs\\language-contribution.rst","QUANTAXIS_Webkit\\web\\node_modules\\highlight.js\\docs\\language-guide.rst","QUANTAXIS_Webkit\\web\\node_modules\\highlight.js\\docs\\language-requests.rst","QUANTAXIS_Webkit\\web\\node_modules\\highlight.js\\docs\\line-numbers.rst","QUANTAXIS_Webkit\\web\\node_modules\\highlight.js\\docs\\reference.rst","QUANTAXIS_Webkit\\web\\node_modules\\highlight.js\\docs\\release-process.rst","QUANTAXIS_Webkit\\web\\node_modules\\highlight.js\\docs\\style-guide.rst","README.rst","index.rst","source\\QUANTAXIS.rst","source\\QUANTAXIS.QAARP.rst","source\\QUANTAXIS.QAAnalysis.rst","source\\QUANTAXIS.QABacktest.rst","source\\QUANTAXIS.QACmd.rst","source\\QUANTAXIS.QAData.rst","source\\QUANTAXIS.QAData.proto.rst","source\\QUANTAXIS.QAEngine.rst","source\\QUANTAXIS.QAFetch.rst","source\\QUANTAXIS.QAIndicator.rst","source\\QUANTAXIS.QAMarket.rst","source\\QUANTAXIS.QASU.rst","source\\QUANTAXIS.QAUtil.rst","source\\QUANTAXIS.QAWeb.rst","source\\modules.rst"],objects:{"":{QUANTAXIS:[14,0,0,"-"]},"QUANTAXIS.QAARP":{QAAccount:[15,0,0,"-"],QAPortfolio:[15,0,0,"-"],QARisk:[15,0,0,"-"],QAStrategy:[15,0,0,"-"],QAUser:[15,0,0,"-"]},"QUANTAXIS.QAARP.QAAccount":{Account_handler:[15,1,1,""],QA_Account:[15,1,1,""]},"QUANTAXIS.QAARP.QAAccount.Account_handler":{get_account:[15,2,1,""]},"QUANTAXIS.QAARP.QAAccount.QA_Account":{cash_table:[15,3,1,""],change_cash:[15,2,1,""],code:[15,3,1,""],current_time:[15,3,1,""],daily_cash:[15,3,1,""],daily_hold:[15,3,1,""],end_date:[15,3,1,""],from_message:[15,2,1,""],history_table:[15,3,1,""],hold:[15,3,1,""],latest_cash:[15,3,1,""],message:[15,3,1,""],on_bar:[15,2,1,""],on_tick:[15,2,1,""],receive_deal:[15,2,1,""],reset_assets:[15,2,1,""],run:[15,2,1,""],save:[15,2,1,""],send_order:[15,2,1,""],settle:[15,2,1,""],start_date:[15,3,1,""],table:[15,3,1,""],trade:[15,3,1,""]},"QUANTAXIS.QAARP.QAPortfolio":{QA_Portfolio:[15,1,1,""],QA_PortfolioView:[15,1,1,""],QA_TEST_MAKEPortfolio:[15,1,1,""]},"QUANTAXIS.QAARP.QAPortfolio.QA_Portfolio":{add_account:[15,2,1,""],cookie_mangement:[15,2,1,""],get_account:[15,2,1,""],get_cash:[15,2,1,""],get_portfolio:[15,2,1,""],new_account:[15,2,1,""],pull:[15,2,1,""],push:[15,2,1,""],table:[15,3,1,""]},"QUANTAXIS.QAARP.QAPortfolio.QA_PortfolioView":{account_cookie:[15,3,1,""],accounts:[15,3,1,""],code:[15,3,1,""],daily_cash:[15,3,1,""],daily_hold:[15,3,1,""],end_date:[15,3,1,""],init_assets:[15,3,1,""],start_date:[15,3,1,""]},"QUANTAXIS.QAARP.QAPortfolio.QA_TEST_MAKEPortfolio":{make_portfolio:[15,2,1,""]},"QUANTAXIS.QAARP.QARisk":{QA_Performance:[15,1,1,""],QA_Risk:[15,1,1,""]},"QUANTAXIS.QAARP.QARisk.QA_Performance":{abnormal_active:[15,2,1,""],accumulate_return:[15,3,1,""],brinson:[15,2,1,""],hold:[15,2,1,""],prefer:[15,3,1,""],save:[15,2,1,""],style:[15,3,1,""]},"QUANTAXIS.QAARP.QARisk.QA_Risk":{alpha:[15,3,1,""],annualize_return:[15,3,1,""],benchmark_annualize_return:[15,3,1,""],benchmark_assets:[15,3,1,""],benchmark_data:[15,3,1,""],benchmark_profitpct:[15,3,1,""],beta:[15,3,1,""],calc_alpha:[15,2,1,""],calc_annualize_return:[15,2,1,""],calc_beta:[15,2,1,""],calc_profit:[15,2,1,""],calc_profitpctchange:[15,2,1,""],calc_sharpe:[15,2,1,""],calmar:[15,3,1,""],max_dropback:[15,3,1,""],message:[15,3,1,""],profit:[15,3,1,""],profit_pct:[15,3,1,""],save:[15,2,1,""],set_benchmark:[15,2,1,""],sharpe:[15,3,1,""],sortino:[15,3,1,""],volatility:[15,3,1,""]},"QUANTAXIS.QAARP.QAStrategy":{QA_Strategy:[15,1,1,""]},"QUANTAXIS.QAARP.QAUser":{QA_User:[15,1,1,""]},"QUANTAXIS.QAARP.QAUser.QA_User":{client:[15,2,1,""],connect_database:[15,2,1,""],generate_simpleaccount:[15,2,1,""],get_portfolio:[15,2,1,""],login:[15,2,1,""],new_portfolio:[15,2,1,""],register_account:[15,2,1,""],table:[15,3,1,""]},"QUANTAXIS.QAAnalysis":{QAAnalysis_block:[16,0,0,"-"],QAAnalysis_dataframe:[16,0,0,"-"],QAAnalysis_machinelearning:[16,0,0,"-"],QAAnalysis_series:[16,0,0,"-"],QAAnalysis_tick:[16,0,0,"-"],QAAnalysis_trade:[16,0,0,"-"]},"QUANTAXIS.QAAnalysis.QAAnalysis_block":{QAAnalysis_block:[16,1,1,""],QAAnalysis_codewithblock:[16,1,1,""],get_gap_trade:[16,4,1,""]},"QUANTAXIS.QAAnalysis.QAAnalysis_block.QAAnalysis_block":{block_pcg:[16,2,1,""],block_price:[16,2,1,""],block_turnover:[16,2,1,""],market_data:[16,2,1,""],month_data:[16,3,1,""],res:[16,2,1,""],stock_info:[16,2,1,""],stock_turnover:[16,2,1,""],week_data:[16,3,1,""]},"QUANTAXIS.QAAnalysis.QAAnalysis_dataframe":{QAAnalysis_stock:[16,1,1,""],shadow:[16,1,1,""],shadow_calc:[16,4,1,""]},"QUANTAXIS.QAAnalysis.QAAnalysis_dataframe.QAAnalysis_stock":{add_func:[16,3,1,""],amplitude:[16,3,1,""],close:[16,3,1,""],date:[16,3,1,""],datetime:[16,3,1,""],day_pct_change:[16,3,1,""],high:[16,3,1,""],index:[16,3,1,""],kurtosis:[16,3,1,""],low:[16,3,1,""],mad:[16,3,1,""],max:[16,3,1,""],mean:[16,3,1,""],mean_harmonic:[16,3,1,""],min:[16,3,1,""],mode:[16,3,1,""],open:[16,3,1,""],pct_change:[16,3,1,""],price:[16,3,1,""],price_diff:[16,3,1,""],pstdev:[16,3,1,""],pvariance:[16,3,1,""],skewnewss:[16,3,1,""],stdev:[16,3,1,""],variance:[16,3,1,""],vol:[16,3,1,""],volume:[16,3,1,""]},"QUANTAXIS.QAAnalysis.QAAnalysis_dataframe.shadow":{shadow_panel:[16,2,1,""]},"QUANTAXIS.QAAnalysis.QAAnalysis_machinelearning":{QAAnalysis_Machine_Learning:[16,1,1,""]},"QUANTAXIS.QAAnalysis.QAAnalysis_machinelearning.QAAnalysis_Machine_Learning":{cross_valid:[16,2,1,""],data_co:[16,2,1,""],load_data:[16,2,1,""],load_modules:[16,2,1,""],training:[16,2,1,""]},"QUANTAXIS.QAAnalysis.QAAnalysis_series":{QAAnalysis_Series_slope:[16,4,1,""]},"QUANTAXIS.QAAnalysis.QAAnalysis_tick":{QAAnalysis_Transaction:[16,1,1,""]},"QUANTAXIS.QAAnalysis.QAAnalysis_tick.QAAnalysis_Transaction":{get_data:[16,2,1,""],get_stock_info:[16,2,1,""],winner:[16,2,1,""]},"QUANTAXIS.QAAnalysis.QAAnalysis_trade":{QAAnalysis_trade:[16,1,1,""]},"QUANTAXIS.QAAnalysis.QAAnalysis_trade.QAAnalysis_trade":{import_trade:[16,2,1,""],make_deal:[16,2,1,""]},"QUANTAXIS.QABacktest":{QAAnalysis:[17,0,0,"-"],QABacktest:[17,0,0,"-"],QAResult:[17,0,0,"-"],backtest_setting:[17,0,0,"-"]},"QUANTAXIS.QABacktest.QAAnalysis":{QA_backtest_analysis_backtest:[17,4,1,""],QA_backtest_calc_alpha:[17,4,1,""],QA_backtest_calc_assets:[17,4,1,""],QA_backtest_calc_benchmark:[17,4,1,""],QA_backtest_calc_beta:[17,4,1,""],QA_backtest_calc_dropback_max:[17,4,1,""],QA_backtest_calc_profit:[17,4,1,""],QA_backtest_calc_profit_matrix:[17,4,1,""],QA_backtest_calc_profit_per_year:[17,4,1,""],QA_backtest_calc_sharpe:[17,4,1,""],QA_backtest_calc_trade_date:[17,4,1,""],QA_backtest_calc_volatility:[17,4,1,""],QA_backtest_calc_win_rate:[17,4,1,""],calc_every_pnl:[17,4,1,""],calc_trade_time:[17,4,1,""]},"QUANTAXIS.QABacktest.QABacktest":{BACKTEST_FRAMEWORK:[17,1,1,""],QA_Backtest:[17,1,1,""]},"QUANTAXIS.QABacktest.QABacktest.QA_Backtest":{after_success:[17,2,1,""],run:[17,2,1,""],start_market:[17,2,1,""],stop:[17,2,1,""]},"QUANTAXIS.QABacktest.QAResult":{backtest_result_analyzer:[17,1,1,""]},"QUANTAXIS.QABacktest.QAResult.backtest_result_analyzer":{codes:[17,3,1,""],detail:[17,3,1,""],get_loss_trade:[17,2,1,""],get_profit_trade:[17,2,1,""],get_stock_tradedetail:[17,2,1,""],get_stock_tradehistory:[17,2,1,""],get_trade_before_and_after_pnl:[17,2,1,""],get_trade_marketdata:[17,2,1,""],history:[17,3,1,""]},"QUANTAXIS.QABacktest.backtest_setting":{backtest_setting:[17,1,1,""]},"QUANTAXIS.QABacktest.backtest_setting.backtest_setting":{absoult_path:[17,3,1,""],database_uri:[17,3,1,""],dirs:[17,3,1,""]},"QUANTAXIS.QACmd":{CLI:[18,1,1,""],QA_cmd:[18,4,1,""],backtest:[18,0,0,"-"],sourcecpy:[18,4,1,""]},"QUANTAXIS.QACmd.CLI":{do_clean:[18,2,1,""],do_drop_database:[18,2,1,""],do_examples:[18,2,1,""],do_exit:[18,2,1,""],do_fn:[18,2,1,""],do_help:[18,2,1,""],do_quit:[18,2,1,""],do_save:[18,2,1,""],do_shell:[18,2,1,""],do_version:[18,2,1,""],help:[18,2,1,""],help_clean:[18,2,1,""],help_drop_database:[18,2,1,""],help_examples:[18,2,1,""],help_exit:[18,2,1,""],help_quit:[18,2,1,""],help_save:[18,2,1,""],help_version:[18,2,1,""]},"QUANTAXIS.QAData":{QADataStruct:[19,0,0,"-"],base_datastruct:[19,0,0,"-"],data_fq:[19,0,0,"-"],data_resample:[19,0,0,"-"],dsmethods:[19,0,0,"-"],proto:[20,0,0,"-"],realtimedata:[19,0,0,"-"],schema:[19,0,0,"-"],serialize:[19,0,0,"-"]},"QUANTAXIS.QAData.QADataStruct":{QA_DataStruct_Future_day:[19,1,1,""],QA_DataStruct_Future_min:[19,1,1,""],QA_DataStruct_Index_day:[19,1,1,""],QA_DataStruct_Index_min:[19,1,1,""],QA_DataStruct_Security_list:[19,1,1,""],QA_DataStruct_Stock_block:[19,1,1,""],QA_DataStruct_Stock_day:[19,1,1,""],QA_DataStruct_Stock_min:[19,1,1,""],QA_DataStruct_Stock_realtime:[19,1,1,""],QA_DataStruct_Stock_realtime_series:[19,1,1,""],QA_DataStruct_Stock_transaction:[19,1,1,""]},"QUANTAXIS.QAData.QADataStruct.QA_DataStruct_Security_list":{code:[19,3,1,""],get_etf:[19,2,1,""],get_index:[19,2,1,""],get_stock:[19,2,1,""],name:[19,3,1,""]},"QUANTAXIS.QAData.QADataStruct.QA_DataStruct_Stock_block":{block_name:[19,3,1,""],code:[19,3,1,""],get_block:[19,2,1,""],get_code:[19,2,1,""],get_price:[19,2,1,""],getdtype:[19,2,1,""],len:[19,3,1,""],show:[19,2,1,""]},"QUANTAXIS.QAData.QADataStruct.QA_DataStruct_Stock_day":{high_limit:[19,3,1,""],low_limit:[19,3,1,""],next_day_high_limit:[19,3,1,""],next_day_low_limit:[19,3,1,""],preclose:[19,3,1,""],price_chg:[19,3,1,""],to_hfq:[19,2,1,""],to_qfq:[19,2,1,""]},"QUANTAXIS.QAData.QADataStruct.QA_DataStruct_Stock_min":{high_limit:[19,3,1,""],low_limit:[19,3,1,""],to_hfq:[19,2,1,""],to_qfq:[19,2,1,""]},"QUANTAXIS.QAData.QADataStruct.QA_DataStruct_Stock_realtime":{ab_board:[19,3,1,""],serialize:[19,2,1,""]},"QUANTAXIS.QAData.QADataStruct.QA_DataStruct_Stock_transaction":{amount:[19,3,1,""],buyorsell:[19,3,1,""],date:[19,3,1,""],datetime:[19,3,1,""],get_big_orders:[19,2,1,""],get_medium_order:[19,2,1,""],get_small_order:[19,2,1,""],get_time:[19,2,1,""],index:[19,3,1,""],order:[19,3,1,""],price:[19,3,1,""],resample:[19,2,1,""],time:[19,3,1,""],vol:[19,3,1,""],volume:[19,3,1,""]},"QUANTAXIS.QAData.data_fq":{QA_data_get_hfq:[19,4,1,""],QA_data_get_qfq:[19,4,1,""],QA_data_make_hfq:[19,4,1,""],QA_data_make_qfq:[19,4,1,""],QA_data_stock_to_fq:[19,4,1,""]},"QUANTAXIS.QAData.data_resample":{QA_data_tick_resample:[19,4,1,""]},"QUANTAXIS.QAData.dsmethods":{concat:[19,4,1,""],from_tushare:[19,4,1,""]},"QUANTAXIS.QAData.proto":{order_pb2:[20,0,0,"-"],stock_day_pb2:[20,0,0,"-"],stock_min_pb2:[20,0,0,"-"]},"QUANTAXIS.QAData.schema":{Shares:[19,1,1,""],full:[19,1,1,""],fundamental:[19,1,1,""]},"QUANTAXIS.QAData.schema.Shares":{circulation:[19,3,1,""],effective_date:[19,3,1,""],shares:[19,3,1,""],sid:[19,3,1,""]},"QUANTAXIS.QAData.schema.full":{adratio:[19,3,1,""],arturndays:[19,3,1,""],arturnover:[19,3,1,""],bips:[19,3,1,""],business_income:[19,3,1,""],bvps:[19,3,1,""],cashflowratio:[19,3,1,""],cashratio:[19,3,1,""],cf_liabilities:[19,3,1,""],cf_nm:[19,3,1,""],cf_sales:[19,3,1,""],code:[19,3,1,""],currentasset_days:[19,3,1,""],currentasset_turnover:[19,3,1,""],currentratio:[19,3,1,""],distrib:[19,3,1,""],epcf:[19,3,1,""],eps:[19,3,1,""],eps_yoy:[19,3,1,""],epsg:[19,3,1,""],gross_profit_rate:[19,3,1,""],icratio:[19,3,1,""],inventory_days:[19,3,1,""],inventory_turnover:[19,3,1,""],mbrg:[19,3,1,""],name:[19,3,1,""],nav:[19,3,1,""],net_profit_ratio:[19,3,1,""],net_profits:[19,3,1,""],nprg:[19,3,1,""],profits_yoy:[19,3,1,""],quarter:[19,3,1,""],quickratio:[19,3,1,""],rateofreturn:[19,3,1,""],report_date:[19,3,1,""],roe:[19,3,1,""],seg:[19,3,1,""],sheqratio:[19,3,1,""],targ:[19,3,1,""],trade_date:[19,3,1,""]},"QUANTAXIS.QAData.schema.fundamental":{adratio:[19,3,1,""],arturndays:[19,3,1,""],arturnover:[19,3,1,""],bips:[19,3,1,""],business_income:[19,3,1,""],bvps:[19,3,1,""],cashflowratio:[19,3,1,""],cashratio:[19,3,1,""],cf_liabilities:[19,3,1,""],cf_nm:[19,3,1,""],cf_sales:[19,3,1,""],code:[19,3,1,""],currentasset_days:[19,3,1,""],currentasset_turnover:[19,3,1,""],currentratio:[19,3,1,""],distrib:[19,3,1,""],epcf:[19,3,1,""],eps:[19,3,1,""],eps_yoy:[19,3,1,""],epsg:[19,3,1,""],gross_profit_rate:[19,3,1,""],icratio:[19,3,1,""],inventory_days:[19,3,1,""],inventory_turnover:[19,3,1,""],mbrg:[19,3,1,""],name:[19,3,1,""],nav:[19,3,1,""],net_profit_ratio:[19,3,1,""],net_profits:[19,3,1,""],nprg:[19,3,1,""],profits_yoy:[19,3,1,""],quarter:[19,3,1,""],quickratio:[19,3,1,""],rateofreturn:[19,3,1,""],report_date:[19,3,1,""],roe:[19,3,1,""],seg:[19,3,1,""],sheqratio:[19,3,1,""],targ:[19,3,1,""]},"QUANTAXIS.QAEngine":{QAEvent:[21,0,0,"-"],QATask:[21,0,0,"-"],QAThreadEngine:[21,0,0,"-"]},"QUANTAXIS.QAEngine.QAEvent":{QA_Event:[21,1,1,""],QA_Worker:[21,1,1,""]},"QUANTAXIS.QAEngine.QAEvent.QA_Worker":{run:[21,2,1,""]},"QUANTAXIS.QAEngine.QATask":{QA_Task:[21,1,1,""]},"QUANTAXIS.QAEngine.QATask.QA_Task":{"do":[21,2,1,""],result:[21,3,1,""]},"QUANTAXIS.QAEngine.QAThreadEngine":{QA_Engine:[21,1,1,""],QA_Thread:[21,1,1,""]},"QUANTAXIS.QAEngine.QAThreadEngine.QA_Engine":{clear:[21,2,1,""],create_kernal:[21,2,1,""],join:[21,2,1,""],kernel_num:[21,3,1,""],pause:[21,2,1,""],register_kernal:[21,2,1,""],resume:[21,2,1,""],run:[21,2,1,""],run_job:[21,2,1,""],start_kernal:[21,2,1,""],stop:[21,2,1,""],stop_all:[21,2,1,""],stop_kernal:[21,2,1,""]},"QUANTAXIS.QAEngine.QAThreadEngine.QA_Thread":{get:[21,2,1,""],get_nowait:[21,2,1,""],pause:[21,2,1,""],put:[21,2,1,""],put_nowait:[21,2,1,""],qsize:[21,2,1,""],resume:[21,2,1,""],run:[21,2,1,""],stop:[21,2,1,""]},"QUANTAXIS.QAFetch":{Fetcher:[22,0,0,"-"],QACrawler:[22,0,0,"-"],QAEastMoney:[22,0,0,"-"],QAQuery:[22,0,0,"-"],QAQuery_Advance:[22,0,0,"-"],QATdx:[22,0,0,"-"],QATdx_adv:[22,0,0,"-"],QAThs:[22,0,0,"-"],QATushare:[22,0,0,"-"],QAWind:[22,0,0,"-"],QA_fetch_get_future_day:[22,4,1,""],QA_fetch_get_future_list:[22,4,1,""],QA_fetch_get_future_min:[22,4,1,""],QA_fetch_get_index_day:[22,4,1,""],QA_fetch_get_index_min:[22,4,1,""],QA_fetch_get_security_bars:[22,4,1,""],QA_fetch_get_stock_block:[22,4,1,""],QA_fetch_get_stock_day:[22,4,1,""],QA_fetch_get_stock_indicator:[22,4,1,""],QA_fetch_get_stock_info:[22,4,1,""],QA_fetch_get_stock_list:[22,4,1,""],QA_fetch_get_stock_min:[22,4,1,""],QA_fetch_get_stock_realtime:[22,4,1,""],QA_fetch_get_stock_transaction:[22,4,1,""],QA_fetch_get_stock_transaction_realtime:[22,4,1,""],QA_fetch_get_stock_xdxr:[22,4,1,""],QA_fetch_get_trade_date:[22,4,1,""],QAfinancial:[22,0,0,"-"],base:[22,0,0,"-"],data_list:[22,0,0,"-"],realtime:[22,0,0,"-"],use:[22,4,1,""]},"QUANTAXIS.QAFetch.Fetcher":{QA_Fetcher:[22,1,1,""],QA_quotation:[22,4,1,""]},"QUANTAXIS.QAFetch.Fetcher.QA_Fetcher":{change_ip:[22,2,1,""],get_info:[22,2,1,""],get_quotation:[22,2,1,""]},"QUANTAXIS.QAFetch.QACrawler":{QA_fetch_get_sh_margin:[22,4,1,""],QA_fetch_get_sz_margin:[22,4,1,""]},"QUANTAXIS.QAFetch.QAEastMoney":{QA_fetch_get_stock_analysis:[22,4,1,""]},"QUANTAXIS.QAFetch.QAQuery":{QA_fetch_account:[22,4,1,""],QA_fetch_backtest_history:[22,4,1,""],QA_fetch_backtest_info:[22,4,1,""],QA_fetch_future_day:[22,4,1,""],QA_fetch_future_min:[22,4,1,""],QA_fetch_future_tick:[22,4,1,""],QA_fetch_index_day:[22,4,1,""],QA_fetch_index_min:[22,4,1,""],QA_fetch_indexlist_day:[22,4,1,""],QA_fetch_quotation:[22,4,1,""],QA_fetch_quotations:[22,4,1,""],QA_fetch_stock_block:[22,4,1,""],QA_fetch_stock_day:[22,4,1,""],QA_fetch_stock_full:[22,4,1,""],QA_fetch_stock_info:[22,4,1,""],QA_fetch_stock_list:[22,4,1,""],QA_fetch_stock_min:[22,4,1,""],QA_fetch_stock_name:[22,4,1,""],QA_fetch_stock_xdxr:[22,4,1,""],QA_fetch_trade_date:[22,4,1,""]},"QUANTAXIS.QAFetch.QAQuery_Advance":{QA_fetch_index_day_adv:[22,4,1,""],QA_fetch_index_min_adv:[22,4,1,""],QA_fetch_security_list_adv:[22,4,1,""],QA_fetch_stock_block_adv:[22,4,1,""],QA_fetch_stock_day_adv:[22,4,1,""],QA_fetch_stock_day_full_adv:[22,4,1,""],QA_fetch_stock_list_adv:[22,4,1,""],QA_fetch_stock_min_adv:[22,4,1,""],QA_fetch_stock_realtime_adv:[22,4,1,""],QA_fetch_stock_transaction_adv:[22,4,1,""]},"QUANTAXIS.QAFetch.QATdx":{QA_fetch_depth_market_data:[22,4,1,""],QA_fetch_get_future_day:[22,4,1,""],QA_fetch_get_future_list:[22,4,1,""],QA_fetch_get_future_min:[22,4,1,""],QA_fetch_get_future_realtime:[22,4,1,""],QA_fetch_get_future_transaction:[22,4,1,""],QA_fetch_get_future_transaction_realtime:[22,4,1,""],QA_fetch_get_index_day:[22,4,1,""],QA_fetch_get_index_min:[22,4,1,""],QA_fetch_get_security_bars:[22,4,1,""],QA_fetch_get_stock_block:[22,4,1,""],QA_fetch_get_stock_day:[22,4,1,""],QA_fetch_get_stock_info:[22,4,1,""],QA_fetch_get_stock_latest:[22,4,1,""],QA_fetch_get_stock_list:[22,4,1,""],QA_fetch_get_stock_min:[22,4,1,""],QA_fetch_get_stock_realtime:[22,4,1,""],QA_fetch_get_stock_transaction:[22,4,1,""],QA_fetch_get_stock_transaction_realtime:[22,4,1,""],QA_fetch_get_stock_xdxr:[22,4,1,""],QA_fetch_get_wholemarket_list:[22,4,1,""],for_sh:[22,4,1,""],for_sz:[22,4,1,""],ping:[22,4,1,""],select_best_ip:[22,4,1,""]},"QUANTAXIS.QAFetch.QATdx_adv":{QA_Tdx_Executor:[22,1,1,""],bat:[22,4,1,""],get_bar:[22,4,1,""],get_day_once:[22,4,1,""]},"QUANTAXIS.QAFetch.QATdx_adv.QA_Tdx_Executor":{api:[22,3,1,""],api_worker:[22,2,1,""],get_available:[22,2,1,""],get_frequence:[22,2,1,""],get_market:[22,2,1,""],get_realtime:[22,2,1,""],get_realtime_concurrent:[22,2,1,""],get_security_bar:[22,2,1,""],get_security_bar_concurrent:[22,2,1,""],ipsize:[22,3,1,""],save_mongo:[22,2,1,""]},"QUANTAXIS.QAFetch.QAThs":{QA_fetch_get_stock_block:[22,4,1,""],QA_fetch_get_stock_day:[22,4,1,""],QA_fetch_get_stock_day_in_year:[22,4,1,""]},"QUANTAXIS.QAFetch.QATushare":{QA_fetch_get_stock_day:[22,4,1,""],QA_fetch_get_stock_info:[22,4,1,""],QA_fetch_get_stock_list:[22,4,1,""],QA_fetch_get_stock_realtime:[22,4,1,""],QA_fetch_get_stock_tick:[22,4,1,""],QA_fetch_get_stock_time_to_market:[22,4,1,""],QA_fetch_get_trade_date:[22,4,1,""]},"QUANTAXIS.QAFetch.QAWind":{QA_fetch_get_stock_day:[22,4,1,""],QA_fetch_get_stock_day_simple:[22,4,1,""],QA_fetch_get_stock_financial:[22,4,1,""],QA_fetch_get_stock_indicator:[22,4,1,""],QA_fetch_get_stock_info:[22,4,1,""],QA_fetch_get_stock_list:[22,4,1,""],QA_fetch_get_stock_list_special:[22,4,1,""],QA_fetch_get_stock_risk:[22,4,1,""],QA_fetch_get_stock_shape:[22,4,1,""],QA_fetch_get_stock_xueqiu:[22,4,1,""],QA_fetch_get_trade_date:[22,4,1,""]},"QUANTAXIS.QAFetch.QAfinancial":{download:[22,4,1,""],get_and_parse:[22,4,1,""],get_filename:[22,4,1,""],prase_all:[22,4,1,""]},"QUANTAXIS.QAFetch.realtime":{get_today_all:[22,4,1,""]},"QUANTAXIS.QAIndicator":{base:[23,0,0,"-"],indicators:[23,0,0,"-"]},"QUANTAXIS.QAIndicator.base":{ABS:[23,4,1,""],AVEDEV:[23,4,1,""],BBI:[23,4,1,""],BBIBOLL:[23,4,1,""],COUNT:[23,4,1,""],CROSS:[23,4,1,""],DIFF:[23,4,1,""],EMA:[23,4,1,""],HHV:[23,4,1,""],IF:[23,4,1,""],LAST:[23,4,1,""],LLV:[23,4,1,""],MA:[23,4,1,""],MACD:[23,4,1,""],MAX:[23,4,1,""],MIN:[23,4,1,""],REF:[23,4,1,""],SMA:[23,4,1,""],STD:[23,4,1,""],SUM:[23,4,1,""]},"QUANTAXIS.QAIndicator.indicators":{QA_indicator_ADTM:[23,4,1,""],QA_indicator_ARBR:[23,4,1,""],QA_indicator_ASI:[23,4,1,""],QA_indicator_ATR:[23,4,1,""],QA_indicator_BBI:[23,4,1,""],QA_indicator_BIAS:[23,4,1,""],QA_indicator_BOLL:[23,4,1,""],QA_indicator_CCI:[23,4,1,""],QA_indicator_CHO:[23,4,1,""],QA_indicator_CR:[23,4,1,""],QA_indicator_DDI:[23,4,1,""],QA_indicator_DMA:[23,4,1,""],QA_indicator_DMI:[23,4,1,""],QA_indicator_EMA:[23,4,1,""],QA_indicator_EXPMA:[23,4,1,""],QA_indicator_KDJ:[23,4,1,""],QA_indicator_MA:[23,4,1,""],QA_indicator_MACD:[23,4,1,""],QA_indicator_MFI:[23,4,1,""],QA_indicator_MIKE:[23,4,1,""],QA_indicator_MTM:[23,4,1,""],QA_indicator_OBV:[23,4,1,""],QA_indicator_OSC:[23,4,1,""],QA_indicator_PBX:[23,4,1,""],QA_indicator_PVT:[23,4,1,""],QA_indicator_ROC:[23,4,1,""],QA_indicator_RSI:[23,4,1,""],QA_indicator_SKDJ:[23,4,1,""],QA_indicator_SMA:[23,4,1,""],QA_indicator_VPT:[23,4,1,""],QA_indicator_VR:[23,4,1,""],QA_indicator_VRSI:[23,4,1,""],QA_indicator_VSTD:[23,4,1,""],QA_indicator_WR:[23,4,1,""],QA_indicator_shadow:[23,4,1,""],amplitude:[23,4,1,""],body:[23,4,1,""],body_abs:[23,4,1,""],lower_shadow:[23,4,1,""],price_pcg:[23,4,1,""],upper_shadow:[23,4,1,""]},"QUANTAXIS.QAMarket":{QABacktestBroker:[24,0,0,"-"],QABroker:[24,0,0,"-"],QADealer:[24,0,0,"-"],QAMarket:[24,0,0,"-"],QAOrder:[24,0,0,"-"],QAOrderHandler:[24,0,0,"-"],QARandomBroker:[24,0,0,"-"],QARealBroker:[24,0,0,"-"],QASimulatedBroker:[24,0,0,"-"],QATrade:[24,0,0,"-"],shipaneBroker:[24,0,0,"-"],shipaneclient:[24,0,0,"-"],tdxRealBroker:[24,0,0,"-"]},"QUANTAXIS.QAMarket.QABacktestBroker":{QA_BacktestBroker:[24,1,1,""]},"QUANTAXIS.QAMarket.QABacktestBroker.QA_BacktestBroker":{get_market:[24,2,1,""],query_data:[24,2,1,""],receive_order:[24,2,1,""],run:[24,2,1,""],warp:[24,2,1,""]},"QUANTAXIS.QAMarket.QABroker":{QA_BROKER_EVENT:[24,1,1,""],QA_Broker:[24,1,1,""]},"QUANTAXIS.QAMarket.QABroker.QA_Broker":{get_market:[24,2,1,""],receive_order:[24,2,1,""],warp:[24,2,1,""]},"QUANTAXIS.QAMarket.QADealer":{QA_Dealer:[24,1,1,""],Stock_Dealer:[24,1,1,""],commission:[24,1,1,""],dealer_preset:[24,1,1,""]},"QUANTAXIS.QAMarket.QADealer.QA_Dealer":{backtest_stock_dealer:[24,2,1,""],cal_fee:[24,2,1,""],callback_message:[24,2,1,""],deal:[24,2,1,""]},"QUANTAXIS.QAMarket.QADealer.commission":{if_buyside_commission:[24,3,1,""],if_commission:[24,3,1,""],if_sellside_commission:[24,3,1,""]},"QUANTAXIS.QAMarket.QADealer.dealer_preset":{load_preset:[24,2,1,""]},"QUANTAXIS.QAMarket.QAMarket":{QA_Market:[24,1,1,""]},"QUANTAXIS.QAMarket.QAMarket.QA_Market":{clear:[24,2,1,""],connect:[24,2,1,""],get_account:[24,2,1,""],get_account_id:[24,2,1,""],get_trading_day:[24,2,1,""],insert_order:[24,2,1,""],login:[24,2,1,""],logout:[24,2,1,""],on_insert_order:[24,2,1,""],on_query_data:[24,2,1,""],on_trade_event:[24,2,1,""],query_assets:[24,2,1,""],query_cash:[24,2,1,""],query_currentbar:[24,2,1,""],query_data:[24,2,1,""],query_data_no_wait:[24,2,1,""],query_order:[24,2,1,""],query_position:[24,2,1,""],register:[24,2,1,""],start:[24,2,1,""],upcoming_data:[24,2,1,""]},"QUANTAXIS.QAMarket.QAOrder":{QA_Order:[24,1,1,""],QA_OrderQueue:[24,1,1,""]},"QUANTAXIS.QAMarket.QAOrder.QA_Order":{from_dict:[24,2,1,""],info:[24,2,1,""],to_df:[24,2,1,""],to_dict:[24,2,1,""]},"QUANTAXIS.QAMarket.QAOrder.QA_OrderQueue":{insert_order:[24,2,1,""],order_ids:[24,3,1,""],pending:[24,3,1,""],query_order:[24,2,1,""],set_status:[24,2,1,""],settle:[24,2,1,""],trade_list:[24,3,1,""]},"QUANTAXIS.QAMarket.QAOrderHandler":{QA_OrderHandler:[24,1,1,""]},"QUANTAXIS.QAMarket.QAOrderHandler.QA_OrderHandler":{query_order:[24,2,1,""],run:[24,2,1,""]},"QUANTAXIS.QAMarket.QARandomBroker":{QA_RandomBroker:[24,1,1,""]},"QUANTAXIS.QAMarket.QARandomBroker.QA_RandomBroker":{get_data:[24,2,1,""],receive_order:[24,2,1,""],warp:[24,2,1,""]},"QUANTAXIS.QAMarket.QARealBroker":{QA_RealBroker:[24,1,1,""]},"QUANTAXIS.QAMarket.QARealBroker.QA_RealBroker":{get_data:[24,2,1,""],receive_order:[24,2,1,""],warp:[24,2,1,""]},"QUANTAXIS.QAMarket.QASimulatedBroker":{QA_SimulatedBroker:[24,1,1,""]},"QUANTAXIS.QAMarket.QASimulatedBroker.QA_SimulatedBroker":{get_market:[24,2,1,""],query_data:[24,2,1,""],receive_order:[24,2,1,""]},"QUANTAXIS.QAMarket.QATrade":{QA_Trade:[24,1,1,""]},"QUANTAXIS.QAMarket.QATrade.QA_Trade":{cancel_order:[24,2,1,""],connect:[24,2,1,""],get_account_id:[24,2,1,""],get_api_last_error:[24,2,1,""],get_api_version:[24,2,1,""],get_client_id:[24,2,1,""],get_trading_day:[24,2,1,""],insert_order:[24,2,1,""],login:[24,2,1,""],logout:[24,2,1,""],on_cancel_order:[24,2,1,""],on_cancel_order_event:[24,2,1,""],on_connect:[24,2,1,""],on_error:[24,2,1,""],on_insert_order:[24,2,1,""],on_order_event:[24,2,1,""],on_query_assets:[24,2,1,""],on_query_data:[24,2,1,""],on_query_order:[24,2,1,""],on_query_position:[24,2,1,""],on_query_trade:[24,2,1,""],on_trade_event:[24,2,1,""],query_assets:[24,2,1,""],query_data:[24,2,1,""],query_order:[24,2,1,""],query_position:[24,2,1,""],query_trade:[24,2,1,""],register_spi:[24,2,1,""],release:[24,2,1,""],subscribe_public_topic:[24,2,1,""]},"QUANTAXIS.QAMarket.shipaneBroker":{SPETradeApi:[24,1,1,""]},"QUANTAXIS.QAMarket.shipaneBroker.SPETradeApi":{call:[24,2,1,""],cancel_order:[24,2,1,""],data_to_df:[24,2,1,""],get_quote:[24,2,1,""],logoff:[24,2,1,""],logon:[24,2,1,""],ping:[24,2,1,""],query_data:[24,2,1,""],receive_order:[24,2,1,""],repay:[24,2,1,""],run:[24,2,1,""],send_order:[24,2,1,""]},"QUANTAXIS.QAMarket.shipaneclient":{Client:[24,1,1,""],ConnectionMethod:[24,1,1,""],MediaType:[24,1,1,""]},"QUANTAXIS.QAMarket.shipaneclient.Client":{KEY_REGEX:[24,3,1,""],buy:[24,2,1,""],cancel:[24,2,1,""],cancel_all:[24,2,1,""],create_adjustment:[24,2,1,""],execute:[24,2,1,""],get_account:[24,2,1,""],get_orders:[24,2,1,""],get_positions:[24,2,1,""],get_statuses:[24,2,1,""],host:[24,3,1,""],ipo:[24,2,1,""],key:[24,3,1,""],port:[24,3,1,""],purchase_convertible_bonds:[24,2,1,""],purchase_new_stocks:[24,2,1,""],query:[24,2,1,""],query_convertible_bonds:[24,2,1,""],query_new_stocks:[24,2,1,""],sell:[24,2,1,""],shutdown_clients:[24,2,1,""],start_clients:[24,2,1,""],timeout:[24,3,1,""]},"QUANTAXIS.QAMarket.shipaneclient.ConnectionMethod":{DIRECT:[24,3,1,""],PROXY:[24,3,1,""]},"QUANTAXIS.QAMarket.shipaneclient.MediaType":{DEFAULT:[24,3,1,""],JOIN_QUANT:[24,3,1,""]},"QUANTAXIS.QAMarket.tdxRealBroker":{TDXBroker:[24,1,1,""],TdxTradeApiParams:[24,1,1,""]},"QUANTAXIS.QAMarket.tdxRealBroker.TDXBroker":{call:[24,2,1,""],cancel_order:[24,2,1,""],data_to_df:[24,2,1,""],decrypt:[24,2,1,""],encrypt:[24,2,1,""],get_quote:[24,2,1,""],logoff:[24,2,1,""],logon:[24,2,1,""],ping:[24,2,1,""],query_data:[24,2,1,""],receive_order:[24,2,1,""],repay:[24,2,1,""],run:[24,2,1,""],send_order:[24,2,1,""]},"QUANTAXIS.QAMarket.tdxRealBroker.TdxTradeApiParams":{QUERY_CATEGORY_BALANCE_OF_MARGIN_LOAN:[24,3,1,""],QUERY_CATEGORY_BALANCE_OF_STOCK_LOAN:[24,3,1,""],QUERY_CATEGORY_CANCELABLE_ORDER:[24,3,1,""],QUERY_CATEGORY_CASH:[24,3,1,""],QUERY_CATEGORY_DEAL_OF_TODAY:[24,3,1,""],QUERY_CATEGORY_NEW_STOCKS:[24,3,1,""],QUERY_CATEGORY_NEW_STOCKS_QUOTA:[24,3,1,""],QUERY_CATEGORY_NEW_STOCK_HIT:[24,3,1,""],QUERY_CATEGORY_NEW_STOCK_NUMBER:[24,3,1,""],QUERY_CATEGORY_OPERABLE_MARGIN_SOTCK:[24,3,1,""],QUERY_CATEGORY_ORDER_OF_TODAY:[24,3,1,""],QUERY_CATEGORY_SHAREHOLDERS_CODE:[24,3,1,""],QUERY_CATEGORY_STOCKS:[24,3,1,""]},"QUANTAXIS.QASU":{main:[25,0,0,"-"],save_account:[25,0,0,"-"],save_backtest:[25,0,0,"-"],save_local:[25,0,0,"-"],save_tdx:[25,0,0,"-"],save_tdx_file:[25,0,0,"-"],save_tushare:[25,0,0,"-"],user:[25,0,0,"-"]},"QUANTAXIS.QASU.main":{QA_SU_save_etf_day:[25,4,1,""],QA_SU_save_etf_min:[25,4,1,""],QA_SU_save_index_day:[25,4,1,""],QA_SU_save_index_min:[25,4,1,""],QA_SU_save_stock_block:[25,4,1,""],QA_SU_save_stock_day:[25,4,1,""],QA_SU_save_stock_info:[25,4,1,""],QA_SU_save_stock_list:[25,4,1,""],QA_SU_save_stock_min:[25,4,1,""],QA_SU_save_stock_min_5:[25,4,1,""],QA_SU_save_stock_xdxr:[25,4,1,""],select_save_engine:[25,4,1,""]},"QUANTAXIS.QASU.save_account":{save_account:[25,4,1,""],save_riskanalysis:[25,4,1,""],update_account:[25,4,1,""]},"QUANTAXIS.QASU.save_backtest":{QA_SU_save_account_message:[25,4,1,""],QA_SU_save_account_to_csv:[25,4,1,""],QA_SU_save_backtest_message:[25,4,1,""],QA_SU_save_pnl_to_csv:[25,4,1,""]},"QUANTAXIS.QASU.save_local":{make_cache:[25,4,1,""],make_dir:[25,4,1,""]},"QUANTAXIS.QASU.save_tdx":{QA_SU_save_etf_day:[25,4,1,""],QA_SU_save_etf_min:[25,4,1,""],QA_SU_save_index_day:[25,4,1,""],QA_SU_save_index_min:[25,4,1,""],QA_SU_save_stock_block:[25,4,1,""],QA_SU_save_stock_day:[25,4,1,""],QA_SU_save_stock_info:[25,4,1,""],QA_SU_save_stock_list:[25,4,1,""],QA_SU_save_stock_min:[25,4,1,""],QA_SU_save_stock_transaction:[25,4,1,""],QA_SU_save_stock_xdxr:[25,4,1,""],now_time:[25,4,1,""]},"QUANTAXIS.QASU.save_tdx_file":{QA_save_tdx_to_mongo:[25,4,1,""]},"QUANTAXIS.QASU.save_tushare":{QA_SU_save_stock_info:[25,4,1,""],QA_SU_save_stock_list:[25,4,1,""],QA_SU_save_trade_date_all:[25,4,1,""],QA_save_stock_day_all:[25,4,1,""],QA_save_stock_day_all_bfq:[25,4,1,""],QA_save_stock_day_with_fqfactor:[25,4,1,""]},"QUANTAXIS.QASU.user":{QA_user_sign_in:[25,4,1,""],QA_user_sign_up:[25,4,1,""]},"QUANTAXIS.QAUtil":{QAAuth:[26,0,0,"-"],QABar:[26,0,0,"-"],QACfg:[26,0,0,"-"],QACode:[26,0,0,"-"],QACsv:[26,0,0,"-"],QADate:[26,0,0,"-"],QADate_trade:[26,0,0,"-"],QADict:[26,0,0,"-"],QAList:[26,0,0,"-"],QALocalize:[26,0,0,"-"],QALogs:[26,0,0,"-"],QAMail:[26,0,0,"-"],QAMongo:[26,0,0,"-"],QAParameter:[26,0,0,"-"],QAPlot:[26,0,0,"-"],QARandom:[26,0,0,"-"],QASetting:[26,0,0,"-"],QASql:[26,0,0,"-"],QAText:[26,0,0,"-"],QATransform:[26,0,0,"-"],QAWeb:[26,0,0,"-"],host:[26,0,0,"-"]},"QUANTAXIS.QAUtil.QABar":{QA_util_make_hour_index:[26,4,1,""],QA_util_make_min_index:[26,4,1,""],QA_util_time_gap:[26,4,1,""]},"QUANTAXIS.QAUtil.QACfg":{QA_util_cfg_initial:[26,4,1,""],QA_util_get_cfg:[26,4,1,""]},"QUANTAXIS.QAUtil.QACode":{QA_util_code_tolist:[26,4,1,""],QA_util_code_tostr:[26,4,1,""]},"QUANTAXIS.QAUtil.QACsv":{QA_util_save_csv:[26,4,1,""]},"QUANTAXIS.QAUtil.QADate":{QA_util_calc_time:[26,4,1,""],QA_util_date_int2str:[26,4,1,""],QA_util_date_stamp:[26,4,1,""],QA_util_date_str2int:[26,4,1,""],QA_util_date_today:[26,4,1,""],QA_util_date_valid:[26,4,1,""],QA_util_get_date_index:[26,4,1,""],QA_util_get_index_date:[26,4,1,""],QA_util_id2date:[26,4,1,""],QA_util_is_trade:[26,4,1,""],QA_util_ms_stamp:[26,4,1,""],QA_util_realtime:[26,4,1,""],QA_util_select_hours:[26,4,1,""],QA_util_select_min:[26,4,1,""],QA_util_stamp2datetime:[26,4,1,""],QA_util_time_delay:[26,4,1,""],QA_util_time_now:[26,4,1,""],QA_util_time_stamp:[26,4,1,""],QA_util_to_datetime:[26,4,1,""]},"QUANTAXIS.QAUtil.QADate_trade":{QA_util_date_gap:[26,4,1,""],QA_util_get_last_day:[26,4,1,""],QA_util_get_next_day:[26,4,1,""],QA_util_get_real_date:[26,4,1,""],QA_util_get_real_datelist:[26,4,1,""],QA_util_get_trade_gap:[26,4,1,""],QA_util_get_trade_range:[26,4,1,""],QA_util_if_trade:[26,4,1,""],QA_util_if_tradetime:[26,4,1,""]},"QUANTAXIS.QAUtil.QADict":{QA_util_dict_remove_key:[26,4,1,""]},"QUANTAXIS.QAUtil.QAList":{QA_util_diff_list:[26,4,1,""],QA_util_multi_demension_list:[26,4,1,""]},"QUANTAXIS.QAUtil.QALogs":{QA_util_log_debug:[26,4,1,""],QA_util_log_expection:[26,4,1,""],QA_util_log_info:[26,4,1,""]},"QUANTAXIS.QAUtil.QAMail":{QA_util_send_mail:[26,4,1,""]},"QUANTAXIS.QAUtil.QAMongo":{QA_util_mongo_infos:[26,4,1,""],QA_util_mongo_initial:[26,4,1,""],QA_util_mongo_status:[26,4,1,""]},"QUANTAXIS.QAUtil.QAParameter":{ACCOUNT_EVENT:[26,1,1,""],AMOUNT_MODEL:[26,1,1,""],BROKER_EVENT:[26,1,1,""],BROKER_TYPE:[26,1,1,""],CURRENCY_TYPE:[26,1,1,""],DATASOURCE:[26,1,1,""],ENGINE_EVENT:[26,1,1,""],EVENT_TYPE:[26,1,1,""],FREQUENCE:[26,1,1,""],MARKET_ERROR:[26,1,1,""],MARKET_EVENT:[26,1,1,""],MARKET_TYPE:[26,1,1,""],ORDER_DIRECTION:[26,1,1,""],ORDER_EVENT:[26,1,1,""],ORDER_MODEL:[26,1,1,""],ORDER_STATUS:[26,1,1,""],OUTPUT_FORMAT:[26,1,1,""],RUNNING_ENVIRONMENT:[26,1,1,""],TRADE_STATUS:[26,1,1,""]},"QUANTAXIS.QAUtil.QAParameter.ACCOUNT_EVENT":{MAKE_ORDER:[26,3,1,""],SETTLE:[26,3,1,""],UPDATE:[26,3,1,""]},"QUANTAXIS.QAUtil.QAParameter.AMOUNT_MODEL":{BY_AMOUNT:[26,3,1,""],BY_PRICE:[26,3,1,""]},"QUANTAXIS.QAUtil.QAParameter.BROKER_EVENT":{DAILY_SETTLE:[26,3,1,""],LOAD_DATA:[26,3,1,""],RECEIVE_ORDER:[26,3,1,""],SETTLE:[26,3,1,""],TRADE:[26,3,1,""]},"QUANTAXIS.QAUtil.QAParameter.BROKER_TYPE":{BACKETEST:[26,3,1,""],RANODM:[26,3,1,""],REAL:[26,3,1,""],SIMULATION:[26,3,1,""]},"QUANTAXIS.QAUtil.QAParameter.CURRENCY_TYPE":{AUD:[26,3,1,""],BTC:[26,3,1,""],CAD:[26,3,1,""],EUR:[26,3,1,""],GBP:[26,3,1,""],HKD:[26,3,1,""],JPY:[26,3,1,""],RMB:[26,3,1,""],USD:[26,3,1,""]},"QUANTAXIS.QAUtil.QAParameter.DATASOURCE":{CCXT:[26,3,1,""],CHOICE:[26,3,1,""],EASTMONEY:[26,3,1,""],LOCALFILE:[26,3,1,""],MONGO:[26,3,1,""],TDB:[26,3,1,""],TDX:[26,3,1,""],THS:[26,3,1,""],TUSHARE:[26,3,1,""],WIND:[26,3,1,""]},"QUANTAXIS.QAUtil.QAParameter.ENGINE_EVENT":{BAR_SETTLE:[26,3,1,""],DAILY_SETTLE:[26,3,1,""],MARKET_INIT:[26,3,1,""],UPCOMING_DATA:[26,3,1,""],UPDATE:[26,3,1,""]},"QUANTAXIS.QAUtil.QAParameter.EVENT_TYPE":{ACCOUNT_EVENT:[26,3,1,""],BROKER_EVENT:[26,3,1,""],ENGINE_EVENT:[26,3,1,""],MARKET_EVENT:[26,3,1,""],ORDER_EVENT:[26,3,1,""],TRADE_EVENT:[26,3,1,""]},"QUANTAXIS.QAUtil.QAParameter.FREQUENCE":{CURRENT:[26,3,1,""],DAY:[26,3,1,""],FIFTEEN_MIN:[26,3,1,""],FIVE_MIN:[26,3,1,""],HOUR:[26,3,1,""],MONTH:[26,3,1,""],ONE_MIN:[26,3,1,""],QUARTER:[26,3,1,""],SIXTY_MIN:[26,3,1,""],THIRTY_MIN:[26,3,1,""],TICK:[26,3,1,""],WEEK:[26,3,1,""],YEAR:[26,3,1,""]},"QUANTAXIS.QAUtil.QAParameter.MARKET_ERROR":{ACCOUNT_EXIST:[26,3,1,""]},"QUANTAXIS.QAUtil.QAParameter.MARKET_EVENT":{QUERY_ACCOUNT:[26,3,1,""],QUERY_ASSETS:[26,3,1,""],QUERY_CASH:[26,3,1,""],QUERY_DATA:[26,3,1,""],QUERY_ORDER:[26,3,1,""]},"QUANTAXIS.QAUtil.QAParameter.MARKET_TYPE":{BOND_CN:[26,3,1,""],CRYPTOCURRENCY:[26,3,1,""],FUND_CN:[26,3,1,""],FUTURE_CN:[26,3,1,""],INDEX_CN:[26,3,1,""],OPTION_CN:[26,3,1,""],STOCKOPTION_CN:[26,3,1,""],STOCK_CN:[26,3,1,""],STOCK_HK:[26,3,1,""],STOCK_US:[26,3,1,""]},"QUANTAXIS.QAUtil.QAParameter.ORDER_DIRECTION":{BUY:[26,3,1,""],BUY_CLOSE:[26,3,1,""],BUY_OPEN:[26,3,1,""],SELL:[26,3,1,""],SELL_CLOSE:[26,3,1,""],SELL_OPEN:[26,3,1,""]},"QUANTAXIS.QAUtil.QAParameter.ORDER_EVENT":{CANCEL:[26,3,1,""],CREATE:[26,3,1,""],TRADE:[26,3,1,""]},"QUANTAXIS.QAUtil.QAParameter.ORDER_MODEL":{CLOSE:[26,3,1,""],LIMIT:[26,3,1,""],MARKET:[26,3,1,""],NEXT_OPEN:[26,3,1,""],STRICT:[26,3,1,""]},"QUANTAXIS.QAUtil.QAParameter.ORDER_STATUS":{CANCEL_ALL:[26,3,1,""],NEW:[26,3,1,""],QUEUED:[26,3,1,""],SETTLED:[26,3,1,""],SUCCESS_ALL:[26,3,1,""],SUCCESS_PART:[26,3,1,""]},"QUANTAXIS.QAUtil.QAParameter.OUTPUT_FORMAT":{DATAFRAME:[26,3,1,""],DATASTRUCT:[26,3,1,""],JSON:[26,3,1,""],LIST:[26,3,1,""],NDARRAY:[26,3,1,""],SERIES:[26,3,1,""]},"QUANTAXIS.QAUtil.QAParameter.RUNNING_ENVIRONMENT":{BACKETEST:[26,3,1,""],RANODM:[26,3,1,""],REAL:[26,3,1,""],SIMULATION:[26,3,1,""]},"QUANTAXIS.QAUtil.QAParameter.TRADE_STATUS":{FAILED:[26,3,1,""],NO_MARKET_DATA:[26,3,1,""],PRICE_LIMIT:[26,3,1,""],SUCCESS:[26,3,1,""]},"QUANTAXIS.QAUtil.QAPlot":{QA_plot_save_html:[26,4,1,""],plot_datastruct:[26,4,1,""]},"QUANTAXIS.QAUtil.QARandom":{QA_util_random_with_topic:[26,4,1,""]},"QUANTAXIS.QAUtil.QASetting":{QA_Setting:[26,1,1,""],future_ip_list:[26,5,1,""]},"QUANTAXIS.QAUtil.QASetting.QA_Setting":{change:[26,2,1,""],client:[26,3,1,""],login:[26,2,1,""]},"QUANTAXIS.QAUtil.QASql":{QA_util_sql_async_mongo_setting:[26,4,1,""],QA_util_sql_mongo_setting:[26,4,1,""]},"QUANTAXIS.QAUtil.QAText":{split_word:[26,4,1,""]},"QUANTAXIS.QAUtil.QATransform":{QA_util_to_json_from_list:[26,4,1,""],QA_util_to_json_from_numpy:[26,4,1,""],QA_util_to_json_from_pandas:[26,4,1,""],QA_util_to_list_from_numpy:[26,4,1,""],QA_util_to_list_from_pandas:[26,4,1,""],QA_util_to_pandas_from_json:[26,4,1,""],QA_util_to_pandas_from_list:[26,4,1,""]},"QUANTAXIS.QAUtil.QAWeb":{QA_Util_web_pool:[26,1,1,""],QA_util_web_ping:[26,4,1,""]},"QUANTAXIS.QAUtil.QAWeb.QA_Util_web_pool":{dynamic_optimics:[26,2,1,""],hot_update:[26,2,1,""],task_queue:[26,2,1,""]},"QUANTAXIS.QAWeb":{QA_Web:[27,0,0,"-"],chain:[27,0,0,"-"]},"QUANTAXIS.QAWeb.QA_Web":{hello:[27,4,1,""],main:[27,4,1,""],query_backtest:[27,4,1,""],query_backtest_by_:[27,4,1,""],query_backtest_history:[27,4,1,""],query_day_bfq:[27,4,1,""],query_day_hfq:[27,4,1,""],query_day_qfq:[27,4,1,""],query_k:[27,4,1,""],query_min_bfq:[27,4,1,""],query_min_qfq:[27,4,1,""],realtime:[27,4,1,""],run_backtest:[27,4,1,""],signin:[27,4,1,""],signup:[27,4,1,""],status:[27,4,1,""],test_message:[27,4,1,""]},"QUANTAXIS.QAWeb.chain":{Blockchain:[27,1,1,""],consensus:[27,4,1,""],full_chain:[27,4,1,""],mine:[27,4,1,""],new_transaction:[27,4,1,""],register_nodes:[27,4,1,""]},"QUANTAXIS.QAWeb.chain.Blockchain":{hash:[27,6,1,""],last_block:[27,3,1,""],new_block:[27,2,1,""],new_transaction:[27,2,1,""],proof_of_work:[27,2,1,""],register_node:[27,2,1,""],resolve_conflicts:[27,2,1,""],valid_chain:[27,2,1,""],valid_proof:[27,6,1,""]},QUANTAXIS:{QAARP:[15,0,0,"-"],QAAnalysis:[16,0,0,"-"],QABacktest:[17,0,0,"-"],QACmd:[18,0,0,"-"],QAData:[19,0,0,"-"],QAEngine:[21,0,0,"-"],QAFetch:[22,0,0,"-"],QAIndicator:[23,0,0,"-"],QAMarket:[24,0,0,"-"],QASU:[25,0,0,"-"],QAUtil:[26,0,0,"-"],QAWeb:[27,0,0,"-"]}},objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","method","Python method"],"3":["py","attribute","Python attribute"],"4":["py","function","Python function"],"5":["py","data","Python data"],"6":["py","staticmethod","Python static method"]},objtypes:{"0":"py:module","1":"py:class","2":"py:method","3":"py:attribute","4":"py:function","5":"py:data","6":"py:staticmethod"},terms:{"000001\u7684\u80a1\u7968\u4f1a\u53d8\u6210office\u5f3a\u5236\u8f6c\u5316\u6210\u6570\u5b571":26,"0201e20000000000":22,"0\u5e02\u573a\u662f":24,"10\u4f4d\u957f\u5ea6\u7684\u65e5\u671f":22,"10x":22,"15min":26,"1\u65e5\u524d\u7684typ":23,"1\u7684\u5e02\u573a\u662f":24,"1min":[19,22,26],"30min":26,"4\u4f4d\u5927\u5c0f\u5199\u968f\u673a":26,"4\u6570\u5b57id":26,"4cekgzn":[0,12],"5em":11,"5min":26,"60min":26,"6\u4f4d\u957f\u5ea6\u7684str":22,"\u4e00\u4e2a\u5f85\u6210\u4ea4\u961f\u5217":24,"\u4e00\u4e2a\u7edf\u4e00\u7684fetch":22,"\u4e00\u4e2a\u901a\u7528\u7684\u53ef\u4ee5\u63a5\u5165\u4e0d\u540c\u6a21\u578b\u7684\u7c7b":16,"\u4e00\u5207\u90fd\u662f\u57fa\u4e8e\u5185\u90e8\u7684account\u7684\u4fe1\u606f\u7684\u53d8\u66f4\u800c\u53d8\u66f4\u7684":15,"\u4e00\u822c\u53d614":23,"\u4e00\u822c\u662f\u7ec4\u5408":15,"\u4e0a\u4e0b\u5f71\u7ebf\u6307\u6807":23,"\u4e0a\u5f71\u7ebf":16,"\u4e0a\u6d77\u4e94\u6863\u5373\u6210\u5269\u64a4":24,"\u4e0a\u6d77\u4e94\u6863\u5373\u6210\u8f6c\u9650\u4ef7":24,"\u4e0a\u6d77\u9650\u4ef7\u59d4\u6258":24,"\u4e0b\u4e00\u4e2abar\u7684\u5f00\u76d8\u4ef7\u6210\u4ea4":26,"\u4e0b\u5f71\u7ebf":16,"\u4e0d\u518d\u52a8\u6001\u8ba1\u7b97\u8d26\u6237\u80a1\u7968":15,"\u4e0d\u518d\u8ba1\u7b97\u4ea4\u6613\u5bf9\u7167\u660e\u7ec6\u8868":15,"\u4e0d\u518d\u8ba1\u7b97\u5f53\u524d\u6301\u4ed3":15,"\u4e0d\u518d\u8ba1\u7b97\u603b\u8d44\u4ea7":15,"\u4e0d\u590d\u6743":22,"\u4e0d\u63a8\u8350":26,"\u4e0d\u66f4\u65b0\u53ef\u5356\u6570\u91cf":24,"\u4e0e\u5e02\u573a\u57fa\u51c6\u6536\u76ca\u65e0\u5173\u7684\u8d85\u989d\u6536\u76ca\u7387":15,"\u4e25\u683c\u8ba2\u5355":26,"\u4e2d\u7b7e\u67e5\u8be2":24,"\u4e2d\u7ea7":23,"\u4e2d\u95f4\u8981\u6709\u7a7a\u683c":26,"\u4e34\u65f6\u6263\u9664\u8d44\u4ea7":26,"\u4e3a\u4e86\u662f\u4e0d\u963b\u585e\u8fdb\u7a0b":26,"\u4e3a\u771f\u5b9e\u6ce2\u5e45":23,"\u4e3b\u52a8\u64a4\u5355":26,"\u4e3b\u8425\u5229\u6da6":22,"\u4e3b\u8425\u6210\u672c":22,"\u4e3b\u8425\u6536\u5165":22,"\u4e3b\u8425\u6784\u6210":22,"\u4e3b\u8425\u6784\u6210\u5206\u6790":22,"\u4e3b\u8425\u8303\u56f4":22,"\u4e56\u79bb\u7387":23,"\u4e5f\u53eb\u53d8\u52a8\u901f\u7387\u7ebf":23,"\u4e5f\u53ef\u4ee5\u662f\u7b80\u5199":22,"\u4e70\u5165":26,"\u4e70\u5165\u4fe1\u53f7\u53c2\u8003":23,"\u4e70\u5356\u5224\u65ad\u901a\u8fc7\u4ea4\u6613\u524d\u7f6e\u53d1\u9001\u7ed9\u5bf9\u5e94\u7684broker":17,"\u4e70\u5356\u539f\u5219":23,"\u4ea4\u6613":26,"\u4ea4\u6613\u524d\u7f6e":24,"\u4ea4\u6613\u524d\u7f6e\u4e8b\u4ef6":26,"\u4ea4\u6613\u5386\u53f2":15,"\u4ea4\u6613\u5386\u53f2\u7684tabl":15,"\u4ea4\u6613\u5bf9\u7167\u8868":15,"\u4ea4\u6613\u65e5":26,"\u4ea4\u6613\u72b6\u6001\u8fd4\u56de\u503c":26,"\u4ea4\u6613\u91cf\u8fc7\u5927\u7b49\u7b49":26,"\u4ea7\u54c1":22,"\u4ea7\u751f\u65b0\u7684\u4e70\u5356\u5224\u65ad":17,"\u4ec5\u7528\u4e8e\u8bad\u7ec3\u6d4b\u8bd5":26,"\u4ec5\u8d1f\u8d23\u4e00\u4e2a\u65e0\u72b6\u6001\u7684\u6267\u884c\u5c42":24,"\u4ec5\u9002\u7528\u4e8eseri":23,"\u4ec5\u9650\u56de\u6d4b":26,"\u4eca\u65e5\u632f\u5e45":23,"\u4eca\u65e5\u6700\u4f4e\u4e0e\u6628\u6536\u5dee\u4ef7\u4e2d\u7684\u6700\u5927\u503c":23,"\u4eca\u65e5\u6700\u9ad8\u4e0e\u6628\u6536\u5dee\u4ef7":23,"\u4ece\u800c\u6d4b\u51fa\u80a1\u4ef7\u7684\u9707\u8361\u5e45\u5ea6":23,"\u4ee3\u7801":16,"\u4ee54\u4e2a0\u5f00\u5934":27,"\u4ee5\u514d\u76f4\u63a5\u88ab\u53d8\u6210\u4e86\u65f6\u95f4\u6233":26,"\u4ee5\u53ca\u7ec4\u5408\u7ba1\u7406":15,"\u4f1a\u4ea7\u751f\u591a\u5c11\u7684\u8d85\u989d\u62a5\u916c":17,"\u4f1a\u51fa\u73b0socket":22,"\u4f1a\u521b\u5efa\u4e00\u4e2adownload":22,"\u4f1a\u81ea\u52a8\u53bb\u91cd":19,"\u4f1a\u901a\u77e5market\u4ea4\u6613\u524d\u7f6e":17,"\u4f5c\u4e3a\u4e00\u4e2aview\u5b58\u5728":15,"\u4f73\u5e86\u6307\u6807":23,"\u4f7f\u5f97":27,"\u4f7f\u7528\u6570\u636e\u5e93\u6570\u636e\u8fdb\u884c\u590d\u6743":19,"\u4f7f\u7528\u7f51\u7edc\u4e2d\u6700\u957f\u7684\u94fe":27,"\u4f7f\u7528\u7f51\u7edc\u6570\u636e\u8fdb\u884c\u590d\u6743":19,"\u4f7f\u7528jieba\u5206\u8bcd":26,"\u4f7f\u7528threading\u91cc\u9762\u7684\u5ef6\u65f6":26,"\u4fe1\u606f\u5c06\u52a0\u5165\u5230\u4e0b\u4e00\u4e2a\u5f85\u6316\u7684\u533a\u5757\u4e2d":27,"\u4fe1\u606f\u6bd4\u7387":17,"\u4fe1\u606f\u7c7b":15,"\u503a\u5238":24,"\u504f\u5ea6":15,"\u5141\u8bb8\u65e0\u4ed3\u4f4d\u7684\u65f6\u5019\u5356\u51fa\u8bc1\u5238":24,"\u5143":22,"\u5171\u8bc6\u7b97\u6cd5\u89e3\u51b3\u51b2\u7a81":27,"\u5176\u4e2d":26,"\u5176\u4ed6\u65f6\u5019":26,"\u5176\u4f5c\u7528\u4e0d\u5927":23,"\u5177\u4f53\u8ba1\u7b97\u65b9\u5f0f\u4e3a":17,"\u5177\u4f53\u8ba1\u7b97\u65b9\u6cd5\u4e3a":17,"\u518d\u6839\u636e\u8fd4\u56de\u7684\u4fe1\u606f":24,"\u51c0\u5229\u6da6":15,"\u51fd\u6570\u91cd\u65b0\u83b7\u53d6":22,"\u5206\u5e03\u968f\u673a\u751f\u6210\u884c\u60c5":26,"\u5206\u6790ddi\u67f1\u72b6\u7ebf":23,"\u5206\u949f\u7ebf":[22,26],"\u5206\u949f\u7ebf\u56de\u6d4b\u7684\u65f6\u5019\u7684gap":26,"\u5219\u4f7f\u7528\u7b2c\u4e00\u4e2aportfolio\u6765\u521b\u5efa\u4e00\u4e2aaccount":15,"\u5219\u521b\u5efa\u4e00\u4e2aportfolio":15,"\u521a\u521b\u5efa\u8ba2\u5355\u7684\u65f6\u5019":26,"\u521b\u5efa\u80a1\u7968\u5206\u949f\u7ebf\u7684index":26,"\u521b\u5efa\u80a1\u7968\u7684\u5c0f\u65f6\u7ebf\u7684index":26,"\u521b\u5efa\u8ba2\u5355":26,"\u521d\u59cb\u5316\u8ba2\u5355":26,"\u5224\u65ad\u662f\u5426\u662f\u4ea4\u6613\u65e5":26,"\u5229\u6da6":15,"\u5229\u6da6\u6bd4\u4f8b":22,"\u524d\u590d\u6743":22,"\u5269\u4e0b\u7684\u5168\u90e8\u60f0\u6027\u8ba1\u7b97":15,"\u52a0\u5bc6\u8d27\u5e01\u5e02\u573a":[24,26],"\u52a0\u5bc6\u8d27\u5e01\u5e02\u573a\u4e0d\u5141\u8bb8\u5356\u7a7a":24,"\u52a8\u6001\u4e70\u5356\u6c14\u6307\u6807":23,"\u52a8\u6001\u8ba1\u7b97\u6210\u4ea4\u91cf":26,"\u52a8\u91cf\u7ebf":23,"\u5305\u542b\u96c6\u5408\u7ade\u4ef7":22,"\u533a\u57df":22,"\u5355\u65e5\u6700\u5927\u6301\u4ed3":17,"\u5355\u6b21\u4ea4\u6613\u6536\u76ca":17,"\u5355\u7ebf\u7a0b\u7684\u5b9e\u65f6\u83b7\u53d6":22,"\u5356\u51fa":26,"\u5356\u51fa\u4fe1\u53f7\u53c2\u8003":23,"\u5356\u7a7a\u7684\u89c4\u5219\u662f":24,"\u5361\u739b\u6bd4\u7387":15,"\u5373\u65f6\u66f4\u65b0":24,"\u5373\u65f6\u66f4\u65b0\u6301\u4ed3\u548c\u53ef\u5356":24,"\u5386\u53f2\u9010\u7b14\u6210\u4ea4":22,"\u53bb\u91cd":15,"\u53c2\u6570":23,"\u53c2\u8003\u6807\u51c6\u5e74\u5316\u6536\u76ca":17,"\u53c2\u8003\u6807\u51c6\u6bcf\u65e5\u6536\u76ca":17,"\u53c2\u8003\u6807\u51c6\u6bcf\u65e5\u6536\u76ca\u7684\u65b9\u5dee":17,"\u53ca\u5728bar\u7684\u6536\u76d8\u65f6\u7684\u4ef7\u683c":26,"\u53ca\u65f6\u66f4\u65b0\u53ef\u7528\u8d44\u91d1":24,"\u53cat":16,"\u53cd\u5f39\u673a\u7387\u5927":23,"\u53d1\u9001\u7ed9\u76f8\u5e94\u7684marker_brok":24,"\u53d6\u6570\u636e\u7684\u771f\u5b9e\u533a\u95f4":26,"\u53d8\u52a8\u7387\u6307\u6807":23,"\u53d8\u52a8\u901f\u7387\u7ebf":23,"\u53ea\u7ef4\u62a4":15,"\u53ef\u4ee5\u53bb\u8861\u91cf\u98ce\u9669":15,"\u53ef\u4ee5\u88ab\u4e8b\u4ef6\u9a71\u52a8":15,"\u53ef\u4ee5\u8c03\u6574":15,"\u53ef\u5356":17,"\u53ef\u5356\u80a1\u4efd":26,"\u53ef\u5356\u80a1\u7968":15,"\u53ef\u64a4\u5355":24,"\u53ef\u7528\u73b0\u91d1":[15,26],"\u53ef\u7528\u73b0\u91d1\u7b49":17,"\u53ef\u7528\u7684market_brok":24,"\u53ef\u7533\u8d2d\u65b0\u80a1\u67e5\u8be2":24,"\u53ef\u878d\u8bc1\u5238":24,"\u53ef\u8fde\u63a5\u5230\u591a\u4e2abroker\u4e2d":24,"\u53ef\u9009":26,"\u540c\u65f6\u53d1\u8fdb\u53bb\u4e24\u4e2a\u51fd\u6570":26,"\u540c\u6b65\u53ef\u7528\u8d44\u91d1":15,"\u540e\u590d\u6743":22,"\u5411\u540e\u63a8":26,"\u5426\u5219\u4e3afals":27,"\u5426\u5219\u8fd4\u56de0\u7684n\u65e5\u7d2f\u548c":23,"\u548c\u6628\u6536":23,"\u548cdate":26,"\u56de\u6863\u673a\u7387\u5927":23,"\u56de\u6d4b":[15,24,26],"\u56de\u6d4b\u4ea4\u6613\u65e5\u6570\u91cf":17,"\u56de\u6d4b\u53bb\u8ba1\u7b97\u8fd9\u6bb5\u65f6\u95f4\u7684\u5404\u4e2a\u8d26\u6237\u6536\u76ca":17,"\u56de\u6d4b\u76d8":24,"\u56de\u6d4b\u8d77\u59cb\u4ea4\u6613\u65e5\u7684\u65e0\u98ce\u9669\u5229\u7387":17,"\u56e0\u4e3a\u6709\u65f6\u5019\u5728csv\u7b49\u8f6c\u6362\u7684\u65f6\u5019":26,"\u5728\u5b9e\u76d8\u4e2d":24,"\u5728\u62ff\u5230\u5e02\u573a\u6570\u636e\u540e\u5bf9\u4e8e\u8ba2\u5355\u7684\u64ae\u5408\u5224\u65ad":24,"\u5728portfolio\u4e2d":15,"\u5730\u57df":19,"\u57fa\u51c6\u7ec4\u5408\u7684\u5e74\u5316\u6536\u76ca":15,"\u57fa\u51c6\u7ec4\u5408\u7684\u6536\u76ca\u767e\u5206\u6bd4\u8ba1\u7b97":15,"\u57fa\u51c6\u7ec4\u5408\u7684\u884c\u60c5\u6570\u636e":15,"\u57fa\u51c6\u7ec4\u5408\u7684\u8d26\u6237\u8d44\u4ea7\u961f\u5217":15,"\u57fa\u91d1":[24,26],"\u590f\u666e\u6bd4\u4f8b":15,"\u590f\u666e\u6bd4\u7387":[15,17],"\u591a\u5934\u5e73\u65e7\u4ed3":26,"\u591a\u5e73":26,"\u591a\u5f00":26,"\u591a\u7a7a\u6307\u6807":23,"\u591a\u7ebf\u7a0b":24,"\u591a\u8d26\u6237":15,"\u5927\u76d8\u84dd\u7b79":22,"\u5927\u90e8\u5206\u65f6\u95f4\u90fd\u4f9d\u8d56\u5b50\u7ebf\u7a0b\u4e3b\u52a8\u67e5\u8be2":24,"\u5929\u6570":23,"\u5982\u679c\u51fa\u73b0\u7f51\u7edc\u95ee\u9898":22,"\u5982\u679c\u51fa\u9519\u6bd4\u5982\u53ea\u83b7\u53d6\u4e86\u4e00\u5929":22,"\u5982\u679c\u5df2\u6709\u4e00\u4e2a\u6216\u591a\u4e2aportfolio":15,"\u5982\u679c\u5f53\u524duser\u4e2d\u6ca1\u6709\u521b\u5efaportfolio":15,"\u5982\u679c\u8fdc\u79bb\u5e73\u5747\u7ebf":23,"\u5982\u679c\u94fe\u88ab\u53d6\u4ee3\u8fd4\u56de":27,"\u5982\u679c\u9700\u8981\u521b\u5efa\u4e00\u4e2a":26,"\u5982\u679ctyp":23,"\u59d4\u6258\u6210\u529f":26,"\u5a01\u5ec9\u6307\u6807":23,"\u5a01\u5ec9sma\u7b97\u6cd5":23,"\u5b83\u53cd\u5e94\u5f53\u65e5\u6536\u76d8\u4ef7\u4e0e\u4e00\u6bb5\u65f6\u95f4\u5185\u5e73\u5747\u6536\u76d8\u4ef7\u7684\u5dee\u79bb\u503c":23,"\u5b8c\u5168\u4ea4\u6613":26,"\u5b8c\u5168\u6210\u4ea4":26,"\u5b9a\u4e49\u4e00\u4e9b\u53ef\u4ee5\u6269\u5c55\u7684\u6570\u636e\u7ed3\u6784":19,"\u5b9a\u70b9\u524d\u590d\u6743":22,"\u5b9a\u70b9\u540e\u590d\u6743":22,"\u5b9e\u4f53\u90e8\u5206":16,"\u5b9e\u65f6\u6a21\u62df\u76d8":24,"\u5b9e\u65f6\u9010\u7b14\u6210\u4ea4":22,"\u5b9e\u76d8":[15,24,26],"\u5b9e\u76d8\u91cc\u9762\u662f\u4e94\u6863\u5269\u4f59\u6700\u4f18\u6210\u4ea4\u4ef7":26,"\u5bf9\u4e8e\u4e0d\u540c\u7684\u5e02\u573a\u89c4\u5219":24,"\u5bf9\u4e8eaccount\u7684\u6307\u6807":15,"\u5bf9\u4e8edataframe\u7684\u5e94\u7528\u8bf7\u4f7f\u7528qa_indicator_macd":23,"\u5bf9\u4e8eportfolio\u800c\u8a00":15,"\u5bf9order":24,"\u5c06\u6240\u6709\u6caa\u6df1\u80a1\u7968\u4ece\u6570\u5b57\u8f6c\u5316\u52306\u4f4d\u7684\u4ee3\u7801":26,"\u5c06\u8f93\u5165\u7684\u8bed\u53e5\u5206\u8bcd":26,"\u5c06list\u4fdd\u5b58\u6210csv":26,"\u5c0f\u76d8\u80a1":22,"\u5c1d\u8bd5\u518d\u6b21\u83b7\u53d6":22,"\u5c31\u5f88\u53ef\u80fd\u5411\u5e73\u5747\u7ebf\u56de\u5f52":23,"\u5c3e\u657001":26,"\u5c3e\u657002":26,"\u5c3e\u657003":26,"\u5c55\u793adatastruct":19,"\u5c5e\u4e8e\u8d85\u4e70\u8d85\u5356\u7c7b\u6307\u6807":23,"\u5cf0\u5ea6\u7b49":15,"\u5df2\u64a4\u5355":26,"\u5e02\u4ef7\u5355":26,"\u5e02\u4ef7\u59d4\u6258":24,"\u5e02\u573a":[22,26],"\u5e02\u573a\u4e0d\u4f1a\u8fd4\u56de\u4e00\u4e2a\u66f4\u65b0\u7684\u8ba2\u5355\u7c7b\u56de\u6765":24,"\u5e02\u573a\u79cd\u7c7b":26,"\u5e03\u6797\u7ebf":23,"\u5e73\u5747\u76c8\u4e8f\u6bd4":15,"\u5e73\u5747\u7ebf\u5dee":23,"\u5e73\u5747\u7edd\u5bf9\u504f\u5dee":23,"\u5e74\u5316\u6536\u76ca":15,"\u5e74\u5316\u6807\u51c6\u5dee":17,"\u5e76\u4e14\u7acb\u523b\u7ed3\u8f6c":16,"\u5e76\u5c06\u5176\u63d2\u5165\u4ed6\u5df2\u6709\u7684\u6570\u636e\u4e2d":17,"\u5e76\u7528\u6b64portfolio\u521b\u5efa\u4e00\u4e2aaccount":15,"\u5e76\u7ed9\u51fa\u7efc\u5408\u7684\u6700\u7ec8\u7ed3\u679c":17,"\u5e95\u4e0b\u6ce8\u518c\u7684\u7b56\u7565strategy\u6839\u636e\u65b0\u7684\u5e02\u573a\u51fd\u6570":17,"\u5f00\u59cb\u65e5\u671f":22,"\u5f15\u5165\u65f6\u95f4\u8f74\u73af\u5883":17,"\u5f15\u64ce\u4e8b\u4ef6":26,"\u5f3a\u529b\u538b\u529b":23,"\u5f3a\u529b\u652f\u6491":23,"\u5f52\u5c5e\u4e8emarket\u524d\u7f6e":24,"\u5f53\u4e00\u4e2a\u8ba2\u5355\u53d1\u9001\u51fa\u53bb\u7684\u65f6\u5019":24,"\u5f53\u524dbar\u7684\u6700\u4f4e\u4ef7\u5356\u51fa":26,"\u5f53\u5929\u65e0\u4ea4\u6613\u6570\u636e":26,"\u5f53\u6211\u4eec\u53ea\u6709\u4e00\u4e2a\u6210\u4ea4\u8bb0\u5f55\u7684\u65f6\u5019":16,"\u5f53\u65e5\u4e4b\u524d\u865a\u62df\u8d26\u6237\u6700\u9ad8\u4ef7\u503c":17,"\u5f53\u65e5\u4e70\u5165":24,"\u5f53\u65e5\u5356\u51fa":24,"\u5f53\u65e5\u59d4\u6258":24,"\u5f53\u65e5\u6210\u4ea4":24,"\u5f53\u65e5\u7684\u4e70\u5165":24,"\u5f53\u65e5\u7684\u5356\u51fa":24,"\u5f53start":26,"\u5f97\u5230\u4e0a\u4e00\u4e2a":26,"\u5f97\u5230\u4e0b\u4e00\u4e2a":26,"\u603b\u4e8f\u635f":15,"\u603b\u76c8\u5229":15,"\u6062\u590d\u4e34\u65f6\u8d44\u4ea7":26,"\u60f0\u6027\u8ba1\u7b97":15,"\u6210\u4ea4\u91cf":23,"\u6210\u529f\u4ea4\u6613":26,"\u6210\u672c\u6bd4\u4f8b":22,"\u6211\u4eec\u4f1a\u521b\u5efa\u4e00\u4e2a\u8d26\u6237\u5355\u5143":16,"\u6211\u4eec\u5e0c\u671b\u901a\u8fc7cookie\u6765\u63a7\u5236account_unit":15,"\u6216\u8005\u662f\u4e00\u4e2a\u5e02\u573a\u4fe1\u606f\u6765\u8fdb\u884c\u5224\u65ad":24,"\u6240\u6709\u6210\u4ea4\u8bb0\u5f55\u5206\u6790":16,"\u624b":23,"\u6253\u5370\u51faaccount\u7684\u5185\u5bb9":15,"\u6267\u884c\u73af\u5883":26,"\u6279\u91cf\u4ea4\u6613":24,"\u6295\u8d44\u7ec4\u5408\u6536\u76ca\u548c\u4e0b\u884c\u98ce\u9669\u6bd4\u503c":15,"\u62ff\u5230\u6574\u4e2aportfolio\u7684\u53ef\u7528\u8d44\u91d1":15,"\u6301\u4ed3":15,"\u6301\u4ed3\u5206\u6790":15,"\u6301\u4ed3\u65f6\u95f4\u5360\u6bd4":15,"\u6301\u4ed3\u9762\u677f":15,"\u6307\u6570":[15,19,24,26],"\u6307\u6570\u5206\u949f\u7ebf":22,"\u6307\u6570\u5e73\u5747\u7ebf":23,"\u6307\u6570\u65e5\u7ebf":22,"\u6307\u6807":23,"\u6307\u6807\u8bf4\u660e":23,"\u6309\u56fa\u5b9a\u6210\u5bb6\u91cf\u4e0b\u5355":26,"\u6309\u5e02\u503c\u548c\u4fdd\u8bc1\u91d1\u6bd4\u4f8b\u9650\u5236\u7b97":24,"\u6309\u7167\u79fb\u52a8\u5e73\u5747\u7ebf\u539f\u7406":23,"\u6309\u7b97\u6cd5":26,"\u6309bar\u957f\u5ea6\u63a8\u7b97\u6570\u636e":22,"\u63a5\u53d7\u4ea4\u6613\u7ed3\u679c\u6570\u636e":15,"\u63a5\u6536\u65b0\u7684\u6570\u636e":15,"\u63cf\u8ff0\u7b56\u7565\u53ef\u80fd\u51fa\u73b0\u7684\u6700\u7cdf\u7cd5\u7684\u60c5\u51b5":17,"\u64a4\u5355":26,"\u64ae\u5408\u6210\u4ea4\u7684\u4efb\u52a1":26,"\u6536\u5165\u6bd4\u4f8bcbbl":22,"\u6536\u76ca":17,"\u6536\u76ca\u6027\u7684\u5305\u62ec\u5e74\u5316\u6536\u76ca\u7387":15,"\u6536\u76d8\u4ef7":23,"\u6536\u76d8\u5355":26,"\u6570\u636e\u5e93":22,"\u6570\u636e\u6765\u6e90":26,"\u6570\u636e\u683c\u5f0f\u6700\u597d\u662f":26,"\u6587\u4ef6\u5939":22,"\u6587\u4ef6\u7684\u5730\u5740":25,"\u6587\u672c\u5206\u8bcd":26,"\u65b0\u80a1\u7533\u8d2d\u989d\u5ea6\u67e5\u8be2":24,"\u65b9\u4fbf\u5e8f\u5217\u5316":19,"\u65b9\u5411\u6807\u51c6\u79bb\u5dee\u6307\u6570":23,"\u65b9\u6cd5":15,"\u65e0\u98ce\u9669\u6536\u76ca":17,"\u65e5\u671f\u5411\u524d\u8fed\u4ee3":26,"\u65e5\u671f\u5411\u540e\u8fed\u4ee3":26,"\u65e5\u671f\u662f\u5426\u4ea4\u6613":26,"\u65e5\u7ebf":[22,26],"\u65f6":23,"\u65f6\u95f4":16,"\u65f6\u95f4\u662f\u5426\u4ea4\u6613":26,"\u660e\u65e5\u6da8\u505c\u4ef7":19,"\u660e\u65e5\u8dcc\u505c\u4ef7":19,"\u662f\u4e00\u4e2a\u5355\u72ec\u7684code":22,"\u662f\u4e00\u4e2a\u98ce\u9669\u63d2\u4ef6":15,"\u662f\u4e0a\u4e00\u4e2a\u5757\u7684\u8bc1\u660e":27,"\u662f\u4ece\u79fb\u52a8\u5e73\u5747\u7ebf\u539f\u7406\u6d3e\u751f\u51fa\u6765\u7684\u4e00\u79cd\u5206\u6790\u6307\u6807":23,"\u662f\u5426\u5141\u8bb8\u5356\u7a7a":15,"\u662f\u5426\u5141\u8bb8t0\u7ed3\u7b97":15,"\u662f\u5426hash":27,"\u662f\u5728\u5f53\u524dbar\u7684\u6700\u9ad8\u4ef7\u4e70\u5165":26,"\u662f\u5f53\u524d\u7684\u8bc1\u660e":27,"\u662fquantaxis\u7684\u6700\u5c0f\u4e0d\u53ef\u5206\u5272\u5355\u5143\u4e4b\u4e00":15,"\u6682\u65f6\u8fd8\u662f\u91c7\u7528\u591a\u7ebf\u7a0bengine\u6a21\u5f0f":24,"\u66f4\u6362ip\u5373\u53ef":22,"\u66f4\u65b0\u6301\u4ed3":[17,24],"\u6700\u4f4e\u4ef7":23,"\u6700\u4f4e\u4ef7\u7684\u7edd\u5bf9\u503c\u7684\u8f83\u5927\u503c":23,"\u6700\u5927\u56de\u64a4":[15,17],"\u6700\u5927\u56de\u64a4\u6bd4\u4f8b":15,"\u6700\u5927\u8fde\u7eed\u4e8f\u635f\u6b21\u6570":15,"\u6700\u5927\u8fde\u7eed\u76c8\u5229\u6b21\u6570":15,"\u6700\u65b0\u603b\u8d44\u4ea7":15,"\u6700\u65b0\u6301\u4ed3":15,"\u6700\u65b0\u73b0\u91d1":15,"\u6700\u9ad8\u4ef7":23,"\u6700\u9ad8\u4ef7\u7684\u7edd\u5bf9\u503c\u7684\u8f83\u5927\u503c\u548c\u6628\u6536":23,"\u6709\u4e09\u7c7b\u8f93\u5165":15,"\u6709\u52a0\u8f7d\u6570\u636e\u7684\u4efb\u52a1":26,"\u6709\u6548\u5e74\u5316\u6536\u76ca\u7387":15,"\u6709\u65b0\u7684\u5e02\u573a\u6570\u636e":17,"\u6709\u65f6\u5019":26,"\u670d\u52a1\u5668\u62d2\u7edd":22,"\u670d\u52a1\u5668\u64a4\u5355":26,"\u671f\u6743":24,"\u671f\u6743\u5e02\u573a\u5141\u8bb8\u5356\u7a7a":24,"\u671f\u8d27":[15,24,26],"\u671f\u8d27\u4ee3\u7801list":22,"\u671f\u8d27\u5386\u53f2\u6210\u4ea4\u5206\u7b14":22,"\u671f\u8d27\u5b9e\u65f6\u4ef7\u683c":22,"\u671f\u8d27\u5e02\u503c":15,"\u671f\u8d27\u6570\u636e":22,"\u672a\u5b8c\u5168\u4ea4\u6613":26,"\u672a\u5b8c\u5168\u6210\u529f":26,"\u672a\u6210\u4ea4":26,"\u672c\u51fd\u6570\u4e0d\u505a\u5904\u7406":22,"\u672c\u6b21\u4fee\u6b63\u4e3b\u8981\u662f\u5bf9\u4e8e\u8fd4\u56de\u503c\u7684\u4f18\u5316":23,"\u6765\u6e90":22,"\u677f\u5757\u6570\u636e":22,"\u67e5\u627e\u4e00\u4e2a":27,"\u67e5\u8be2\u7684\u7ea7\u522b":26,"\u6807\u51c6\u683c\u5f0f\u662fnumpi":24,"\u6839\u636eosc\u7684\u503c\u53ef\u63a8\u65ad\u4ef7\u683c\u7684\u8d8b\u52bf":23,"\u6982\u5ff5":19,"\u6a21\u62df":26,"\u6a21\u7cca\u67e5\u8be2":26,"\u6b21\u6570\u7684\u9891\u6b21\u76f4\u65b9\u56fe":17,"\u6b21\u65b0\u80a1":22,"\u6b63\u5219\u5339\u914d":26,"\u6b63\u53d8\u8d1f":23,"\u6b7b\u4ea1":26,"\u6bcf\u65e5\u4ea4\u6613\u7ed3\u7b97\u65f6\u7684\u6301\u4ed3\u8868":15,"\u6bcf\u65e5\u4ea4\u6613\u7ed3\u7b97\u65f6\u7684\u73b0\u91d1\u8868":15,"\u6bcf\u65e5\u7ed3\u7b97":26,"\u6bcf\u6b21\u4ea4\u6613\u7684pivot\u8868":15,"\u6bd4\u5982":22,"\u6bd4\u598230\u5206\u523059\u5206":26,"\u6bd4\u5982\u4e70\u5356\u4ef7\u683c\u8d85\u8fc7\u6da8\u8dcc\u505c\u4ef7\u683c\u8303\u56f4":26,"\u6bd4\u5982\u65e9\u4e0a9\u70b9\u523011\u70b9":26,"\u6bd4\u5982\u8bf4":26,"\u6bd4\u7279\u5e01":26,"\u6bdb\u5229\u7387":22,"\u6c42\u771f\u5b9e\u6ce2\u5e45\u7684n\u65e5\u79fb\u52a8\u5e73\u5747":23,"\u6ce2\u52a8\u7387":15,"\u6da8\u505c\u4ef7":19,"\u6da8\u8dcc\u505c\u9650\u5236":26,"\u6df1\u5733\u4e94\u6863\u5373\u6210\u5269\u64a4":24,"\u6df1\u5733\u5168\u989d\u6210\u4ea4\u6216\u64a4\u9500":24,"\u6df1\u5733\u5373\u65f6\u6210\u4ea4\u5269\u4f59\u64a4\u9500":24,"\u6df1\u5733\u5bf9\u65b9\u6700\u4f18\u4ef7\u683c":24,"\u6df1\u5733\u672c\u65b9\u6700\u4f18\u4ef7\u683c":24,"\u6df1\u5733\u9650\u4ef7\u59d4\u6258":24,"\u6e05\u7a7a\u8ba2\u5355\u7c3f":24,"\u6e2f\u80a1":26,"\u7011\u5e03\u7ebf":23,"\u7136\u540e\u6309\u751f\u6210\u5668\u5c06\u6570\u636e\u8fed\u4ee3\u63d2\u5165\u56de\u6d4b\u7684broker":17,"\u73b0\u5728\u7684\u8fd4\u56de\u503c\u4f1a\u5e26\u4e0a\u539f\u5148\u8f93\u5165\u7684\u7d22\u5f15index":23,"\u73b0\u91d1":15,"\u73b0\u91d1\u7684tabl":15,"\u751f\u6210\u5757\u7684":27,"\u751f\u6210\u6210\u4ea4\u4fe1\u606f":24,"\u751f\u6210\u65b0\u4ea4\u6613\u4fe1\u606f":27,"\u751f\u6210\u65b0\u5757":27,"\u751f\u6210\u8ba2\u5355":15,"\u751f\u6210account\u968f\u673a\u503c":26,"\u7528\u4e8e\u5408\u5e76\u4e00\u4e2alist\u91cc\u9762\u7684\u591a\u4e2adatastruct":19,"\u7528\u4e8e\u63a5\u53d7\u8ba2\u5355":24,"\u7528\u4e8e\u66f4\u65b0\u8d26\u6237":15,"\u7528\u6765\u6d4b\u91cf\u8d44\u4ea7\u7684\u98ce\u9669\u6027":17,"\u7528account\u7684cookie\u6765\u7ba1\u7406\u63a7\u5236account":15,"\u7528set":15,"\u7528sleep\u5c31\u4f1a\u963b\u585e\u6389\u7b2c\u4e8c\u4e2a\u8fdb\u7a0b":26,"\u7531\u7ea2\u53d8\u7eff":23,"\u7531\u7eff\u53d8\u7ea2":23,"\u7684\u4ea4\u6613\u5165\u53e3":16,"\u7684\u5e74\u5316\u5747\u503c":17,"\u76d8\u524d":22,"\u76ee\u524d\u5e02\u4ef7\u5355\u5728\u56de\u6d4b\u4e2d\u662fbar\u7684\u5f00\u76d8\u4ef7":26,"\u76f8\u4e92\u8f6c\u6362":19,"\u76f8\u5bf9\u5f3a\u5f31\u6307\u6807rsi1":23,"\u7a7a\u5934\u5e73\u65e7\u4ed3":26,"\u7a7a\u5e73":26,"\u7a7a\u5f00":26,"\u7b2c\u4e00\u4e2a\u51fd\u6570\u9700\u8981\u5ef6\u65f6":26,"\u7b2c\u4e00\u4e2a\u53c2\u6570\u662flist":26,"\u7b2c\u4e09\u4e2a\u53c2\u6570\u662f\u884c\u7684\u540d\u79f0":26,"\u7b2c\u4e09\u4e2a\u53c2\u6570towards\u662f\u8868\u793a\u5411\u524d":26,"\u7b2c\u4e8c\u4e2a\u4e0d\u9700\u8981\u7684\u8bdd":26,"\u7b2c\u4e8c\u4e2a\u53c2\u6570\u662f\u8981\u4fdd\u5b58\u7684\u540d\u5b57":26,"\u7b2c\u56db\u4e2a\u662f\u4fdd\u5b58\u4f4d\u7f6e":26,"\u7b49\u5f85\u4ea4\u6613":26,"\u7b56\u7565\u521d\u59cb\u4ef7\u503c":17,"\u7b56\u7565\u5e74\u5316\u6536\u76ca":17,"\u7b56\u7565\u5e74\u5316\u6536\u76ca\u7387":17,"\u7b56\u7565\u5f53\u65e5\u4ef7\u503c":17,"\u7b56\u7565\u6536\u76ca\u6ce2\u52a8\u7387":17,"\u7b56\u7565\u6700\u7ec8\u4ef7\u503c":17,"\u7b56\u7565\u6bcf\u65e5\u6536\u76ca":17,"\u7b56\u7565\u6bcf\u65e5\u6536\u76ca\u4e0e\u53c2\u8003\u6807\u51c6\u6bcf\u65e5\u6536\u76ca\u7684\u534f\u65b9\u5dee":17,"\u7b56\u7565\u6bcf\u65e5\u6536\u76ca\u7684\u5e74\u5316\u6807\u51c6\u5dee":17,"\u7b80\u5355\u7684\u5de5\u4f5c\u91cf\u8bc1\u660e":27,"\u7b97\u6cd5":23,"\u7b97\u9996\u5c3e":26,"\u7c7b\u4f3c\u4e8epd":19,"\u7d22\u63d0\u8bfa\u6bd4\u7387":15,"\u7ea6\u5b9a\u65f6\u95f4\u7684\u8303\u56f4":26,"\u7ec4\u5408\u6210\u6700\u4f18\u7684\u6295\u8d44\u7ec4\u5408\u7684\u91cf":15,"\u7ec4\u5408\u7684\u7cfb\u7edf\u6027\u98ce\u9669":15,"\u7ecf\u8425\u8bc4\u8ff0":22,"\u7ed3\u675f\u65e5\u671f":22,"\u7ed3\u675f\u8fd9\u4e00\u4e2abar\u7684\u6240\u6709\u4ea4\u6613":17,"\u7ed3\u7b97":24,"\u7ed9\u51fa\u4ea4\u6613\u5177\u4f53\u65f6\u95f4":26,"\u7edf\u8ba1\u6bcf\u4e00\u4e2a\u65f6\u95f4\u70b9\u7684\u65f6\u5019\u7684cash\u603b\u548c":15,"\u7efc\u5408\u6027\u6307\u6807\u4e3b\u8981\u5305\u62ec\u98ce\u9669\u6536\u76ca\u6bd4":15,"\u7efc\u5408\u751f\u6210\u4fe1\u53f7":17,"\u7f13\u5b58\u65b0\u6570\u636e\u7684market_data":15,"\u7f8e\u80a1":26,"\u800c\u5f53\u5929\u505c\u724c":22,"\u8017\u65f6\u957f\u5ea6\u7684\u88c5\u9970\u5668":26,"\u80a1\u4e1c\u4ee3\u7801":24,"\u80a1\u4efd":24,"\u80a1\u7968":[24,26],"\u80a1\u7968\u4ee3\u7801":19,"\u80a1\u7968\u57fa\u672c\u4fe1\u606f":22,"\u80a1\u7968\u5e02\u573a":24,"\u80a1\u7968\u7684\u4ee3\u7801":22,"\u80fd\u91cf\u6f6e":23,"\u81ea\u5b9a\u4e49\u7684\u5206\u949f\u7ebf\u6570\u636e\u7ed3\u6784":19,"\u81ea\u5b9a\u4e49\u7684\u65e5\u7ebf\u6570\u636e\u7ed3\u6784":19,"\u83b7\u53d6\u4e86\u65b0\u7684\u5e02\u573a\u51fd\u6570":17,"\u83b7\u53d6\u4ea4\u6613\u65e5\u671f":22,"\u83b7\u53d6\u5168\u5e02\u573a\u7684\u67d0\u4e00\u65e5\u7684\u6570\u636e":22,"\u83b7\u53d6\u5168\u90e8\u5b9e\u65f65\u6863\u884c\u60c5\u7684\u5b58\u50a8\u7ed3\u679c":22,"\u83b7\u53d6\u5168\u90e8\u7684\u6570\u636e":17,"\u83b7\u53d6\u591a\u4e2a\u80a1\u7968\u7684\u65e5\u7ebf":22,"\u83b7\u53d6\u6307\u6570\u65e5\u7ebf":22,"\u83b7\u53d6\u65e5\u7ebf\u53ca\u4ee5\u4e0a\u7ea7\u522b\u7684\u6570\u636e":22,"\u83b7\u53d6\u677f\u5757":19,"\u83b7\u53d6\u67d0\u4e00\u53ea\u5b9e\u65f65\u6863\u884c\u60c5\u7684\u5b58\u50a8\u7ed3\u679c":22,"\u83b7\u53d6\u67d0\u4e00\u53ea\u80a1\u7968\u7684\u677f\u5757":19,"\u83b7\u53d6\u771f\u5b9e\u7684\u4ea4\u6613\u65e5\u671f":26,"\u83b7\u53d6\u80a1\u7968\u5206\u949f\u7ebf":22,"\u83b7\u53d6\u80a1\u7968\u5217\u8868":22,"\u83b7\u53d6\u80a1\u7968\u65e5\u7ebf":22,"\u83b7\u53d6\u80a1\u7968\u9664\u6743\u4fe1\u606f":22,"\u878d\u5238\u4f59\u989d":24,"\u878d\u8d44\u4f59\u989d":24,"\u878d\u8d44\u878d\u5238\u6807\u7684":22,"\u884c\u4e1a":22,"\u884c\u60c5\u5206\u6790\u5668":16,"\u8861\u91cf\u8d85\u989d\u98ce\u9669\u5e26\u6765\u7684\u8d85\u989d\u6536\u76ca":17,"\u8868\u793a\u6295\u8d44\u671f\u9650\u4e3a\u4e00\u5e74\u7684\u9884\u671f\u6536\u76ca\u7387":17,"\u8868\u793a\u6bcf\u627f\u53d7\u4e00\u5355\u4f4d\u603b\u98ce\u9669":17,"\u8868\u8fbe\u6301\u7eed\u6027":23,"\u88c5\u9970\u5668\u7684\u5ef6\u65f6\u51fd\u6570":26,"\u8981":26,"\u8981\u8fdb\u884c\u98ce\u9669\u63a7\u5236":15,"\u89c2\u5bdf\u4e1a\u7ee9\u7b49\u7b49":15,"\u89c4\u5219\u7c7b":15,"\u89c6\u4e3a\u4e70\u8fdb\u4fe1\u53f7\u53c2\u8003":23,"\u89c6\u4e3a\u5356\u51fa\u4fe1\u53f7\u53c2\u8003":23,"\u89e3\u6790\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u6587\u4ef6":22,"\u8ba1\u7b97\u4e0a\u4e0b\u5f71\u7ebf":16,"\u8ba1\u7b97\u4ea4\u6613\u65e5\u671f":17,"\u8ba1\u7b97\u590f\u666e\u6bd4\u7387":[15,17],"\u8ba1\u7b97\u6240\u6709\u7684\u6307\u6807":16,"\u8ba2\u5355\u4e8b\u4ef6":26,"\u8ba2\u5355\u5931\u8d25":26,"\u8ba2\u5355\u5b58\u6d3b":26,"\u8ba2\u5355\u5b8c\u5168\u4ea4\u6613":26,"\u8ba2\u5355\u5f85\u751f\u6210":26,"\u8ba2\u5355\u6b7b\u4ea1":26,"\u8ba2\u5355\u72b6\u6001":26,"\u8ba2\u5355\u751f\u6210":26,"\u8ba2\u5355\u7684\u4e70\u5356\u65b9\u5411":26,"\u8ba2\u5355\u7684\u6210\u4ea4\u6a21\u5f0f":26,"\u8ba2\u5355\u7684\u6210\u4ea4\u91cf":26,"\u8bc1\u5238":22,"\u8be5\u6587\u4ef6\u4e3b\u8981\u662f\u8d1f\u8d23\u4e00\u4e9b\u5bf9\u4e8ecode\u540d\u79f0\u7684\u5904\u7406":26,"\u8be5\u8d26\u6237\u66fe\u4ea4\u6613\u4ee3\u7801":15,"\u8bf8\u5982":26,"\u8d1d\u5854":[15,17],"\u8d26\u6237\u4e5f\u8fdb\u884c\u6e05\u7b97":17,"\u8d26\u6237\u4e8b\u4ef6":26,"\u8d26\u6237\u7684\u6210\u4ea4\u53d1\u751f\u5f02\u5e38\u6210\u4ea4\u8bb0\u5f55\u7684\u5206\u6790":15,"\u8d26\u6237\u7684\u7528\u6237\u540d":15,"\u8d26\u6237\u7684broker":15,"\u8d26\u6237\u7c7b\u522b":15,"\u8d26\u6237\u7ed1\u5b9a\u7684\u7b56\u7565\u540d":15,"\u8d26\u6237\u8bc6\u522b\u7801":15,"\u8d27\u5e01\u79cd\u7c7b":26,"\u8d44\u4ea7\u7c7b":15,"\u8d44\u91d1":24,"\u8d44\u91d1\u4f7f\u7528\u7387":15,"\u8d44\u91d1\u51bb\u7ed3":24,"\u8d44\u91d1\u6307\u6807":23,"\u8d44\u91d1\u7684\u5206\u914d":15,"\u8d4b\u503c":23,"\u8d8b\u5411\u6307\u6807":23,"\u8dcc\u505c\u4ef7":19,"\u8f6c\u878d\u5238\u6807\u7684":22,"\u8f93\u5165\u4e00\u4e2adict":26,"\u8f93\u5165\u7684\u662f\u4e00\u4e2a\u884c\u60c5\u5207\u7247":16,"\u8f93\u51fa\u683c\u5f0f":26,"\u8f93\u51fa\u771f\u5b9e\u6ce2\u5e45":23,"\u8f93\u51fa\u7c7b\u578b":22,"\u8f93\u51fa\u8d44\u91d1\u6d41\u91cf\u6307\u6807":23,"\u8f93\u51fatr":23,"\u8fd4\u56de\u5168\u5e02\u573a\u67d0\u4e00\u5929\u7684\u6570\u636e":22,"\u8fd4\u56de\u5220\u9664\u540e\u7684":26,"\u8fd4\u56de\u552f\u4e00\u7684\u8bc1\u5238\u4ee3\u7801":19,"\u8fd4\u56de\u5728trade_list\u4e2d\u7684index\u4f4d\u7f6e":26,"\u8fd4\u56de\u5f53\u65e5\u7684\u4e0a\u4e0b\u4e94\u6863":22,"\u8fd4\u56de\u6240\u6709\u7684\u677f\u5757\u540d":19,"\u8fd4\u56de\u677f\u5757":22,"\u8fd4\u56de\u7684\u65f6\u5019\u7528":26,"\u8fd4\u56de\u7684\u662fdatafram":22,"\u8fd4\u56de\u7684\u90fd\u662f":26,"\u8fd4\u56dedatastruct\u7684\u957f\u5ea6":19,"\u8fd4\u56denone":[22,26],"\u8fd4\u56destart_day\u5230end_day\u4e2d\u95f4\u6709\u591a\u5c11\u4e2a\u4ea4\u6613\u5929":26,"\u8fd4\u56detyp":23,"\u8fd9\u4e00\u4e2a\u8fc7\u7a0b\u662f\u6a21\u62df\u5728\u771f\u5b9e\u60c5\u51b5\u4e2d\u5e02\u573a\u7684\u65f6\u95f4\u53d8\u5316\u548c\u4ef7\u683c\u53d8\u5316":17,"\u8fd9\u4e2a\u662f\u4ece\u6570\u636e\u5e93\u6062\u590d\u8d26\u6237\u65f6\u9700\u8981\u7684":15,"\u8fd9\u4e2a\u89c6\u56fe\u4f5c\u4e3a\u4e00\u4e2a\u9759\u6001\u7684\u89c2\u5bdf\u70b9":15,"\u8fd9\u662f\u4e00\u4e2a\u4e00\u5b9a\u4f1a\u6210\u4ea4":16,"\u8fd9\u662f\u4e00\u4e2a\u7528\u4e8e\u590d\u7528":26,"\u8fd9\u662f\u4e00\u4e2a\u968f\u610f\u65b0\u5efa\u7ebf\u7a0b\u7684\u751f\u4ea7\u8005\u6d88\u8d39\u8005\u6a21\u578b":21,"\u8fd9\u91cc\u4e3b\u8981\u662f\u4e00\u4e9b\u5173\u4e8e\u6587\u672c\u7684\u4ee3\u7801":26,"\u8fd9\u91cc\u5b9a\u4e49\u7684\u662f\u4e00\u4e9b\u5e38\u7528\u5e38\u91cf":26,"\u8fd9\u91cc\u7684\u65e0\u98ce\u9669\u6536\u76ca\u6307\u7684\u662f\u4e2d\u56fd\u56fa\u5b9a\u5229\u7387\u56fd\u503a\u6536\u76ca\u7387\u66f2\u7ebf\u4e0a10\u5e74\u671f\u56fd\u503a\u7684\u5e74\u5316\u5230\u671f\u6536\u76ca\u7387":17,"\u8fd9\u91cc\u9762\u90fd\u662f\u5bf9\u4e8e\u65b9\u6cd5\u7684\u5c01\u88c5":24,"\u8fdb\u5165\u5f85\u6210\u4ea4\u961f\u5217":26,"\u8fdb\u884c\u4ea4\u6613":17,"\u8fdb\u884c\u66f4\u65b0":24,"\u8fdb\u884c\u6e05\u7b97":17,"\u8fdb\u884c\u8f6c\u6362":26,"\u8fed\u4ee3\u5faa\u73af\u76f4\u81f3\u7ed3\u675f\u56de\u6d4b":17,"\u9002\u7528":15,"\u9009\u62e9\u5f85\u6210\u4ea4\u5217\u8868":24,"\u90a3\u5c31\u7528":26,"\u90ae\u4ef6\u53d1\u9001":26,"\u90e8\u5206":24,"\u90e8\u5206\u6210\u4ea4":26,"\u90fd\u4f1a\u88ab\u52a0\u8f7d\u5230\u8be5\u5355\u5143\u4e2d\u8fdb\u884c\u5206\u6790":16,"\u914d\u53f7\u67e5\u8be2":24,"\u963f\u5c14\u6cd5":17,"\u9650\u4ef7\u59d4\u6258":24,"\u9650\u4ef7\u6a21\u5f0f":26,"\u9664\u6743\u9664\u606f":22,"\u968f\u673a":26,"\u9700\u8981\u4e00\u4e2a\u53ef\u4ee5\u88ab\u4fee\u6539\u548c\u7ee7\u627f\u7684\u57fa\u7c7b":24,"\u9700\u8981\u517c\u5bb9\u80a1\u7968":15,"\u9700\u8981\u52a0\u8f7d\u4e00\u4e2aaccount":15,"\u9700\u8981\u5b8c\u5584run\u65b9\u6cd5":21,"\u9700\u8981\u5bf9\u4e8edatetim":26,"\u9700\u8981\u63a5\u53d7qa_ev":21,"\u9700\u8981\u6709":15,"\u9700\u8981\u8054\u7f51":19,"\u9707\u8361\u91cf\u6307\u6807osc":23,"\u9884\u8b66":22,"\u9891\u7387":22,"\u98ce\u683c":19,"\u98ce\u683c\u5206\u6790":15,"\u98ce\u9669\u6027\u4e3b\u8981\u5305\u62ec\u80dc\u7387":15,"\u9a8c\u8bc1\u8bc1\u660e":27,"abstract":24,"alpha\u6bd4\u7387":15,"backtest\u7684\u4e3b\u8981\u76ee\u7684":17,"beta\u6bd4\u7387":15,"boolean":9,"break":[2,6,8],"broker\u4e8b\u4ef6":26,"broker\u53d1\u9001settle\u6307\u4ee4":17,"broker\u6709\u4e86\u65b0\u6570\u636e\u4ee5\u540e":17,"by_price\u662f\u6309\u56fa\u5b9a\u6210\u4ea4\u603b\u989d\u4e0b\u5355":26,"case":[1,2,6,8,9],"class":[1,4,6,9,11,15,16,17,18,19,21,22,24,26,27],"code\u53ef\u4ee5\u662f\u80a1\u7968\u53ef\u4ee5\u662flist":22,"datastruct\u7684\u65b9\u6cd5":19,"datestamp\u8f6cdatetim":26,"default":[1,2,5,6,9,11,19,22,24,25],"end\u4e2d\u95f4\u6ca1\u6709\u4ea4\u6613\u65e5":26,"enum":[22,24],"export":[1,6],"final":[5,6],"float":[16,21],"function":[0,1,3,5,6,9,12,17],"generator\u6a21\u5f0f":24,"goto":3,"hash\u503c":27,"history\u4e24\u4e2a\u5b57\u6bb5":15,"import":[0,6,11,12],"int":[22,27],"ip\u53ef\u4ee5\u901a\u8fc7select_best_ip":22,"job\u662fwork":21,"k\u572820\u5de6\u53f3\u5411\u4e0a\u4ea4\u53c9d\u65f6":23,"k\u572880\u5de6\u53f3\u5411\u4e0b\u4ea4\u53c9d\u65f6":23,"long":23,"macd\u6307\u6807":23,"market\u544a\u77e5\u5df2\u7ecf\u6ce8\u518c\u7684\u6240\u6709\u7684account":17,"market\u7684\u5c01\u88c5":24,"mike\u6307\u6807":23,"mike\u662f\u53e6\u5916\u4e00\u79cd\u5f62\u5f0f\u7684\u8def\u5f84\u6307\u6807":23,"new":[1,4,5,8,9,11,19,26,27],"null":[3,6],"num\u662f\u6bcf\u4e2a\u80a1\u7968\u83b7\u53d6\u7684\u6570\u91cf":22,"on_tick\u65b9\u6cd5":15,"order\u6267\u884c\u5668":24,"order\u6267\u884c\u5668\u7684\u4f5c\u7528\u662f\u56e0\u4e3a":24,"order_handler\u7684\u4f5c\u7528\u5c31\u662f\u6839\u636e\u4fe1\u606f\u66f4\u65b0ord":24,"pandas\u8f6c\u51fa\u6765\u7684timestamp\u662f13\u4f4d\u6574\u6570":26,"portfolio\u4e0d\u5e94\u8be5\u6709\u8fc7\u591a\u53ef\u4ee5\u4fee\u6539\u7684\u90e8\u5206":15,"portfolio\u5e94\u5f53\u4f5c\u4e3a\u4e00\u4e2a\u89c6\u56fe\u6765\u5904\u7406":15,"portfolio\u662f\u4e00\u4e2a\u6807\u51c6\u5355\u5143":16,"portfolio\u7c7b\u8fdb\u6765":15,"portfolio\u91cc\u9762\u7684\u8d44\u4ea7\u4e3b\u8981\u8003\u8651\u7684\u662f":15,"qa_account\u53ef\u4ee5\u76f4\u63a5\u88abqa_strategy\u7ee7\u627f":15,"qa_account\u662f\u8d26\u6237\u7c7b":15,"qa_account\u7ee7\u627f\u81eaqa_work":15,"qa_performance\u662f\u4e00\u4e2a\u7ee9\u6548\u5206\u6790\u63d2\u4ef6":15,"quantaxis\u7684\u65f6\u95f4\u9009\u62e9\u51fd\u6570":26,"r\u4e09\u6761\u7ebf\u4ee3\u8868\u521d\u7ea7":23,"return":[1,5,9,15,16,17,19,21,22,24,25,26,27],"s\u4e09\u6761\u7ebf\u4ee3\u8868\u521d\u7ea7":23,"short":[2,5,23],"skdj\u6ce2\u52a8\u4e8e50\u5de6\u53f3\u7684\u4efb\u4f55\u8baf\u53f7":23,"st\u80a1":22,"static":27,"throw":1,"tick\u91c7\u6837\u6210\u4efb\u610f\u7ea7\u522b\u5206\u949f\u7ebf":19,"tr\u7684n\u65e5\u7b80\u5355\u79fb\u52a8\u5e73\u5747":23,"trade\u662f\u4e00\u4e2a\u53ef\u8fed\u4ee3\u7684list":16,"true":[1,3,6,9,15,22,24,25,26,27],"try":11,"v1\u8d4b\u503c":23,"var":[3,15],"while":[6,9,15],ABS:23,AND:23,And:[0,8,9,12],But:8,DNS:3,DOS:3,DTS:3,For:[0,6,9,12],Not:8,One:[8,11],Such:6,THS:26,The:[1,2,5,6,8,9,10,11,21,27],Then:8,There:[7,11],These:[6,11],Use:[6,11],Used:[1,9],__data:19,__file_nam:26,__file_path:26,_block_nam:19,_quotation_bas:[19,26],_realtime_bas:19,_time:26,_type:[16,22],_wv:[0,12],a001050100000000:22,a001050200000000:22,a001050d00000000:22,a001050e00000000:22,ab_board:19,abl:1,abnf:3,abnormal_act:15,about:[0,12],abov:2,absent:[1,9],absolut:23,absoult_path:17,acc:26,accept:[1,5,7],access:[3,5],accesslog:3,accord:[0,9,12],account:[0,6,12,15,16,17,22,24,25,26],account_cooki:[15,22,24],account_dai:17,account_ev:26,account_exist:26,account_handl:15,account_id:24,account_list:15,account_make_ord:26,account_settl:26,account_upd:26,accumul:15,accumulate_return:15,achiev:[0,9,12],actionscript:3,activ:21,actual:[0,2,6,8,12],ada:3,add:[1,11,15,27],add_account:15,add_func:16,added:[1,3,7],adding:7,addit:[2,3,9],address:27,adoc:3,adratio:19,affect:11,after:[1,2,9,21],after_backtest:[0,12],after_success:17,agnost:11,algol:3,algorithm:27,alia:[1,2],alias:1,aliv:21,all:[1,2,5,6,8,9,11,15,17,22],allow:[6,9],allow_sellopen:15,allow_t0:15,almost:11,along:9,alpha:[15,17],alreadi:26,also:[0,1,2,3,5,6,7,8,9,11,12,15,21],altogeth:9,alwai:[8,11,21],among:9,amount:[0,12,15,16,19,24,27],amount_model:[15,16,24,26],amplitud:[16,23],analysi:[0,12,15,17],ani:[0,3,5,6,7,8,9,12,21,27],annot:3,annual:17,annualize_return:15,annualized_return:[15,17],anoth:[3,6,7,9,10],answer:7,anyon:8,anyth:[3,6,9,10,11],apach:3,apacheconf:3,apart:2,api:[4,10,19,22,24],api_work:22,appear:7,append:1,applescript:3,appli:1,applic:24,approach:2,arbitrari:11,aren:[1,5,6],arg:[16,17,18,21,22,24,26],argument:[3,15,16,19,21,22,23,24,25,26],arm:3,armasm:3,around:8,arrai:[1,6,9],art:2,arturndai:19,arturnov:19,asciidoc:3,asi:23,asit:23,ask1:19,ask2:19,ask3:19,ask:8,ask_bid:19,ask_vol1:19,ask_vol2:19,ask_vol3:19,aspectj:3,assembl:3,assest_histori:17,assest_profit:[15,17],assest_profit_matrix:17,asset:[0,12,15,17],assets_d:17,atom:3,attach:1,attempt:[6,21],attent:[0,12],attr:[3,11],attribut:[1,3,10,11],aud:26,augment:9,author:[11,22],auto:[1,2,9,11],autohotkei:3,autoit:3,automat:[2,6],avail:[1,2,9,11,18],avedev:23,avoid:9,avr:3,avrasm:3,awk:3,axapta:3,back:[0,9,12,15],backetest:26,background:[8,11],backslash:6,backslash_escap:9,backtest:[0,12,14,15,17,26,28],backtest_framework:17,backtest_histori:22,backtest_info:22,backtest_init:[0,12],backtest_nam:17,backtest_result_analyz:17,backtest_set:[14,28],backtest_stock_deal:24,backward:1,bar:5,bar_settl:26,base:[0,2,12,14,15,16,17,18,19,21,24,26,27,28],base_datastruct:[14,28],bash:3,basic:3,bat:[3,22],bbi:23,bbibol:23,becom:[6,9],been:21,befor:[0,1,2,6,9,12,21],before_backtest:[0,12],begin:6,being:[1,7],below:[0,12],benchmark:15,benchmark_annualize_return:15,benchmark_annualized_return:[15,17],benchmark_asset:15,benchmark_cod:[0,12,15],benchmark_data:[15,17],benchmark_profit:[15,17],benchmark_profitpct:15,benchmark_typ:15,besid:9,best:[1,6,7,9],best_ip:22,beta:[0,12,15,17],better:[8,9],bfq:[19,22],bfq_data:19,bid1:19,bid2:19,bid3:19,bid_vol1:19,bid_vol2:19,bid_vol3:19,big:19,bigamount:19,binari:2,bind:3,bip:19,bit:6,black:[2,11],bloat:8,blob:[0,12],block:[3,8,9,11,16,21,27],block_nam:[16,19],block_pcg:16,block_pric:16,block_turnov:16,blockchain:27,blocknam:22,blog:8,bnf:3,board:19,bodi:23,body_ab:23,bold:11,bond_cn:26,bool:27,border:11,both:5,bother:8,brainfuck:3,bring:6,brinson:15,broker:[15,17,24,26],broker_calend:[14,28],broker_dailysettl:26,broker_ev:26,broker_nam:24,broker_settl:26,broker_trad:26,broker_typ:26,brought:8,browser:2,btc:26,buffer:[3,9],bug:[4,8],bui:[0,12,19,22,24,26],build:[0,4,5,12],built:[3,6],built_in:3,builtin:3,bullet:3,business_incom:19,button:8,buy_clos:26,buy_open:26,buyorsel:[19,22],bvp:19,by_amount:[16,24,26],by_pric:26,c_line_com:6,cach:3,cad:26,cal:3,cal_fe:24,calc:23,calc_alpha:15,calc_annualize_return:15,calc_beta:15,calc_every_pnl:17,calc_profit:15,calc_profitpctchang:15,calc_sharp:15,calc_trade_tim:17,call:[5,6,9,17,21,24],callabl:21,callback:[21,24],callback_messag:24,calmar:15,can:[0,1,2,6,9,10,12,15,21],cancel:[24,26],cancel_al:[24,26],cancel_ord:24,cannot:[6,7,9],canon:9,cap:3,capnp:3,capnproto:3,captur:[0,12],case_insensit:6,cash:[0,12,15],cash_tabl:15,cashflowratio:19,cashratio:19,categori:24,caus:[9,21],caution:9,caveat:11,cci:23,ccxt:26,center:17,cf_liabil:19,cf_nm:19,cf_sale:19,chain:[14,28],chanc:6,chang:[1,3,10,11,15,19,26],change_cash:15,change_ip:22,charact:[1,3,11],chart:[0,12],check:24,checklist:[4,6],cho:23,choic:[24,26],choos:11,chunk:6,circul:19,cixin:22,classic:6,classnam:6,classprefix:1,clean:[0,12],clear:[9,21,24],clearli:6,cli:18,client:[0,12,15,17,22,24,25,26],client_id:24,clj:3,clojur:3,close:[6,9,16,23,26],cls:3,cmake:3,cmd:[3,18],code:[0,1,2,3,4,6,8,10,12,15,16,17,19,22,24,26,27],code_list:17,coffe:3,coffeescript:3,col:26,col_:26,collabor:[0,12],collect:[15,22,25],color:[8,9,11],column:26,com:[0,4,5,11,12],combin:11,come:9,comma:9,commad:18,command:[2,18],comment:[3,5,8,9,11],commiss:24,commission_fe:17,commission_fee_coeff:24,commit:10,committ:10,common:[1,2,5,6,11],commonli:6,comparison:[0,12],compat:1,complex:[8,9],complic:2,compress:2,concat:19,concern:[0,12],cond:23,condit:6,conf:[3,10],config:3,config_fil:26,conjunct:9,connect:[15,22,24,25,26],connect_databas:15,connectionmethod:24,consensu:27,consid:[8,9],consist:[1,2,6],consol:3,constant:[0,3,12],constrain:9,construct:[2,3],constructor:21,contact:[0,12],contain:[1,5,6,11],content:[4,9,28],contribut:5,contributor:[4,6,7,11],control:9,conveni:[0,12],convent:6,cooki:[15,22,25],cookie_id:17,cookie_mang:15,cool:5,coq:3,core:[1,6,8,10],correct:27,correctli:9,cos:3,could:9,count:23,cpp:3,craftcm:3,crawler:[0,12],creat:[2,9,15,26],create_adjust:24,create_kern:21,crm:3,crmsh:3,cross:23,cross_valid:16,cryptocurr:26,crystal:3,csharp:3,cson:3,csp:3,css:[4,5,9,11],cur_vol:19,currency_typ:26,current:[1,8,9,15,19,21,26,27],current_tim:15,currentasset_dai:19,currentasset_turnov:19,currentratio:19,custom:[0,6,12],cutal:26,dai:[15,16,17,19,22,26],daily_cash:15,daily_hold:15,daily_settl:26,dart:3,data:[0,11,12,15,16,17,22,24,26],data_co:16,data_fq:[14,28],data_list:[14,28],data_resampl:[14,28],data_to_df:24,databas:[15,22,25,26],database_uri:17,datafram:[15,19,22,23,24,26],datasourc:[22,26],datastruct1:19,datastruct2:19,datastruct:[16,19,26],datastructn:19,date:[16,19,22,24,26],date_rang:22,datetim:[16,19,22,24],day_pct_chang:16,ddhfq:22,ddqfq:22,deadlock:21,deal:[19,24],dealer_preset:24,debian:2,debug:2,decid:21,decis:8,declar:[3,19],decor:19,decoupl:[0,12],decrypt:24,def:[0,9,12],defend:8,defin:[1,3,5,8,9],definit:[1,2,4,7,9],delet:[3,11],deliber:11,delphi:3,demo:5,demonstr:9,depend:2,des:18,describ:[5,6,8],descriopt:22,descript:[5,8,15,19,22,23,24,25,26],design:8,detail:[0,5,9,12,17,18,25],detect:[1,2,5,6,9],determin:27,develop:[2,7],deviat:23,devic:3,dfm:3,dict:[0,12,15,22,25,26,27],didn:10,diff:[3,23],differ:[0,2,5,6,9,12,15],digit:9,dir:17,direct:[3,24,25],directli:6,directori:2,discuss:[0,2,4,7,8,12],displai:11,distract:8,distrib:19,distribut:[0,12],divis:2,django:3,dma:23,dmi:23,dns:3,do_clean:18,do_drop_databas:18,do_exampl:18,do_exit:18,do_fn:18,do_help:18,do_quit:18,do_sav:18,do_shel:18,do_vers:18,doc:[6,10],docker:3,dockerfil:3,doctag:3,document:3,document_class:[15,22,25,26],doesn:[6,7,8,9],doing:[2,7],dom:1,domain:[5,11],domest:[0,12],don:[1,6,8,9],done:[2,5,6],dos:3,doubl:[6,9],doubt:[2,8],down:2,down_shdow:16,download:22,dpr:3,drawdown:17,driven:17,drop:[2,6,9],dsconfig:3,dsmethod:[14,28],dst:3,dts:3,dtype:19,dure:5,dust:3,dynam:1,dynamic_optim:26,each:[5,6,8,9],earli:6,easier:15,easili:9,eastmonei:26,ebnf:3,echo:9,effect:[6,9],effective_d:19,either:[5,6,8,11,21],element:[2,6,9],elixir:[3,9],elm:3,els:[0,6,9,12],ema:23,email:[5,11],embed:[3,9],emphasi:3,empti:9,emul:11,enabl:6,enc_iv:24,enc_kei:24,encod:24,encrypt:24,end:[0,6,12,16,17,19,22,24,26],end_backtest:[0,12],end_dat:[15,22],enddat:22,endpoint:24,eng:17,engin:[0,11,12,21,24,25],engine_ev:26,enging:24,english:[5,11],ensur:9,entir:9,entiti:16,enumer:24,environ:[2,3,15],epcf:19,eps:19,eps_yoi:19,epsg:19,erl:3,erlang:3,error:[2,21],escap:6,essenti:6,etc:[2,3,6,10,11],etf:24,etf_dai:25,etf_min:25,eur:26,evalu:1,even:[1,2,6],event:[1,15,21,24],event_typ:[21,26],ever:8,everi:[2,8,9,11],everydai:19,everyth:10,everywher:10,evil:8,exact:19,exactli:11,exampl:[0,2,6,9,11,12],excel:[0,3,12],except:[1,6,21,22],excess:6,exchang:22,exchange_id:24,exclud:[9,11],execut:24,exist:26,exot:6,expand:9,expans:3,expect:2,experi:[0,12],explan:[8,9],explicit:[6,9],explicitli:2,expma:23,express:[1,3,9],ext:19,extend:[5,9],extra:6,extract:9,f90:3,f95:3,face:11,fact:8,fail:26,fals:[3,6,9,15,21,22,24,25,26,27],fanci:[8,11],far:8,fast:23,featur:[8,9],feel:5,fetch:22,fetcher:[14,28],few:[1,2,6,11],fifteen_min:26,file:[2,3,11,25],file_dir:25,filenam:[9,22],financi:14,find:[6,9],fininsh:17,finish:1,first:[2,3,6,9,11],five_min:26,fix:[2,3,8],fixabl:10,flag:[1,3,9],flow:17,follow:[1,3,6,8],font:11,foo:[5,9],for_sh:22,for_sz:22,forbid:7,forc:[1,9],forget:11,fork:8,form:[6,9],format:[5,11,15,22],formula:3,fortran:3,forward:9,found:[1,2,6,9],fraction:21,fragment:6,frame:[0,12],framework:[1,14],free:[5,11],freepasc:3,frequenc:[15,17,22,24,26],from:[0,1,2,3,5,6,7,8,9,11,12,15,19,21],from_dict:24,from_messag:15,from_password:26,from_tushar:19,from_us:26,fsharp:3,full:[2,19],full_chain:27,func:[21,24,26],fund_cn:26,fundament:[7,14,28],further:8,futur:[0,12,19],future_cn:26,future_dai:19,future_ip_list:26,future_min:19,gam:3,gap:[0,12,16,17,26],gauss:3,gawk:3,gbp:26,gcode:3,gddm:24,gemspec:3,gener:[1,2,3,7,9,11,16,17],generate_simpleaccount:15,get:[0,2,7,12,15,21,22,24],get_account:[15,24],get_account_id:24,get_and_pars:22,get_api_last_error:24,get_api_vers:24,get_avail:22,get_bar:22,get_big_ord:19,get_block:19,get_cash:15,get_client_id:24,get_cod:19,get_data:[16,24],get_day_onc:22,get_etf:19,get_filenam:22,get_frequ:22,get_gap_trad:16,get_index:19,get_info:22,get_loss_trad:17,get_market:[22,24],get_medium_ord:19,get_nowait:21,get_ord:24,get_portfolio:15,get_posit:24,get_pric:19,get_profit_trad:17,get_quot:[22,24],get_realtim:22,get_realtime_concurr:22,get_security_bar:22,get_security_bar_concurr:22,get_small_ord:19,get_status:24,get_stock:19,get_stock_info:16,get_stock_tradedetail:17,get_stock_tradehistori:17,get_tim:19,get_today_al:22,get_trade_before_and_after_pnl:17,get_trade_marketdata:17,get_trading_dai:24,getblock:19,getcod:19,getdtyp:19,getlanguag:9,gherkin:3,git:10,github:[0,4,5,11,12],give:[2,5,15,17],given:[6,9,27],global:[0,1,12],glsl:3,gms:3,goe:9,going:2,golang:3,golo:3,gololang:3,good:[5,6,11],googl:4,gradl:3,graph:3,groovi:3,gross_profit_r:19,group:[0,2,4,6,7,11,12],gss:3,gte:26,gui:8,guid:[4,7,9],guidelin:11,gyp:3,haml:3,hand:[6,11],handl:[0,9,12],handlebar:3,happen:[6,7,21],has:[0,2,6,9,11,12,21,26],hash:27,haskel:3,have:[0,2,6,7,8,9,11,12],hax:3,hbs:3,head:3,header:[5,10],hei:8,height:11,hello:[9,27],help:[2,6,18],help_clean:18,help_drop_databas:18,help_exampl:18,help_exit:18,help_quit:18,help_sav:18,help_vers:18,helper:6,henc:11,here:[6,7,9],heurist:[1,2,6],hfq:22,hhv:23,high:[6,16,23],high_limit:19,higher:[6,19],highest:[0,12],highli:[0,12],highlight:[2,3,7,8,9,11],highlightj:[4,5,10],hint:6,histori:[0,12,15,17],history_t:15,hkd:26,hlj:[1,5,6,9,11],hold:[0,12,15,27],host:[14,15,22,24,25,28],hot_upd:26,hour:26,how:[2,7,8],howev:[9,11],hpp:3,hs300:[0,12],hth:24,html:[1,2,3,5,8,9],http:[0,3,4,5,10,12,24,27],human:5,hylang:3,hyperlink:3,iced:3,icratio:19,idea:2,ident_r:9,identifi:[3,5,9],idx:26,if_buyside_commiss:24,if_commiss:24,if_drop_index:22,if_fq:[19,22],if_nondatabas:24,if_open_web:26,if_sellside_commiss:24,iif:9,illeg:1,illustr:6,imag:11,immedi:[5,9],implement:[0,7,8,9,12],implic:11,implicitli:9,import_trad:16,improv:[2,6,8],includ:[2,3,7,9,11],inclus:8,increment:10,indent:1,index:[4,13,16,19,27],index_cn:[15,26],index_dai:[19,22,25],index_min:[19,22,25],indic:[6,14,28],individu:9,infinit:9,influenc:6,info:[0,12,24,25],inform7:3,inform:[0,12,17],ini:3,init:[0,12],init_assest:[0,12],init_asset:[15,16,17],initi:1,input:[0,12],input_text:26,ins:6,insensit:[6,9],insert_ord:24,insid:[2,3,6,9,15],inspir:5,instal:2,instanc:3,instead:[1,6,7,9,11],institut:22,instruct:[3,5],integ:1,intend:10,interact:[0,12],interest:[6,7,9,10],interfac:[0,3,12],intern:[1,3,9],internet:8,introduct:[0,12],invent:11,inventory_dai:19,inventory_turnov:19,invok:21,ip_a:15,ip_b:15,ipo:24,ipsiz:22,irb:3,irpf90:3,irrelev:6,isagalaev:4,isal:21,isol:2,issu:[0,4,7,12],ital:11,item:[0,3,12],its:[5,6,8,9],itself:[2,6,8,9],java:[3,5],javascript:[1,2,3,6,9],jinja:3,job:6,john:[5,11],johnson:5,join:21,join_quant:24,joinquant:24,jpy:26,json:[3,10,22,24,26],jsp:3,jsx:3,just:[5,6,8,9,22],jy_passwrod:24,jyp:22,kdb:3,kei:[0,3,5,9,12,24,26],kernal:21,kernel_num:21,key_regex:24,keyword:[3,5,19,21,22,25],kind:[6,9],know:9,kurtosi:16,kwarg:[16,17,19,21,22,24,26],label:3,lack:8,lan:[0,12],languag:[0,2,4,9,11,12],larger:8,lasso:3,lassoscript:3,last:[9,10,22,23],last_block:27,last_proof:27,lastest:15,latest:10,latest_cash:15,lazaru:3,ldif:3,leaf:3,left:11,len:[16,19,22,26],less:3,lessen:6,letter:6,level:[3,9,19,22],lex:6,lexem:[6,8],lfm:3,librari:[3,4,5,7],like:[0,2,3,6,9,10,12],limit:[0,11,12,26],line:[1,2,3,4,5,6,9,11],link:[0,2,3,4,12],lisp:3,list:[1,3,5,6,9,11,18,19,22,24,26,27],liter:[2,3,6,9],live:5,livecod:3,livecodeserv:3,livescript:3,llv:23,load:[1,26],load_data:[16,26],load_modul:16,load_preset:24,load_strategi:[0,12],local:1,localfil:26,locat:[2,26],log:[3,26],logger:24,login:[15,24,26],logoff:24,logon:24,logout:24,look:[1,2,6,8,10,11],loop:9,low:[16,23],low_limit:19,lower:19,lower_shadow:23,lowest:[0,12],lpr:3,lru_cach:19,lte:26,lua:3,macd:23,machin:2,mad:16,made:21,mai:[1,6,9,11,21],main:[9,14,27,28],maintain:8,mainten:8,major:6,mak:3,make:[2,5,6,7,8,10,11,15],make_cach:25,make_d:16,make_dir:25,make_ord:26,make_portfolio:15,makefil:3,manag:[0,12],mani:[0,6,8,11,12,21],margin:[11,22],margin_level:15,mark:1,markdown:3,market:[0,12,15,16,17,22,24,26],market_data:[16,19,24],market_error:26,market_ev:26,market_init:26,market_typ:[15,17,22,24,26],markup:[1,3,9],master:10,match:9,mathemat:3,mathematica:3,matlab:3,matt:5,matter:7,mawk:3,max:[16,17,23],max_dropback:15,maxima:3,maya:3,mbrg:19,mean:[5,7,8,16,23],mean_harmon:16,meaning:5,media_typ:24,mediatyp:24,medium:[0,12,19,23],mel:3,menu:2,mercuri:3,mes:25,messag:[0,2,12,15,17,21,22,25,27],meta:[3,11],method:[1,3,15,19,21,26],mfi:23,mid:23,might:[2,6,8],mike:5,min:[16,23],mine:27,minimalist:11,minut:[10,19],miscellan:4,mismatch:10,mizar:3,mkd:3,mkdown:3,mma:3,mocha:2,mode:[1,4,5,16],model:[0,12,15],modif:9,modifi:[3,22],modul:[3,4,13,28],modular:[0,12],mojolici:3,moment:[7,8],monei:15,mongo:[25,26],mongocli:[15,22,25,26],mongodb:[15,25],monitor:10,monkei:3,month:[22,26],month_data:16,monthli:16,moon:3,moonscript:3,more:[0,5,8,9,12],most:[6,9],mostli:[1,9],msg:26,multi:[0,12],multipl:9,must:21,myclass:6,myself:8,n1ql:3,name:[2,5,6,9,11,19,21,22,25,26],nav:19,navig:24,nawk:3,ndarrai:26,necessari:[2,11],need:[0,2,6,9,12],needless:9,nest:6,net:3,net_profit:19,net_profit_ratio:19,never:[8,9],new_account:15,new_block:27,new_portfolio:15,new_statu:24,new_transact:27,newlin:6,next_day_high_limit:19,next_day_low_limit:19,next_open:26,nginx:3,nginxconf:3,nice:6,nim:3,nimrod:3,nix:3,no_market_data:26,node:[1,2,27],nodej:2,nois:6,non:[1,11],none:[15,16,19,21,22,24,26,27],nonetyp:27,normal:21,notabl:[6,8],notat:10,note:[2,9,10],now_tim:25,npm:2,nprg:19,nsi:3,num:[17,19,22],number:[3,4,6,9,10,21],number_mod:5,numpi:22,obj:3,objc:3,object:[1,3,5,6,9,15,16,17,19,21,22,24,26,27],objectivec:3,obscur:7,obviou:5,obvious:11,ocaml:3,occupi:5,occur:21,often:9,okai:11,omit:[6,9],on_bar:15,on_cancel_ord:24,on_cancel_order_ev:24,on_connect:24,on_error:24,on_insert_ord:24,on_order_ev:24,on_query_asset:24,on_query_data:24,on_query_ord:24,on_query_posit:24,on_query_trad:24,on_tick:15,on_trade_ev:24,one:[1,6,8,9],one_min:26,ones:[5,8],onli:[1,2,5,6,8,9],open:[0,12,16,23],opengl:3,openscad:3,oper:21,opinion:8,optim:[0,12],option:[2,6,9,21],option_cn:26,oracl:3,ordehandld:24,order:[0,12,19,24],order_direct:26,order_ev:26,order_id:24,order_model:[0,12,15,16,24,26],order_pb2:[14,19],order_statu:26,org:[5,10],orient:[0,12],osascript:3,other:[1,5,6,11],otherwis:1,our:7,out:[9,21,22],output:[1,22],output_format:[22,26],outsid:6,over:9,overal:2,overdo:8,overflow:11,overrid:[1,6,21],overridden:9,oversight:8,own:[0,5,6,8,9,12],oxygen:3,p21:3,packag:[2,5,10,28],pad:11,page:[1,4,5,8,13],pai:[0,12],pair:[5,9],panda:22,param:[3,24,27],paramet:[1,3,5,6,9],parent:9,pars:[1,3,6,9,11],parser3:3,parser:[6,9],part:[3,6,8,9,10],parti:1,particular:7,pas:3,pascal:3,pass:[0,1,12,21],password:[15,22,25,26],patch:[3,10],path:[25,26],paus:21,pcmk:3,pct_chang:16,pend:24,peopl:8,perfectli:11,perform:[15,17],period:15,perl:3,person:8,php3:3,php4:3,php5:3,php6:3,php:[3,9],pic_handl:26,ping:[22,24],pipe:[6,9],place:[2,3,10],plai:9,plain:[6,10],plan:7,platform:[0,12],pleas:2,plist:3,plot_datastruct:26,podspec:3,point:[6,7,9,21],polici:[0,8,12],poni:3,port:[15,22,24,26],portfolio:[0,12,15],portfolio_cooki:15,posit:[8,11],possibl:[2,5,6,9,11],post:[1,8],powershel:3,practic:[2,11],prase_al:22,pre:1,preclos:19,prefer:15,prefix:[1,6],preprocessor:3,presenc:6,present:[1,21],pretti:5,previou:27,previous_hash:27,price:[0,12,15,16,19,24],price_chg:19,price_diff:16,price_limit:26,price_pcg:23,price_typ:24,principl:8,print:[0,12],probabl:8,process:[0,1,3,4,5,6,9,12],profil:3,profit:15,profit_dai:17,profit_pct:15,profits_yoi:19,program:[0,6,12],progress:[0,12],project:[7,8],prolog:3,proof:27,proof_of_work:27,properti:[1,3,6],proto:[3,14,19],protobuf:3,protocol:[0,3,12,22,26],provid:[2,7],proxi:24,pseudo:3,pstdev:16,pull:[11,15],puppet:3,purchase_convertible_bond:24,purchase_new_stock:24,purpos:3,push:[0,10,12,15],put:[6,9,21],put_nowait:21,pvarianc:16,python:[2,3,6],qa_account:15,qa_backtest:17,qa_backtest_analysis_backtest:17,qa_backtest_calc_alpha:17,qa_backtest_calc_asset:17,qa_backtest_calc_benchmark:17,qa_backtest_calc_beta:17,qa_backtest_calc_dropback_max:17,qa_backtest_calc_profit:17,qa_backtest_calc_profit_matrix:17,qa_backtest_calc_profit_per_year:17,qa_backtest_calc_sharp:17,qa_backtest_calc_trade_d:17,qa_backtest_calc_volatil:17,qa_backtest_calc_win_r:17,qa_backtest_get_market_data:[0,12],qa_backtest_hold_amount:[0,12],qa_backtest_send_ord:[0,12],qa_backtest_stock_dai:[0,12],qa_backtestbrok:24,qa_brok:24,qa_broker_ev:24,qa_cmd:18,qa_data_get_hfq:19,qa_data_get_qfq:19,qa_data_make_hfq:19,qa_data_make_qfq:19,qa_data_stock_to_fq:19,qa_data_tick_resampl:19,qa_datastruct_future_dai:19,qa_datastruct_future_min:19,qa_datastruct_index_dai:19,qa_datastruct_index_min:19,qa_datastruct_security_list:19,qa_datastruct_stock_block:19,qa_datastruct_stock_dai:19,qa_datastruct_stock_min:19,qa_datastruct_stock_realtim:19,qa_datastruct_stock_realtime_seri:19,qa_datastruct_stock_transact:19,qa_deal:24,qa_engin:21,qa_ev:[21,24],qa_fetch:22,qa_fetch_account:22,qa_fetch_backtest_histori:22,qa_fetch_backtest_info:22,qa_fetch_depth_market_data:22,qa_fetch_future_dai:22,qa_fetch_future_min:22,qa_fetch_future_tick:22,qa_fetch_get_future_dai:22,qa_fetch_get_future_list:22,qa_fetch_get_future_min:22,qa_fetch_get_future_realtim:22,qa_fetch_get_future_transact:22,qa_fetch_get_future_transaction_realtim:22,qa_fetch_get_index_dai:22,qa_fetch_get_index_min:22,qa_fetch_get_security_bar:22,qa_fetch_get_sh_margin:22,qa_fetch_get_stock_analysi:22,qa_fetch_get_stock_block:22,qa_fetch_get_stock_dai:22,qa_fetch_get_stock_day_in_year:22,qa_fetch_get_stock_day_simpl:22,qa_fetch_get_stock_financi:22,qa_fetch_get_stock_ind:22,qa_fetch_get_stock_info:22,qa_fetch_get_stock_latest:22,qa_fetch_get_stock_list:22,qa_fetch_get_stock_list_speci:22,qa_fetch_get_stock_min:22,qa_fetch_get_stock_realtim:22,qa_fetch_get_stock_risk:22,qa_fetch_get_stock_shap:22,qa_fetch_get_stock_tick:22,qa_fetch_get_stock_time_to_market:22,qa_fetch_get_stock_transact:22,qa_fetch_get_stock_transaction_realtim:22,qa_fetch_get_stock_xdxr:22,qa_fetch_get_stock_xueqiu:22,qa_fetch_get_sz_margin:22,qa_fetch_get_trade_d:22,qa_fetch_get_wholemarket_list:22,qa_fetch_index_dai:22,qa_fetch_index_day_adv:22,qa_fetch_index_min:22,qa_fetch_index_min_adv:22,qa_fetch_indexlist_dai:22,qa_fetch_quot:22,qa_fetch_security_list_adv:22,qa_fetch_stock_block:22,qa_fetch_stock_block_adv:22,qa_fetch_stock_dai:[0,12,22],qa_fetch_stock_day_adv:22,qa_fetch_stock_day_full_adv:22,qa_fetch_stock_ful:22,qa_fetch_stock_info:22,qa_fetch_stock_list:22,qa_fetch_stock_list_adv:22,qa_fetch_stock_min:22,qa_fetch_stock_min_adv:22,qa_fetch_stock_nam:22,qa_fetch_stock_realtime_adv:22,qa_fetch_stock_transaction_adv:22,qa_fetch_stock_xdxr:22,qa_fetch_trade_d:22,qa_indicator_adtm:23,qa_indicator_arbr:23,qa_indicator_asi:23,qa_indicator_atr:23,qa_indicator_bbi:23,qa_indicator_bia:23,qa_indicator_bol:23,qa_indicator_cci:23,qa_indicator_cho:23,qa_indicator_cr:23,qa_indicator_ddi:23,qa_indicator_dma:23,qa_indicator_dmi:23,qa_indicator_ema:23,qa_indicator_expma:23,qa_indicator_kdj:23,qa_indicator_ma:23,qa_indicator_macd:23,qa_indicator_mfi:23,qa_indicator_mik:23,qa_indicator_mtm:23,qa_indicator_obv:23,qa_indicator_osc:23,qa_indicator_pbx:23,qa_indicator_pvt:23,qa_indicator_roc:23,qa_indicator_rsi:23,qa_indicator_shadow:23,qa_indicator_skdj:23,qa_indicator_sma:23,qa_indicator_vpt:23,qa_indicator_vr:23,qa_indicator_vrsi:23,qa_indicator_vstd:23,qa_indicator_wr:23,qa_market:24,qa_ord:24,qa_orderhandl:24,qa_orderqueu:24,qa_perform:15,qa_plot_save_html:26,qa_portfolio:15,qa_portfolioview:15,qa_quot:22,qa_randombrok:24,qa_realbrok:24,qa_risk:15,qa_save_stock_day_al:25,qa_save_stock_day_all_bfq:25,qa_save_stock_day_with_fqfactor:25,qa_save_tdx_to_mongo:25,qa_set:26,qa_simulatedbrok:24,qa_strategi:15,qa_su_save_account_messag:25,qa_su_save_account_to_csv:25,qa_su_save_backtest_messag:25,qa_su_save_etf_dai:25,qa_su_save_etf_min:25,qa_su_save_index_dai:25,qa_su_save_index_min:25,qa_su_save_pnl_to_csv:25,qa_su_save_stock_block:25,qa_su_save_stock_dai:25,qa_su_save_stock_info:25,qa_su_save_stock_list:25,qa_su_save_stock_min:25,qa_su_save_stock_min_5:25,qa_su_save_stock_transact:25,qa_su_save_stock_xdxr:25,qa_su_save_trade_date_al:25,qa_task:21,qa_tdx_executor:22,qa_test_makeportfolio:15,qa_thread:21,qa_trad:24,qa_us:15,qa_user_sign_in:25,qa_user_sign_up:25,qa_util_calc_tim:26,qa_util_cfg_initi:26,qa_util_code_tolist:26,qa_util_code_tostr:26,qa_util_date_gap:26,qa_util_date_int2str:26,qa_util_date_stamp:26,qa_util_date_str2int:26,qa_util_date_todai:26,qa_util_date_valid:26,qa_util_dict_remove_kei:26,qa_util_diff_list:26,qa_util_get_cfg:26,qa_util_get_date_index:26,qa_util_get_index_d:26,qa_util_get_last_dai:26,qa_util_get_next_dai:26,qa_util_get_real_d:26,qa_util_get_real_datelist:26,qa_util_get_trade_gap:26,qa_util_get_trade_rang:26,qa_util_id2d:26,qa_util_if_trad:26,qa_util_if_tradetim:26,qa_util_is_trad:26,qa_util_log_debug:26,qa_util_log_expect:26,qa_util_log_info:[0,12,26],qa_util_log_x:26,qa_util_make_hour_index:26,qa_util_make_min_index:26,qa_util_mongo_info:26,qa_util_mongo_initi:26,qa_util_mongo_statu:26,qa_util_ms_stamp:26,qa_util_multi_demension_list:26,qa_util_random_with_top:26,qa_util_realtim:26,qa_util_save_csv:26,qa_util_select_hour:26,qa_util_select_min:26,qa_util_send_mail:26,qa_util_sql_async_mongo_set:26,qa_util_sql_mongo_ip:[0,12],qa_util_sql_mongo_set:26,qa_util_stamp2datetim:26,qa_util_time_delai:26,qa_util_time_gap:26,qa_util_time_now:26,qa_util_time_stamp:26,qa_util_to_datetim:26,qa_util_to_json_from_list:26,qa_util_to_json_from_numpi:26,qa_util_to_json_from_panda:26,qa_util_to_list_from_numpi:26,qa_util_to_list_from_panda:26,qa_util_to_pandas_from_json:26,qa_util_to_pandas_from_list:26,qa_util_web_p:26,qa_util_web_pool:26,qa_web:[14,28],qa_work:[15,21,24],qaaccount:[14,28],qaanalysi:[14,28],qaanalysis_block:[14,28],qaanalysis_codewithblock:16,qaanalysis_datafram:[14,28],qaanalysis_machine_learn:16,qaanalysis_machinelearn:[14,28],qaanalysis_seri:[14,28],qaanalysis_series_slop:16,qaanalysis_stock:16,qaanalysis_tick:[14,28],qaanalysis_trad:[14,28],qaanalysis_transact:16,qaarp:[14,28],qaauth:[14,28],qabacktest:[14,28],qabacktestbrok:[14,28],qabar:[14,28],qabrok:[14,28],qacfg:[14,28],qacmd:[14,28],qacod:[14,28],qacrawl:[14,28],qacsv:[14,28],qadat:[14,28],qadata:[14,28],qadatastruct:[14,28],qadate_trad:[14,28],qadeal:[14,28],qadict:[14,28],qaeastmonei:[14,28],qaengin:[14,15,24,28],qaevent:[14,15,24,28],qafetch:[14,28],qafinanci:[14,28],qaindic:[14,28],qalist:[14,28],qaloc:[14,28],qalog:[14,28],qamail:[14,28],qamarket:[14,28],qamongo:[14,28],qaorder:[14,28],qaorderhandl:[14,28],qaparamet:[14,28],qaplot:[14,28],qaportfolio:[14,28],qaqueri:[14,28],qaquery_adv:[14,28],qarandom:[14,28],qarandombrok:[14,28],qarealbrok:[14,28],qaresult:[14,28],qarisk:[14,28],qaset:[14,28],qasimulatedbrok:[14,28],qasql:[14,28],qastandard:[22,26],qastrategi:[14,28],qasu:[14,28],qatask:[14,28],qatdx:[14,28],qatdx_adv:[14,28],qatext:[14,28],qath:[14,28],qathreadengin:[14,28],qatrad:[14,28],qatransform:[14,28],qatushar:[14,28],qauser:[14,28],qautil:[14,28],qaweb:[14,28],qawind:[14,28],qfq:22,qml:3,qsize:21,quantit:14,quantiti:24,quarter:[19,22,26],queri:[0,12,24],query_account:26,query_asset:[24,26],query_backtest:27,query_backtest_by_:27,query_backtest_histori:27,query_cash:[24,26],query_category_balance_of_margin_loan:24,query_category_balance_of_stock_loan:24,query_category_cancelable_ord:24,query_category_cash:24,query_category_deal_of_todai:24,query_category_new_stock:24,query_category_new_stock_hit:24,query_category_new_stock_numb:24,query_category_new_stocks_quota:24,query_category_operable_margin_sotck:24,query_category_order_of_todai:24,query_category_shareholders_cod:24,query_category_stock:24,query_convertible_bond:24,query_currentbar:24,query_data:[24,26],query_data_no_wait:24,query_day_bfq:27,query_day_hfq:27,query_day_qfq:27,query_k:27,query_m:22,query_min_bfq:27,query_min_qfq:27,query_new_stock:24,query_ord:[24,26],query_posit:24,query_trad:24,question:[0,12],queu:26,queue:21,quickli:[0,12],quickratio:19,quit:[6,8,9],quot:[3,6,9],quotat:3,quote_string_mod:6,rais:21,random:26,ranodm:26,rapid:[0,12],rateofreturn:19,ratio:17,read:5,readabl:[2,5],reader:8,real:[8,15,26],realiz:[0,12],realtim:[14,27,28],realtime_2018:22,realtimedata:[14,28],reason:2,receive_d:15,receive_ord:[24,26],recipi:27,recommend:[6,9],red:9,ref:23,refer:[1,2,4,6,11],referenc:8,regex:[2,6,9],regexp:[3,5,6,9],regist:[1,17,24],register_account:15,register_kern:21,register_nod:27,register_spi:24,regular:[1,3,9],reinterpret_cast:6,rel:6,releas:[4,24],relev:[1,2,9],remain:9,render:2,renderman:3,repai:24,repeat:9,repetit:9,replac:[1,2],report_d:19,repres:[1,9,21],request:[4,11],request_json:24,requir:[2,5,6,9,11],res:[16,22],resampl:19,research:8,reset:11,reset_asset:15,reset_histori:15,resid:8,resolve_conflict:27,respect:21,respons:[0,12],rest:[0,8,12],restart:1,restrict:1,result:[2,3,15,21,24],resum:[15,21],retri:22,revis:10,rib:3,rich:11,right:9,risk:[0,12,25],risk_posit:[0,12],rmb:26,roboconf:3,roe:19,root:11,row_:26,rsl:3,rss:3,rubi:[2,3],rule:[3,6,7,9,11],ruleslanguag:3,run:[2,15,17,18,21,24],run_backtest:27,run_job:21,running_environ:26,runtimeerror:21,russian:[5,11],rust:3,rzrq:22,sai:8,same:[1,6,9,21],satisfi:2,save:[15,25],save_account:[14,28],save_backtest:[14,28],save_engin:25,save_loc:[14,28],save_mongo:22,save_riskanalysi:25,save_tdx:[14,28],save_tdx_fil:[14,28],save_tushar:[14,28],scad:3,scala:3,scene:[0,12],schema:[14,28],scheme:3,sci:3,scilab:3,script:[2,3,9],scss:3,search:[4,13],second:[1,21],second_best:1,section:[3,11],see:[0,1,2,7,8,9,12],seem:11,seg:19,select:[2,25],select_best_ip:22,select_save_engin:25,selector:[3,9,11],self:[6,24],sell:[0,12,19,22,24,26],sell_avail:15,sell_clos:26,sell_open:26,semant:3,semicolon:9,send:[0,5,11,12],send_ord:[15,24],sender:27,sending_tim:24,sens:[2,6,11],separ:[6,8,9,11],sequenc:6,sequenti:21,seri:[19,23,26],serial:[14,28],server:[2,3],set:[0,1,3,6,8,9,11,12],set_benchmark:15,set_statu:24,settl:[15,24,26],sever:[6,9],sha:27,shade:3,shadow:16,shadow_calc:16,shadow_panel:16,shanghai:22,share:[6,19],sharp:[15,17],shell:[3,18],shenzhen:22,sheqratio:19,shipanebrok:[14,28],shipanecli:[14,28],shortli:5,should:[0,2,5,6,9,11,12,21],shouldn:2,show:[6,8,9,19],shown:11,shutdown_cli:24,sid:19,signific:3,signin:27,signup:27,similar:9,simpl:[6,9,15],simpli:[2,5,8,10],simplic:8,simul:26,sinc:[9,10],singl:[6,8,9,11],site:10,situat:[0,12],sixty_min:26,size:[0,11,12],skewnewss:16,skip:2,slash:9,slice:16,slow:23,sma:23,smali:3,small:[0,8,12,19],smallamount:19,smaller:8,smalltalk:3,smith:[5,11],smtp:26,snippet:[2,8],solut:[0,8,12],solv:8,some:[2,5,6,8,11,17],someth:10,sometim:[6,9],somewher:6,sort:6,sortino:15,sourc:[15,16,17,18,19,21,22,23,24,25,26,27],source_obj:24,sourcecpi:18,space:[1,6,9],span:[6,9],spec:6,speci:[0,12],special:[3,5,6,9],specif:[2,6,11],specifi:[1,9,21],spetradeapi:24,split_word:26,sql:[3,5],sql_set:17,sqlalchemi:19,sr_seri:19,src:18,sst:22,st_option:19,stack:1,stan:3,standard:[0,3,11,12,15,21],start:[0,6,8,12,16,17,19,21,22,24,26],start_client:24,start_dat:[15,22],start_kern:21,start_market:17,startdat:22,stata:3,state:1,statist:6,statu:[24,27],status1xx:26,status2xx:26,status3xx:26,status4xx:26,status500:26,std:23,stdev:16,step1:24,step2:24,step3:24,step:3,still:[2,21],stock:[0,12,22,24,25],stock_block:[22,25],stock_cn:[15,26],stock_dai:[0,12,19,22,25],stock_day_pb2:[14,19],stock_deal:24,stock_hk:26,stock_info:[16,22,25],stock_list:[22,25],stock_min5:25,stock_min:[19,22,25],stock_min_pb2:[14,19],stock_transact:[22,25],stock_turnov:16,stock_u:26,stock_xdxr:[22,25],stockoption_cn:26,stop:[8,17,21],stop_al:21,stop_kern:21,stp:3,str:[16,19,22,25,27],straightforward:8,strategi:[14,15,22,24],strategy_end_d:[0,12],strategy_nam:15,strategy_start_d:[0,12],strategy_stock_list:[0,12],stratetgi:15,strict:[0,12,26],string:[1,2,3,6,9,11],stripe:8,strong:[3,23],strtime:26,struct:19,structur:[1,3],stuff:[6,8],styl:3,style:[3,4,6,9,15],stylesheet:1,stylu:3,sub:[3,9],subclass:21,subject:8,submodul:[14,28],subpackag:28,subscribe_public_top:24,subset:1,subst:3,subthread:17,subunit:3,success:26,success_al:26,success_part:26,suit:2,suitabl:9,sum:23,summari:[15,24,25,26],superlanguag:5,support:[6,8],sure:[2,5],swift:3,symbol:[2,3,9],syntact:[2,3],syntax:[1,9],system:[2,5,24],szse:22,tab:1,tabl:15,tabreplac:1,tag:[1,3,6,9,10],take:5,taken:21,tao:3,tap:3,targ:19,target:[5,21],task:21,task_queu:26,tax_coeff:24,tcl:3,tdb:26,tdx:26,tdxbroker:24,tdxrealbrok:[14,28],tdxtradeapiparam:24,team:[0,12],tell:[2,9],templat:[3,11],tend:11,termin:[9,21],test:[0,3,4,5,12],test_messag:27,test_nam:2,tex:3,text:[3,6,8,9],thei:[5,6,8],them:[6,9,11],thereof:21,thi:[0,1,2,5,6,7,8,9,10,12,16,19,21,27],thing:[6,8,9],third:[1,10],thirty_min:26,thor:3,those:1,thread:[17,21],thread_num:22,three:[0,10,12],thrift:3,through:[0,12,21],ths:26,tick:[15,19,26],till:19,time:[7,15,19,21,22,24,26],time_:26,timeout:[21,24],timestamp:26,titl:[3,6,9,26],to_addr:26,to_df:24,to_dict:24,to_hfq:19,to_protobuf:19,to_qfq:19,todai:[0,12,22],togeth:8,tool:[2,26],top:[1,5,9,11],topic:[17,26],total_d:17,toward:[0,12,15,16,19,24,26],track:4,tracker:7,trade:[15,16,17,19,24,26],trade_account:24,trade_d:19,trade_ev:26,trade_histori:17,trade_id:24,trade_list:[24,26],trade_statu:26,train:16,trait:3,transact:[19,27],transact_tim:24,transef:15,tree:[3,6],tri:6,trigger:10,truli:8,turn:6,tushar:[19,26],twice:9,twig:3,two:[2,9,10,11],tx_password:24,txt:[2,11],typ:23,type:[3,8,15,19,22,23,24,25,26],type_:[19,22,26],typescript:3,tz_awar:[15,22,25,26],ubuntu:2,undefin:1,under:[1,6,22,26],underlin:11,understand:8,unfinish:1,unhandl:21,union:27,uniqu:[6,11],unit:3,unlik:[2,9],unstyl:11,until:21,up_shadow:16,upcoming_data:[24,26],updat:[1,5,10,11,15,17,25,26],update_account:25,update_log:[0,12],upon:6,upper_shadow:23,url:26,usabl:[5,8],usag:8,usd:26,use:[1,2,5,6,8,9,11,22],usebr:1,used:[1,2,5,6,9,11],useful:[1,2,5,6,9],user:[0,3,6,12,14,15,22,24,28],user_cooki:15,user_nam:[15,26],usernam:22,uses:1,using:[1,2,6,9,10],usual:[2,6,11],utf:24,util:26,vala:3,valid:27,valid_chain:27,valid_proof:27,valu:[3,5,6,9],variabl:[3,6,9,11],varianc:16,variou:[2,6],vbnet:3,vbs:3,vbscript:3,verbatim:11,veri:6,verilog:3,version:[5,10,11,17,22,24],vhdl:3,view:[6,15],vim:3,visual:[0,2,9,12],vnd:24,vol:[16,19,23],volatil:[15,17],volatility_year:[15,17],volum:[16,19],wai:[5,6,7,8,9,15],wait:21,wan:[0,12],want:[0,7,8,11,12],warp:24,weak:23,websit:[0,12],week:[22,26],week_data:16,weekli:16,weird:7,weird_voodoo:9,welcom:[0,12],what:[9,11],when:[1,2,6,9,10,17,21],where:[2,10],whether:21,which:[0,1,2,6,9,10,12,15,24],whole:[0,2,9,12],whose:[9,21],why:8,width:9,wilson:5,win:6,wind:[22,26],winner:16,within:[1,3,8,9,11],without:[2,7,9],won:[6,9],word:[3,6],work:[2,5,6,7,8,9,10,11,27],worker:21,world:9,wors:8,worth:[6,8],would:[8,9,21],wrap:[6,9],written:[0,2,12],x86:3,x86asm:3,xdxr_data:19,xhtml:3,xjb:3,xls:3,xlsx:3,xml:[3,6],xpath:3,xqueri:3,xsd:3,xsl:3,xxxx:[0,12],year:[22,26],yes:8,yield:6,you:[0,1,2,5,7,9,11,12,21],your:[2,5,8,11],yourself:11,yutiansut:[0,12,14,22,23,24,26],yyb_id:24,yyyi:22,zep:3,zephir:3,zero:6,zone:3,zqdm:24,zsh:3,zyfw:22,zygcfx:22},titles:["QUANTAXIS quantitative financial strategy framework","Library API","Building and testing","CSS classes reference","highlight.js developer documentation","Language contributor checklist","Language definition guide","On requesting new languages","Line numbers","Mode reference","Release process","Style guide","QUANTAXIS quantitative financial strategy framework","Welcome to QUANTAXIS's documentation!","QUANTAXIS package","QUANTAXIS.QAARP package","QUANTAXIS.QAAnalysis package","QUANTAXIS.QABacktest package","QUANTAXIS.QACmd package","QUANTAXIS.QAData package","QUANTAXIS.QAData.proto package","QUANTAXIS.QAEngine package","QUANTAXIS.QAFetch package","QUANTAXIS.QAIndicator package","QUANTAXIS.QAMarket package","QUANTAXIS.QASU package","QUANTAXIS.QAUtil package","QUANTAXIS.QAWeb package","QUANTAXIS"],titleterms:{"class":[3,5],"new":7,add:5,alias:[3,9],api:1,attribut:[6,9],author:5,backtest:18,backtest_set:17,base:[22,23],base_datastruct:19,basic:2,begin:9,beginkeyword:9,block:1,broker_calend:24,build:2,case_insensit:9,chain:27,chang:5,checklist:5,classnam:9,code:5,comment:6,configur:1,contain:9,content:[14,15,16,17,18,19,20,21,22,23,24,25,26,27],continu:1,contribut:[6,11],contributor:5,creat:5,css:3,data:5,data_fq:19,data_list:22,data_resampl:19,defin:[6,11],definit:[5,6],develop:4,document:[4,13],don:11,dos:11,dsmethod:19,end:9,endspar:9,endswithpar:9,exampl:5,excludebegin:9,excludeend:9,express:6,fetcher:22,file:5,financi:[0,12],fixmarkup:1,framework:[0,12],fundament:19,gener:6,getlanguag:1,guid:[6,11],highlight:[1,4,6],highlightauto:1,highlightblock:1,host:26,ignore_illeg:1,illeg:[6,9],indic:[4,13,23],inithighlight:1,inithighlightingonload:1,kei:11,keyword:[6,9],languag:[1,3,5,6,7],languagesubset:1,layout:11,lexem:9,librari:1,line:8,listlanguag:1,main:25,markup:[2,6],meta:5,mode:[6,9],modul:[14,15,16,17,18,19,20,21,22,23,24,25,26,27],name:[1,3],note:[0,12],number:8,option:1,order_pb2:20,overview:6,packag:[14,15,16,17,18,19,20,21,22,23,24,25,26,27],pre:6,principl:11,process:10,proto:20,provid:5,pull:5,put:5,qa_web:27,qaaccount:15,qaanalysi:[16,17],qaanalysis_block:16,qaanalysis_datafram:16,qaanalysis_machinelearn:16,qaanalysis_seri:16,qaanalysis_tick:16,qaanalysis_trad:16,qaarp:15,qaauth:26,qabacktest:17,qabacktestbrok:24,qabar:26,qabrok:24,qacfg:26,qacmd:18,qacod:26,qacrawl:22,qacsv:26,qadat:26,qadata:[19,20],qadatastruct:19,qadate_trad:26,qadeal:24,qadict:26,qaeastmonei:22,qaengin:21,qaevent:21,qafetch:22,qafinanci:22,qaindic:23,qalist:26,qaloc:26,qalog:26,qamail:26,qamarket:24,qamongo:26,qaorder:24,qaorderhandl:24,qaparamet:26,qaplot:26,qaportfolio:15,qaqueri:22,qaquery_adv:22,qarandom:26,qarandombrok:24,qarealbrok:24,qaresult:17,qarisk:15,qaset:26,qasimulatedbrok:24,qasql:26,qastrategi:15,qasu:25,qatask:21,qatdx:22,qatdx_adv:22,qatext:26,qath:22,qathreadengin:21,qatrad:24,qatransform:26,qatushar:22,qauser:15,qautil:26,qaweb:[26,27],qawind:22,quantaxi:[0,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28],quantit:[0,12],realtim:22,realtimedata:19,refer:[3,5,9],registerlanguag:1,regular:6,releas:[0,10,12],relev:6,request:[5,7],returnbegin:9,returnend:9,save_account:25,save_backtest:25,save_loc:25,save_tdx:25,save_tdx_fil:25,save_tushar:25,schema:19,serial:19,shipanebrok:24,shipanecli:24,skip:9,start:9,stock_day_pb2:20,stock_min_pb2:20,strategi:[0,12],stylabl:3,style:11,sub:6,sublanguag:9,submodul:[15,16,17,18,19,20,21,22,23,24,25,26,27],subpackag:[14,19],subst:11,symbol:6,syntax:6,tabl:[4,13],tdxrealbrok:24,test:2,theme:11,txt:5,type:9,typographi:11,user:25,valu:1,variant:9,welcom:13,write:5,yourself:5}}) \ No newline at end of file diff --git a/_build/html/source/QUANTAXIS.QAARP.html b/_build/html/source/QUANTAXIS.QAARP.html new file mode 100644 index 000000000..5b5b25882 --- /dev/null +++ b/_build/html/source/QUANTAXIS.QAARP.html @@ -0,0 +1,709 @@ + + + + + + + + QUANTAXIS.QAARP package — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

QUANTAXIS.QAARP package

+
+

Submodules

+
+
+

QUANTAXIS.QAARP.QAAccount module

+
+
+class QUANTAXIS.QAARP.QAAccount.Account_handler[source]
+

Bases: object

+
+
+get_account(message)[source]
+
+ +
+ +
+
+class QUANTAXIS.QAARP.QAAccount.QA_Account(strategy_name=None, user_cookie=None, market_type='stock_cn', frequence='day', broker='backtest', portfolio_cookie=None, account_cookie=None, sell_available={}, init_assets=None, cash=None, history=None, margin_level=False, allow_t0=False, allow_sellopen=False)[source]
+

Bases: QUANTAXIS.QAEngine.QAEvent.QA_Worker

+

[QA_Account]

+
    +
  • 不再计算总资产/不再计算当前持仓/不再计算交易对照明细表
  • +
  • 不再动态计算账户股票/期货市值
  • +
  • 只维护 cash/history两个字段 剩下的全部惰性计算
  • +
+

QA_Account 是QUANTAXIS的最小不可分割单元之一

+

QA_Account是账户类 需要兼容股票/期货/指数 +QA_Account继承自QA_Worker 可以被事件驱动 +QA_Account可以直接被QA_Strategy继承

+

有三类输入: +信息类: 账户绑定的策略名/账户的用户名/账户类别/账户识别码/账户的broker +资产类: 现金/可用现金/交易历史/交易对照表 +规则类: 是否允许卖空/是否允许t0结算

+

方法: +惰性计算:最新持仓/最新总资产/最新现金/持仓面板 +生成订单/接受交易结果数据 +接收新的数据/on_bar/on_tick方法/缓存新数据的market_data

+
+
+cash_table
+

现金的table

+
+ +
+
+change_cash(money)[source]
+
+ +
+
+code
+

该账户曾交易代码 用set 去重

+
+ +
+
+current_time
+

return current time (in backtest/real environment)

+
+ +
+
+daily_cash
+

每日交易结算时的现金表

+
+ +
+
+daily_hold
+

每日交易结算时的持仓表

+
+ +
+
+end_date
+
+ +
+
+from_message(message)[source]
+

resume the account from standard message +这个是从数据库恢复账户时需要的

+
+ +
+
+history_table
+

交易历史的table

+
+ +
+
+hold
+

持仓

+
+ +
+
+latest_cash
+

return the lastest cash

+
+ +
+
+message
+

the standard message which can be transef

+
+ +
+
+on_bar(event)[source]
+

while updating the market data

+
+ +
+
+on_tick(event)[source]
+

on tick event

+
+ +
+
+receive_deal(message)[source]
+

[用于更新账户]

+

[description]

+

update history and cash

+
+ +
+
+reset_assets(init_assets=None)[source]
+

reset_history/cash/

+
+ +
+
+run(event)[source]
+

QA_WORKER method

+
+ +
+
+save()[source]
+
+ +
+
+send_order(code, amount, time, towards, price, order_model, amount_model)[source]
+

[summary]

+
+
Arguments:
+
code {[type]} -- [description] +amount {[type]} -- [description] +time {[type]} -- [description] +towards {[type]} -- [description] +price {[type]} -- [description] +order_model {[type]} -- [description] +amount_model {[type]} -- [description]
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+settle()[source]
+

同步可用资金/可卖股票

+
+ +
+
+start_date
+
+ +
+
+table
+

打印出account的内容

+
+ +
+
+trade
+

每次交易的pivot表

+
+ +
+ +
+
+

QUANTAXIS.QAARP.QAPortfolio module

+
+
+class QUANTAXIS.QAARP.QAPortfolio.QA_Portfolio(user_cookie=None, strategy_name=None, init_assets=1000000, cash=None, sell_available=None, history=None)[source]
+

Bases: object

+

QUANTAXIS 多账户 +以及组合管理

+

# 适用 回测/实盘

+

# PORTFOLIO应当作为一个视图来处理,这个视图作为一个静态的观察点 可以去衡量风险 观察业绩等等 +@2018/02/26

+

:: ::STRATEGY 1 -- ACCOUNT 1 --{P1,P3} :: +:: USER ::STRATEGY 2 -- ACCOUNT 2 --{P1,P2} :: +:: ::STRATEGY 3 -- ACCOUNT 3 --{P2,P3} :: +:::::::::::::::::::::::::::::::::::::::::::::::

+

PORTFOLIO

+

在portfolio中,我们希望通过cookie来控制account_unit

+

对于account的指标,要进行风险控制,组合成最优的投资组合的量

+

用account的cookie来管理控制account

+

portfolio里面的资产主要考虑的是 资金的分配

+
+
+add_account(account)[source]
+

portfolio add a account/stratetgy

+
+ +
+
+cookie_mangement()[source]
+
+ +
+
+get_account(cookie)[source]
+

give the account_cookie and return the account/strategy back

+
+ +
+
+get_cash()[source]
+

拿到整个portfolio的可用资金

+

统计每一个时间点的时候的cash总和

+
+ +
+
+get_portfolio()[source]
+

return the accounts dict

+
+ +
+
+new_account(account_cookie=None)[source]
+

portfolio create a account/strategy

+
+ +
+
+pull(account_cookie=None, collection=Collection(Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'), 'account'))[source]
+

pull from the databases

+
+ +
+
+push(account_cookie=None, collection=Collection(Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'), 'account'))[source]
+

push to databases

+
+ +
+
+table
+
+ +
+ +
+
+class QUANTAXIS.QAARP.QAPortfolio.QA_PortfolioView(account_list)[source]
+

Bases: object

+

对于Portfolio而言,一切都是基于内部的account的信息的变更而变更的

+

Portfolio不应该有过多可以修改的部分(作为一个view存在)

+
+ +
+ +
+
+accounts
+

return all accounts inside the portfolio view

+
+ +
+
+code
+
+ +
+
+daily_cash
+
+ +
+
+daily_hold
+
+ +
+
+end_date
+
+ +
+
+init_assets
+
+ +
+
+start_date
+
+ +
+ +
+
+class QUANTAXIS.QAARP.QAPortfolio.QA_TEST_MAKEPortfolio[source]
+

Bases: object

+
+
+make_portfolio(account_list)[source]
+
+ +
+ +
+
+

QUANTAXIS.QAARP.QARisk module

+

收益性的包括年化收益率、净利润、总盈利、总亏损、有效年化收益率、资金使用率。

+

风险性主要包括胜率、平均盈亏比、最大回撤比例、最大连续亏损次数、最大连续盈利次数、持仓时间占比、贝塔。

+

综合性指标主要包括风险收益比,夏普比例,波动率,VAR,偏度,峰度等

+
+
+class QUANTAXIS.QAARP.QARisk.QA_Performance(account)[source]
+

Bases: object

+

QA_Performance是一个绩效分析插件

+

需要加载一个account/portfolio类进来: +需要有 +code,start_date,end_date,daily_cash,daily_hold

+
+
+abnormal_active()[source]
+

账户的成交发生异常成交记录的分析

+
+ +
+
+accumulate_return
+

returns a pd-Dataframe format accumulate return for different periods

+
+ +
+
+brinson()[source]
+

Brinson Model analysis

+
+ +
+
+hold()[source]
+

持仓分析

+
+ +
+
+prefer
+
+ +
+
+save()[source]
+

save the performance analysis result to database

+
+ +
+
+style
+

风格分析

+
+ +
+ +
+
+class QUANTAXIS.QAARP.QARisk.QA_Risk(account, benchmark_code='000300', benchmark_type='index_cn')[source]
+

Bases: object

+

QARISK 是一个风险插件

+

需要加载一个account/portfolio类进来: +需要有 +code,start_date,end_date,daily_cash,daily_hold

+
+
+alpha
+

alpha比率 与市场基准收益无关的超额收益率

+
+ +
+
+annualize_return
+

年化收益

+
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+benchmark_annualize_return
+

基准组合的年化收益

+
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+benchmark_assets
+

基准组合的账户资产队列

+
+ +
+
+benchmark_data
+

基准组合的行情数据(一般是组合,可以调整)

+
+ +
+
+benchmark_profitpct
+

benchmark 基准组合的收益百分比计算

+
+ +
+
+beta
+

beta比率 组合的系统性风险

+
+ +
+
+calc_alpha(annualized_returns, benchmark_annualized_returns, beta, r=0.05)[source]
+
+ +
+
+calc_annualize_return(assets, days)[source]
+
+ +
+
+calc_beta(assest_profit, benchmark_profit)[source]
+
+ +
+
+calc_profit(assets)[source]
+
+ +
+
+calc_profitpctchange(assets)[source]
+
+ +
+
+calc_sharpe(annualized_returns, volatility_year, r=0.05)[source]
+

计算夏普比率

+
+ +
+
+calmar
+

卡玛比率

+
+ +
+
+max_dropback
+

最大回撤

+
+ +
+
+message
+
+ +
+
+profit
+
+ +
+
+profit_pct
+

利润

+
+ +
+
+save()[source]
+

save to mongodb

+
+ +
+
+set_benchmark(code, market_type)[source]
+
+ +
+
+sharpe
+

夏普比率

+
+ +
+
+sortino
+

索提诺比率 投资组合收益和下行风险比值

+
+ +
+
+volatility
+

波动率

+
+
Returns:
+
[type] -- [description]
+
+
+ +
+ +
+
+

QUANTAXIS.QAARP.QAStrategy module

+
+
+class QUANTAXIS.QAARP.QAStrategy.QA_Strategy[source]
+

Bases: QUANTAXIS.QAARP.QAAccount.QA_Account

+

account

+

[description]

+
+ +
+
+

QUANTAXIS.QAARP.QAUser module

+
+
+class QUANTAXIS.QAARP.QAUser.QA_User[source]
+

Bases: object

+

User--Portfolio--Account/Strategy

+
+
+client()[source]
+

user.client to connect database

+
+ +
+
+connect_database(ip='127.0.0.1', port=27017)[source]
+

connect is also a way to change database from IP_A to IP_B

+
+ +
+
+generate_simpleaccount()[source]
+

make a simple account with a easier way +如果当前user中没有创建portfolio, 则创建一个portfolio,并用此portfolio创建一个account +如果已有一个或多个portfolio,则使用第一个portfolio来创建一个account

+
+ +
+
+get_portfolio(portfolio)[source]
+

get a portfolio

+
+ +
+
+login(user_name, password)[source]
+

login to a database

+
+ +
+
+new_portfolio()[source]
+

create a portfolio

+
+ +
+
+register_account(account)[source]
+
+ +
+
+table
+
+ +
+ +
+
+

Module contents

+
+
+ + +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/source/QUANTAXIS.QAAnalysis.html b/_build/html/source/QUANTAXIS.QAAnalysis.html new file mode 100644 index 000000000..2f351760d --- /dev/null +++ b/_build/html/source/QUANTAXIS.QAAnalysis.html @@ -0,0 +1,439 @@ + + + + + + + + QUANTAXIS.QAAnalysis package — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

QUANTAXIS.QAAnalysis package

+
+

Submodules

+
+
+

QUANTAXIS.QAAnalysis.QAAnalysis_block module

+
+
+class QUANTAXIS.QAAnalysis.QAAnalysis_block.QAAnalysis_block(block=None, block_name=None, lens=90, *args, **kwargs)[source]
+

Bases: object

+
+
+block_pcg(market_data=None)[source]
+
+ +
+
+block_price(market_data=None)[source]
+
+ +
+
+block_turnover(market_data=None)[source]
+
+ +
+
+market_data(start, end, _type='day')[source]
+
+ +
+
+month_data
+

this monthly data

+
+ +
+
+res()[source]
+
+ +
+
+stock_info()[source]
+
+ +
+
+stock_turnover(market_data=None)[source]
+
+ +
+
+week_data
+

this weekly data

+
+ +
+ +
+
+class QUANTAXIS.QAAnalysis.QAAnalysis_block.QAAnalysis_codewithblock(block)[source]
+

Bases: object

+
+ +
+
+QUANTAXIS.QAAnalysis.QAAnalysis_block.get_gap_trade(gap)[source]
+
+ +
+
+

QUANTAXIS.QAAnalysis.QAAnalysis_dataframe module

+
+
+class QUANTAXIS.QAAnalysis.QAAnalysis_dataframe.QAAnalysis_stock(dataStruct, *args, **kwargs)[source]
+

Bases: object

+

行情分析器

+

计算所有的指标

+
+
+add_func[source]
+
+ +
+
+amplitude
+
+ +
+
+close
+
+ +
+
+date
+
+ +
+
+datetime
+
+ +
+
+day_pct_change
+
+ +
+
+high
+
+ +
+
+index
+
+ +
+
+kurtosis
+
+ +
+
+low
+
+ +
+
+mad
+
+ +
+
+max
+
+ +
+
+mean
+
+ +
+
+mean_harmonic
+
+ +
+
+min
+
+ +
+
+mode
+
+ +
+
+open
+
+ +
+
+pct_change
+
+ +
+
+price
+
+ +
+
+price_diff
+
+ +
+
+pstdev
+
+ +
+
+pvariance
+
+ +
+
+skewnewss
+
+ +
+
+stdev
+
+ +
+
+variance
+
+ +
+
+vol
+
+ +
+
+volume
+
+ +
+ +
+
+class QUANTAXIS.QAAnalysis.QAAnalysis_dataframe.shadow(data)[source]
+

Bases: object

+
+
+shadow_panel()[source]
+
+ +
+ +
+
+QUANTAXIS.QAAnalysis.QAAnalysis_dataframe.shadow_calc(data)[source]
+

计算上下影线

+
+
Arguments:
+
data {DataStruct.slice} -- 输入的是一个行情切片
+
Returns:
+
up_shadow {float} -- 上影线 +down_shdow {float} -- 下影线 +entity {float} -- 实体部分 +date {str} -- 时间 +code {str} -- 代码
+
+
+ +
+
+

QUANTAXIS.QAAnalysis.QAAnalysis_machinelearning module

+

一个通用的可以接入不同模型的类

+
+
+class QUANTAXIS.QAAnalysis.QAAnalysis_machinelearning.QAAnalysis_Machine_Learning(*args, **kwargs)[source]
+

Bases: object

+
+
+cross_valid()[source]
+
+ +
+
+data_co()[source]
+
+ +
+
+load_data()[source]
+
+ +
+
+load_modules()[source]
+
+ +
+
+training()[source]
+
+ +
+ +
+
+

QUANTAXIS.QAAnalysis.QAAnalysis_series module

+
+
+QUANTAXIS.QAAnalysis.QAAnalysis_series.QAAnalysis_Series_slope(data)[source]
+
+ +
+
+

QUANTAXIS.QAAnalysis.QAAnalysis_tick module

+
+
+class QUANTAXIS.QAAnalysis.QAAnalysis_tick.QAAnalysis_Transaction[source]
+

Bases: object

+
+
+get_data(code, start, end)[source]
+
+ +
+
+get_stock_info(code)[source]
+
+ +
+
+winner()[source]
+
+ +
+ +
+
+

QUANTAXIS.QAAnalysis.QAAnalysis_trade module

+
+
+class QUANTAXIS.QAAnalysis.QAAnalysis_trade.QAAnalysis_trade(init_assets, *args, **kwargs)[source]
+

Bases: object

+

Account/Portfolio是一个标准单元,所有成交记录分析 都会被加载到该单元中进行分析 +当我们只有一个成交记录的时候,我们会创建一个账户单元

+
+
+import_trade(trade)[source]
+

trade是一个可迭代的list/generator

+
+ +
+
+make_deal(code, datetime, amount=100, towards=1, price=0, order_model='market', amount_model='by_amount')[source]
+

这是一个一定会成交,并且立刻结转(及t+0)的交易入口

+
+ +
+ +
+
+

Module contents

+
+
+ + +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/source/QUANTAXIS.QABacktest.html b/_build/html/source/QUANTAXIS.QABacktest.html new file mode 100644 index 000000000..47abd7b39 --- /dev/null +++ b/_build/html/source/QUANTAXIS.QABacktest.html @@ -0,0 +1,340 @@ + + + + + + + + QUANTAXIS.QABacktest package — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

QUANTAXIS.QABacktest package

+
+

Submodules

+
+
+

QUANTAXIS.QABacktest.QAAnalysis module

+

Analysis Center for Backtest +we will give some function

+
+
+QUANTAXIS.QABacktest.QAAnalysis.QA_backtest_analysis_backtest(client, code_list, assets_d, account_days, message, total_date, benchmark_data)[source]
+

Annualized Returns: 策略年化收益率。表示投资期限为一年的预期收益率。 +具体计算方式为 (策略最终价值 / 策略初始价值)^(250 / 回测交易日数量) - 1

+

Alpha:阿尔法 +具体计算方式为 (策略年化收益 - 无风险收益) - beta × (参考标准年化收益 - 无风险收益),这里的无风险收益指的是中国固定利率国债收益率曲线上10年期国债的年化到期收益率。

+

Beta:贝塔 +具体计算方法为 策略每日收益与参考标准每日收益的协方差 / 参考标准每日收益的方差 。

+

Sharpe Ratio:夏普比率。表示每承受一单位总风险,会产生多少的超额报酬。 +具体计算方法为 (策略年化收益率 - 回测起始交易日的无风险利率) / 策略收益波动率 。

+

Volatility:策略收益波动率。用来测量资产的风险性。 +具体计算方法为 策略每日收益的年化标准差 。

+

Information Ratio:信息比率。衡量超额风险带来的超额收益。 +具体计算方法为 (策略每日收益 - 参考标准每日收益)的年化均值 / 年化标准差 。

+

Max Drawdown:最大回撤。描述策略可能出现的最糟糕的情况。 +具体计算方法为 max(1 - 策略当日价值 / 当日之前虚拟账户最高价值)

+

单次交易收益 +收益/次数的频次直方图 +单日最大持仓

+
+ +
+
+QUANTAXIS.QABacktest.QAAnalysis.QA_backtest_calc_alpha(annualized_returns, benchmark_annualized_returns, beta, r)[source]
+
+ +
+
+QUANTAXIS.QABacktest.QAAnalysis.QA_backtest_calc_assets(trade_history, assets)[source]
+
+ +
+
+QUANTAXIS.QABacktest.QAAnalysis.QA_backtest_calc_benchmark(benchmark_data, init_assets)[source]
+
+ +
+
+QUANTAXIS.QABacktest.QAAnalysis.QA_backtest_calc_beta(assest_profit, benchmark_profit)[source]
+
+ +
+
+QUANTAXIS.QABacktest.QAAnalysis.QA_backtest_calc_dropback_max(history)[source]
+
+ +
+
+QUANTAXIS.QABacktest.QAAnalysis.QA_backtest_calc_profit(assest_history)[source]
+
+ +
+
+QUANTAXIS.QABacktest.QAAnalysis.QA_backtest_calc_profit_matrix(assest_history)[source]
+
+ +
+
+QUANTAXIS.QABacktest.QAAnalysis.QA_backtest_calc_profit_per_year(assest_history, days)[source]
+
+ +
+
+QUANTAXIS.QABacktest.QAAnalysis.QA_backtest_calc_sharpe(annualized_returns, r, volatility_year)[source]
+

计算夏普比率

+
+ +
+
+QUANTAXIS.QABacktest.QAAnalysis.QA_backtest_calc_trade_date(history)[source]
+

计算交易日期

+
+ +
+
+QUANTAXIS.QABacktest.QAAnalysis.QA_backtest_calc_volatility(assest_profit_matrix)[source]
+
+ +
+
+QUANTAXIS.QABacktest.QAAnalysis.QA_backtest_calc_win_rate(profit_day)[source]
+
+ +
+
+QUANTAXIS.QABacktest.QAAnalysis.calc_every_pnl(detail)[source]
+
+ +
+
+QUANTAXIS.QABacktest.QAAnalysis.calc_trade_time(history)[source]
+
+ +
+
+

QUANTAXIS.QABacktest.QABacktest module

+
+
+class QUANTAXIS.QABacktest.QABacktest.BACKTEST_FRAMEWORK[source]
+

Bases: object

+
+ +
+
+class QUANTAXIS.QABacktest.QABacktest.QA_Backtest(market_type, frequence, start, end, code_list, commission_fee)[source]
+

Bases: object

+

BACKTEST

+

BACKTEST的主要目的:

+
    +
  • +
    引入时间轴环境,获取全部的数据,然后按生成器将数据迭代插入回测的BROKER
    +
    (这一个过程是模拟在真实情况中市场的时间变化和价格变化)
    +
    +
  • +
  • BROKER有了新数据以后 会通知MARKET交易前置,MARKET告知已经注册的所有的ACCOUNT 有新的市场数据
  • +
  • ACCOUNT 获取了新的市场函数,并将其插入他已有的数据中(update)
  • +
  • ACCOUNT 底下注册的策略STRATEGY根据新的市场函数,产生新的买卖判断,综合生成信号
  • +
  • 买卖判断通过交易前置发送给对应的BROKER,进行交易
  • +
  • BROKER发送SETTLE指令 结束这一个bar的所有交易,进行清算
  • +
  • 账户也进行清算,更新持仓,可卖,可用现金等
  • +
  • 迭代循环直至结束回测
  • +
  • 回测去计算这段时间的各个账户收益,并给出综合的最终结果
  • +
+
+
+after_success()[source]
+

called when all trading fininshed, for performance analysis

+
+ +
+
+run()[source]
+

generator driven data flow

+
+ +
+
+start_market()[source]
+

start the market thread and register backtest broker thread

+
+ +
+
+stop()[source]
+

stop all the market trade enging threads and all subthreads

+
+ +
+ +
+
+

QUANTAXIS.QABacktest.QAResult module

+
+
+class QUANTAXIS.QABacktest.QAResult.backtest_result_analyzer(cookie_id, *args, **kwargs)[source]
+

Bases: object

+
+
+codes
+
+ +
+
+detail
+
+ +
+
+get_loss_trade(num=5)[source]
+
+ +
+
+get_profit_trade(num=5)[source]
+
+ +
+
+get_stock_tradedetail(code)[source]
+
+ +
+
+get_stock_tradehistory(code)[source]
+
+ +
+
+get_trade_before_and_after_pnl(rx, N=3, M=10)[source]
+
+ +
+
+get_trade_marketdata(rx, gap=3)[source]
+
+ +
+
+history
+
+ +
+ +
+
+

QUANTAXIS.QABacktest.backtest_setting module

+
+
+class QUANTAXIS.QABacktest.backtest_setting.backtest_setting(topic, version, backtest_name, sql_setting)[source]
+

Bases: object

+
+
+absoult_path
+
+ +
+
+database_uri
+
+ +
+
+dirs
+
+ +
+ +
+
+

Module contents

+
+
+ + +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/source/QUANTAXIS.QACmd.html b/_build/html/source/QUANTAXIS.QACmd.html new file mode 100644 index 000000000..03b8e0346 --- /dev/null +++ b/_build/html/source/QUANTAXIS.QACmd.html @@ -0,0 +1,215 @@ + + + + + + + + QUANTAXIS.QACmd package — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

QUANTAXIS.QACmd package

+
+

Submodules

+
+
+

QUANTAXIS.QACmd.backtest module

+
+
+

Module contents

+
+
+class QUANTAXIS.QACmd.CLI[source]
+

Bases: cmd.Cmd

+
+
+do_clean(arg)[source]
+
+ +
+
+do_drop_database(arg)[source]
+
+ +
+
+do_examples(arg)[source]
+
+ +
+
+do_exit(arg)[source]
+
+ +
+
+do_fn(arg)[source]
+
+ +
+
+do_help(arg)[source]
+

List available commands with "help" or detailed help with "help cmd".

+
+ +
+
+do_quit(arg)[source]
+
+ +
+
+do_save(arg)[source]
+
+ +
+
+do_shell(arg)[source]
+

run a shell commad

+
+ +
+
+do_version(arg)[source]
+
+ +
+
+help()[source]
+
+ +
+
+help_clean()[source]
+
+ +
+
+help_drop_database()[source]
+
+ +
+
+help_examples()[source]
+
+ +
+
+help_exit()[source]
+
+ +
+
+help_quit()[source]
+
+ +
+
+help_save()[source]
+
+ +
+
+help_version()[source]
+
+ +
+ +
+
+QUANTAXIS.QACmd.QA_cmd()[source]
+
+ +
+
+QUANTAXIS.QACmd.sourcecpy(src, des)[source]
+
+ +
+
+ + +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/source/QUANTAXIS.QAData.html b/_build/html/source/QUANTAXIS.QAData.html new file mode 100644 index 000000000..3116483d0 --- /dev/null +++ b/_build/html/source/QUANTAXIS.QAData.html @@ -0,0 +1,1096 @@ + + + + + + + + QUANTAXIS.QAData package — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

QUANTAXIS.QAData package

+ +
+

Submodules

+
+
+

QUANTAXIS.QAData.QADataStruct module

+

定义一些可以扩展的数据结构

+

方便序列化/相互转换

+
+
+class QUANTAXIS.QAData.QADataStruct.QA_DataStruct_Future_day(DataFrame, dtype='future_day', if_fq='')[source]
+

Bases: QUANTAXIS.QAData.base_datastruct._quotation_base

+
+ +
+
+class QUANTAXIS.QAData.QADataStruct.QA_DataStruct_Future_min(DataFrame, dtype='future_min', if_fq='')[source]
+

Bases: QUANTAXIS.QAData.base_datastruct._quotation_base

+

struct for future

+
+ +
+
+class QUANTAXIS.QAData.QADataStruct.QA_DataStruct_Index_day(DataFrame, dtype='index_day', if_fq='')[source]
+

Bases: QUANTAXIS.QAData.base_datastruct._quotation_base

+

自定义的日线数据结构

+
+ +
+
+class QUANTAXIS.QAData.QADataStruct.QA_DataStruct_Index_min(DataFrame, dtype='index_min', if_fq='')[source]
+

Bases: QUANTAXIS.QAData.base_datastruct._quotation_base

+

自定义的分钟线数据结构

+
+ +
+
+class QUANTAXIS.QAData.QADataStruct.QA_DataStruct_Security_list(DataFrame)[source]
+

Bases: object

+
+
+code
+
+ +
+
+get_etf()[source]
+
+ +
+
+get_index()[source]
+
+ +
+
+get_stock(ST_option)[source]
+
+ +
+
+name
+
+ +
+ +
+
+class QUANTAXIS.QAData.QADataStruct.QA_DataStruct_Stock_block(DataFrame)[source]
+

Bases: object

+
+
+block_name
+

返回所有的板块名

+
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+code
+

返回唯一的证券代码

+
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+get_block(_block_name)[source]
+

getblock 获取板块

+
+
Arguments:
+
_block_name {[type]} -- [description]
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+get_code(code)[source]
+

getcode 获取某一只股票的板块

+
+
Arguments:
+
code {str} -- 股票代码
+
Returns:
+
DataStruct -- [description]
+
+
+ +
+
+get_price(_block_name=None)[source]
+
+
Keyword Arguments:
+
_block_name {[type]} -- [description] (default: {None})
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+getdtype(dtype)[source]
+
+
Arguments:
+
dtype {str} -- gn-概念/dy-地域/fg-风格/zs-指数
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+len
+

返回DataStruct的长度

+
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+show()[source]
+

展示DataStruct

+
+
Returns:
+
dataframe -- [description]
+
+
+ +
+ +
+
+class QUANTAXIS.QAData.QADataStruct.QA_DataStruct_Stock_day(DataFrame, dtype='stock_day', if_fq='bfq')[source]
+

Bases: QUANTAXIS.QAData.base_datastruct._quotation_base

+

this is a datastruct for stock_day

+
+
+high_limit
+

涨停价

+
+ +
+
+low_limit
+

跌停价

+
+ +
+
+next_day_high_limit
+

明日涨停价

+
+ +
+
+next_day_low_limit
+

明日跌停价

+
+ +
+
+preclose
+
+ +
+
+price_chg
+
+ +
+
+to_hfq()[source]
+
+ +
+
+to_qfq()[source]
+
+ +
+ +
+
+class QUANTAXIS.QAData.QADataStruct.QA_DataStruct_Stock_min(DataFrame, dtype='stock_min', if_fq='bfq')[source]
+

Bases: QUANTAXIS.QAData.base_datastruct._quotation_base

+
+
+high_limit
+

涨停价

+
+ +
+
+low_limit
+

跌停价

+
+ +
+
+to_hfq()[source]
+
+ +
+
+to_qfq()[source]
+
+ +
+ +
+
+class QUANTAXIS.QAData.QADataStruct.QA_DataStruct_Stock_realtime(market_data)[source]
+

Bases: QUANTAXIS.QAData.QADataStruct._realtime_base

+
+
+ab_board
+

ask_bid board +bid3 bid_vol3 +bid2 bid_vol2 +bid1 bid_vol1 +=============== +price /cur_vol +=============== +ask1 ask_vol1 +ask2 ask_vol2 +ask3 ask_vol3

+
+ +
+
+serialize()[source]
+

to_protobuf

+
+ +
+ +
+
+class QUANTAXIS.QAData.QADataStruct.QA_DataStruct_Stock_realtime_series(sr_series)[source]
+

Bases: object

+
+ +
+
+class QUANTAXIS.QAData.QADataStruct.QA_DataStruct_Stock_transaction(DataFrame)[source]
+

Bases: object

+
+
+amount
+

return current tick trading amount

+
+
Decorators:
+
lru_cache
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+buyorsell
+

return the buy or sell towards 0--buy 1--sell 2--none

+
+
Decorators:
+
lru_cache
+
Returns:
+
[pd.Series] -- [description]
+
+
+ +
+
+date
+

return the date of transaction

+
+
Decorators:
+
lru_cache
+
Returns:
+
pd.Series -- date of transaction
+
+
+ +
+
+datetime
+

return the datetime of transaction

+
+
Decorators:
+
lru_cache
+
Returns:
+
pd.Series -- [description]
+
+
+ +
+
+get_big_orders(bigamount=1000000)[source]
+

return big order

+
+
Keyword Arguments:
+
bigamount {[type]} -- [description] (default: {1000000})
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+get_medium_order(lower=200000, higher=1000000)[source]
+

return medium

+
+
Keyword Arguments:
+
lower {[type]} -- [description] (default: {200000}) +higher {[type]} -- [description] (default: {1000000})
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+get_small_order(smallamount=200000)[source]
+

return small level order

+
+
Keyword Arguments:
+
smallamount {[type]} -- [description] (default: {200000})
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+get_time(start, end=None)[source]
+
+ +
+
+index
+

return the transaction index

+
+
Decorators:
+
lru_cache
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+order
+

return the order num of transaction/ for everyday change

+
+
Decorators:
+
lru_cache
+
Returns:
+
pd.series -- [description]
+
+
+ +
+
+price
+

return the deal price of tick transaction

+
+
Decorators:
+
lru_cache
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+resample(type_='1min')[source]
+

resample methods

+
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+time
+

return the exact time of transaction(to minute level)

+
+
Decorators:
+
lru_cache
+
Returns:
+
pd.Series -- till minute level
+
+
+ +
+
+vol
+

return the deal volume of tick

+
+
Decorators:
+
lru_cache
+
Returns:
+
pd.Series -- volume of transaction
+
+
+ +
+
+volume
+

return the deal volume of tick

+
+
Decorators:
+
lru_cache
+
Returns:
+
pd.Series -- volume of transaction
+
+
+ +
+ +
+
+

QUANTAXIS.QAData.base_datastruct module

+
+
+

QUANTAXIS.QAData.data_fq module

+
+
+QUANTAXIS.QAData.data_fq.QA_data_get_hfq(code, start, end)[source]
+

使用网络数据进行复权/需要联网

+
+ +
+
+QUANTAXIS.QAData.data_fq.QA_data_get_qfq(code, start, end)[source]
+

使用网络数据进行复权/需要联网

+
+ +
+
+QUANTAXIS.QAData.data_fq.QA_data_make_hfq(bfq_data, xdxr_data)[source]
+

使用数据库数据进行复权

+
+ +
+
+QUANTAXIS.QAData.data_fq.QA_data_make_qfq(bfq_data, xdxr_data)[source]
+

使用数据库数据进行复权

+
+ +
+
+QUANTAXIS.QAData.data_fq.QA_data_stock_to_fq(__data, type_='01')[source]
+
+ +
+
+

QUANTAXIS.QAData.data_resample module

+
+
+QUANTAXIS.QAData.data_resample.QA_data_tick_resample(tick, type_='1min')[source]
+

tick采样成任意级别分钟线

+
+
Arguments:
+
tick {[type]} -- transaction
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+

QUANTAXIS.QAData.dsmethods module

+

DataStruct的方法

+
+
+QUANTAXIS.QAData.dsmethods.concat(lists)[source]
+

类似于pd.concat 用于合并一个list里面的多个DataStruct,会自动去重

+
+
Arguments:
+
lists {[type]} -- [DataStruct1,DataStruct2,....,DataStructN]
+
Returns:
+
[type] -- new DataStruct
+
+
+ +
+
+QUANTAXIS.QAData.dsmethods.from_tushare(dataframe, dtype='day')[source]
+

dataframe from tushare

+
+
Arguments:
+
dataframe {[type]} -- [description]
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+

QUANTAXIS.QAData.fundamental module

+
+
+

QUANTAXIS.QAData.realtimedata module

+
+
+

QUANTAXIS.QAData.schema module

+
+
+class QUANTAXIS.QAData.schema.Shares(**kwargs)[source]
+

Bases: sqlalchemy.ext.declarative.api.Base

+
+
+circulation
+
+ +
+
+effective_date
+
+ +
+
+shares
+
+ +
+
+sid
+
+ +
+ +
+
+class QUANTAXIS.QAData.schema.full(**kwargs)[source]
+

Bases: sqlalchemy.ext.declarative.api.Base

+
+
+adratio
+
+ +
+
+arturndays
+
+ +
+
+arturnover
+
+ +
+
+bips
+
+ +
+
+business_income
+
+ +
+
+bvps
+
+ +
+
+cashflowratio
+
+ +
+
+cashratio
+
+ +
+
+cf_liabilities
+
+ +
+
+cf_nm
+
+ +
+
+cf_sales
+
+ +
+
+code
+
+ +
+
+currentasset_days
+
+ +
+
+currentasset_turnover
+
+ +
+
+currentratio
+
+ +
+
+distrib
+
+ +
+
+epcf
+
+ +
+
+eps
+
+ +
+
+eps_yoy
+
+ +
+
+epsg
+
+ +
+
+gross_profit_rate
+
+ +
+
+icratio
+
+ +
+
+inventory_days
+
+ +
+
+inventory_turnover
+
+ +
+
+mbrg
+
+ +
+
+name
+
+ +
+
+nav
+
+ +
+
+net_profit_ratio
+
+ +
+
+net_profits
+
+ +
+
+nprg
+
+ +
+
+profits_yoy
+
+ +
+
+quarter
+
+ +
+
+quickratio
+
+ +
+
+rateofreturn
+
+ +
+
+report_date
+
+ +
+
+roe
+
+ +
+
+seg
+
+ +
+
+sheqratio
+
+ +
+
+targ
+
+ +
+
+trade_date
+
+ +
+ +
+
+class QUANTAXIS.QAData.schema.fundamental(**kwargs)[source]
+

Bases: sqlalchemy.ext.declarative.api.Base

+
+
+adratio
+
+ +
+
+arturndays
+
+ +
+
+arturnover
+
+ +
+
+bips
+
+ +
+
+business_income
+
+ +
+
+bvps
+
+ +
+
+cashflowratio
+
+ +
+
+cashratio
+
+ +
+
+cf_liabilities
+
+ +
+
+cf_nm
+
+ +
+
+cf_sales
+
+ +
+
+code
+
+ +
+
+currentasset_days
+
+ +
+
+currentasset_turnover
+
+ +
+
+currentratio
+
+ +
+
+distrib
+
+ +
+
+epcf
+
+ +
+
+eps
+
+ +
+
+eps_yoy
+
+ +
+
+epsg
+
+ +
+
+gross_profit_rate
+
+ +
+
+icratio
+
+ +
+
+inventory_days
+
+ +
+
+inventory_turnover
+
+ +
+
+mbrg
+
+ +
+
+name
+
+ +
+
+nav
+
+ +
+
+net_profit_ratio
+
+ +
+
+net_profits
+
+ +
+
+nprg
+
+ +
+
+profits_yoy
+
+ +
+
+quarter
+
+ +
+
+quickratio
+
+ +
+
+rateofreturn
+
+ +
+
+report_date
+
+ +
+
+roe
+
+ +
+
+seg
+
+ +
+
+sheqratio
+
+ +
+
+targ
+
+ +
+ +
+
+

QUANTAXIS.QAData.serialize module

+
+
+

Module contents

+
+
+ + +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/source/QUANTAXIS.QAData.proto.html b/_build/html/source/QUANTAXIS.QAData.proto.html new file mode 100644 index 000000000..c319d283d --- /dev/null +++ b/_build/html/source/QUANTAXIS.QAData.proto.html @@ -0,0 +1,115 @@ + + + + + + + + QUANTAXIS.QAData.proto package — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

QUANTAXIS.QAData.proto package

+
+

Submodules

+
+
+

QUANTAXIS.QAData.proto.order_pb2 module

+
+
+

QUANTAXIS.QAData.proto.stock_day_pb2 module

+
+
+

QUANTAXIS.QAData.proto.stock_min_pb2 module

+
+
+

Module contents

+
+
+ + +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/source/QUANTAXIS.QAEngine.html b/_build/html/source/QUANTAXIS.QAEngine.html new file mode 100644 index 000000000..5beca4548 --- /dev/null +++ b/_build/html/source/QUANTAXIS.QAEngine.html @@ -0,0 +1,298 @@ + + + + + + + + QUANTAXIS.QAEngine package — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

QUANTAXIS.QAEngine package

+
+

Submodules

+
+
+

QUANTAXIS.QAEngine.QAEvent module

+
+
+class QUANTAXIS.QAEngine.QAEvent.QA_Event(event_type=None, func=None, message=None, callback=False, *args, **kwargs)[source]
+

Bases: object

+
+ +
+
+class QUANTAXIS.QAEngine.QAEvent.QA_Worker[source]
+

Bases: object

+

JOB是worker 需要接受QA_EVENT 需要完善RUN方法

+
+
+run(event)[source]
+
+ +
+ +
+
+

QUANTAXIS.QAEngine.QATask module

+
+
+class QUANTAXIS.QAEngine.QATask.QA_Task(worker, event, engine=None, callback=False)[source]
+

Bases: object

+
+
+do()[source]
+
+ +
+
+result
+
+ +
+ +
+
+

QUANTAXIS.QAEngine.QAThreadEngine module

+
+
+class QUANTAXIS.QAEngine.QAThreadEngine.QA_Engine(queue=None, *args, **kwargs)[source]
+

Bases: QUANTAXIS.QAEngine.QAThreadEngine.QA_Thread

+
+
+clear()[source]
+
+ +
+
+create_kernal(name)[source]
+
+ +
+
+join()[source]
+

Wait until the thread terminates.

+

This blocks the calling thread until the thread whose join() method is +called terminates -- either normally or through an unhandled exception +or until the optional timeout occurs.

+

When the timeout argument is present and not None, it should be a +floating point number specifying a timeout for the operation in seconds +(or fractions thereof). As join() always returns None, you must call +isAlive() after join() to decide whether a timeout happened -- if the +thread is still alive, the join() call timed out.

+

When the timeout argument is not present or None, the operation will +block until the thread terminates.

+

A thread can be join()ed many times.

+

join() raises a RuntimeError if an attempt is made to join the current +thread as that would cause a deadlock. It is also an error to join() a +thread before it has been started and attempts to do so raises the same +exception.

+
+ +
+
+kernel_num
+
+ +
+
+pause()[source]
+
+ +
+
+register_kernal(name, kernal)[source]
+
+ +
+
+resume()[source]
+
+ +
+
+run()[source]
+

Method representing the thread's activity.

+

You may override this method in a subclass. The standard run() method +invokes the callable object passed to the object's constructor as the +target argument, if any, with sequential and keyword arguments taken +from the args and kwargs arguments, respectively.

+
+ +
+
+run_job(task)[source]
+
+ +
+
+start_kernal(name)[source]
+
+ +
+
+stop()[source]
+
+ +
+
+stop_all()[source]
+
+ +
+
+stop_kernal(name)[source]
+
+ +
+ +
+
+class QUANTAXIS.QAEngine.QAThreadEngine.QA_Thread(queue=None, name=None)[source]
+

Bases: threading.Thread

+

这是一个随意新建线程的生产者消费者模型

+
+
+get(task)[source]
+
+ +
+
+get_nowait(task)[source]
+
+ +
+
+pause()[source]
+
+ +
+
+put(task)[source]
+
+ +
+
+put_nowait(task)[source]
+
+ +
+
+qsize()[source]
+
+ +
+
+resume()[source]
+
+ +
+
+run()[source]
+

Method representing the thread's activity.

+

You may override this method in a subclass. The standard run() method +invokes the callable object passed to the object's constructor as the +target argument, if any, with sequential and keyword arguments taken +from the args and kwargs arguments, respectively.

+
+ +
+
+stop()[source]
+
+ +
+ +
+
+

Module contents

+
+
+ + +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/source/QUANTAXIS.QAFetch.html b/_build/html/source/QUANTAXIS.QAFetch.html new file mode 100644 index 000000000..3ff3bebef --- /dev/null +++ b/_build/html/source/QUANTAXIS.QAFetch.html @@ -0,0 +1,909 @@ + + + + + + + + QUANTAXIS.QAFetch package — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

QUANTAXIS.QAFetch package

+
+

Submodules

+
+
+

QUANTAXIS.QAFetch.Fetcher module

+

QA fetch module

+

@yutiansut

+

QAFetch is Under [QAStandard#0.0.2@10x] Protocol

+
+
+class QUANTAXIS.QAFetch.Fetcher.QA_Fetcher(ip='127.0.0.1', port=27017, username='', password='')[source]
+

Bases: object

+
+
+change_ip(ip, port)[source]
+
+ +
+
+get_info(code, frequence, market, source, output)[source]
+
+ +
+
+get_quotation(code=None, start=None, end=None, frequence=None, market=None, source=None, output=None)[source]
+
+
Arguments:
+
code {str/list} -- 证券/股票的代码 +start {str} -- 开始日期 +end {str} -- 结束日期 +frequence {enum} -- 频率 QA.FREQUENCE +market {enum} -- 市场 QA.MARKET_TYPE +source {enum} -- 来源 QA.DATASOURCE +output {enum} -- 输出类型 QA.OUTPUT_FORMAT
+
+
+ +
+ +
+
+QUANTAXIS.QAFetch.Fetcher.QA_quotation(code, start, end, frequence, market, source, output)[source]
+

一个统一的fetch

+
+
Arguments:
+
code {str/list} -- 证券/股票的代码 +start {str} -- 开始日期 +end {str} -- 结束日期 +frequence {enum} -- 频率 QA.FREQUENCE +market {enum} -- 市场 QA.MARKET_TYPE +source {enum} -- 来源 QA.DATASOURCE +output {enum} -- 输出类型 QA.OUTPUT_FORMAT
+
+
+ +
+
+

QUANTAXIS.QAFetch.QACrawler module

+
+
+QUANTAXIS.QAFetch.QACrawler.QA_fetch_get_sh_margin(date)[source]
+

return shanghai margin data

+
+
Arguments:
+
date {str YYYY-MM-DD} -- date format
+
Returns:
+
pandas.DataFrame -- res for margin data
+
+
+ +
+
+QUANTAXIS.QAFetch.QACrawler.QA_fetch_get_sz_margin(date)[source]
+

return shenzhen margin data

+
+
Arguments:
+
date {str YYYY-MM-DD} -- date format
+
Returns:
+
pandas.DataFrame -- res for margin data
+
+
+ +
+
+

QUANTAXIS.QAFetch.QAEastMoney module

+
+
+QUANTAXIS.QAFetch.QAEastMoney.QA_fetch_get_stock_analysis(code)[source]
+

'zyfw', 主营范围 'jyps'#经营评述 'zygcfx' 主营构成分析

+

date 主营构成 主营收入(元) 收入比例cbbl 主营成本(元) 成本比例 主营利润(元) 利润比例 毛利率(%) +行业 /产品/ 区域 hq cp qy

+
+ +
+
+

QUANTAXIS.QAFetch.QAQuery module

+
+
+QUANTAXIS.QAFetch.QAQuery.QA_fetch_account(message={}, db=Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'))[source]
+

get the account

+
+
Arguments:
+
query_mes {[type]} -- [description]
+
Keyword Arguments:
+
collection {[type]} -- [description] (default: {DATABASE})
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+QUANTAXIS.QAFetch.QAQuery.QA_fetch_backtest_history(cookie=None, collections=Collection(Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'), 'backtest_history'))[source]
+
+ +
+
+QUANTAXIS.QAFetch.QAQuery.QA_fetch_backtest_info(user=None, account_cookie=None, strategy=None, stock_list=None, collections=Collection(Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'), 'backtest_info'))[source]
+
+ +
+
+QUANTAXIS.QAFetch.QAQuery.QA_fetch_future_day()[source]
+
+ +
+
+QUANTAXIS.QAFetch.QAQuery.QA_fetch_future_min()[source]
+
+ +
+
+QUANTAXIS.QAFetch.QAQuery.QA_fetch_future_tick()[source]
+
+ +
+
+QUANTAXIS.QAFetch.QAQuery.QA_fetch_index_day(code, start, end, format='numpy', collections=Collection(Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'), 'index_day'))[source]
+

获取指数日线

+
+ +
+
+QUANTAXIS.QAFetch.QAQuery.QA_fetch_index_min(code, start, end, format='numpy', frequence='1min', collections=Collection(Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'), 'index_min'))[source]
+

获取股票分钟线

+
+ +
+
+QUANTAXIS.QAFetch.QAQuery.QA_fetch_indexlist_day(stock_list, date_range, collections=Collection(Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'), 'index_day'))[source]
+

获取多个股票的日线

+
+ +
+
+QUANTAXIS.QAFetch.QAQuery.QA_fetch_quotation(code, date=datetime.date(2018, 5, 7), db=Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'))[source]
+

获取某一只实时5档行情的存储结果

+
+ +
+
+QUANTAXIS.QAFetch.QAQuery.QA_fetch_quotations(date=datetime.date(2018, 5, 7), db=Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'))[source]
+

获取全部实时5档行情的存储结果

+
+ +
+
+QUANTAXIS.QAFetch.QAQuery.QA_fetch_stock_block(code=None, format='pd', collections=Collection(Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'), 'stock_block'))[source]
+
+ +
+
+QUANTAXIS.QAFetch.QAQuery.QA_fetch_stock_day(code, start, end, format='numpy', frequence='day', collections=Collection(Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'), 'stock_day'))[source]
+

获取股票日线

+
+ +
+
+QUANTAXIS.QAFetch.QAQuery.QA_fetch_stock_full(date, format='numpy', collections=Collection(Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'), 'stock_day'))[source]
+

获取全市场的某一日的数据

+
+ +
+
+QUANTAXIS.QAFetch.QAQuery.QA_fetch_stock_info(code, format='pd', collections=Collection(Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'), 'stock_info'))[source]
+
+ +
+
+QUANTAXIS.QAFetch.QAQuery.QA_fetch_stock_list(collections=Collection(Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'), 'stock_list'))[source]
+

获取股票列表

+
+ +
+
+QUANTAXIS.QAFetch.QAQuery.QA_fetch_stock_min(code, start, end, format='numpy', frequence='1min', collections=Collection(Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'), 'stock_min'))[source]
+

获取股票分钟线

+
+ +
+
+QUANTAXIS.QAFetch.QAQuery.QA_fetch_stock_name(code, collections=Collection(Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'), 'stock_list'))[source]
+
+ +
+
+QUANTAXIS.QAFetch.QAQuery.QA_fetch_stock_xdxr(code, format='pd', collections=Collection(Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'), 'stock_xdxr'))[source]
+

获取股票除权信息/数据库

+
+ +
+
+QUANTAXIS.QAFetch.QAQuery.QA_fetch_trade_date()[source]
+

获取交易日期

+
+ +
+
+

QUANTAXIS.QAFetch.QAQuery_Advance module

+
+
+QUANTAXIS.QAFetch.QAQuery_Advance.QA_fetch_index_day_adv(code, start, end=None, if_drop_index=False, collections=Collection(Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'), 'index_day'))[source]
+

获取指数日线

+
+ +
+
+QUANTAXIS.QAFetch.QAQuery_Advance.QA_fetch_index_min_adv(code, start, end=None, frequence='1min', if_drop_index=False, collections=Collection(Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'), 'index_min'))[source]
+

获取股票分钟线

+
+ +
+
+QUANTAXIS.QAFetch.QAQuery_Advance.QA_fetch_security_list_adv(collections=Collection(Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'), 'stock_list'))[source]
+

获取股票列表

+
+ +
+
+QUANTAXIS.QAFetch.QAQuery_Advance.QA_fetch_stock_block_adv(code=None, blockname=None, collections=Collection(Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'), 'stock_block'))[source]
+

返回板块

+
+
Keyword Arguments:
+
code {[type]} -- [description] (default: {None}) +blockname {[type]} -- [descrioption] (default : {None}) +collections {[type]} -- [description] (default: {DATABASE})
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+QUANTAXIS.QAFetch.QAQuery_Advance.QA_fetch_stock_day_adv(code, start='all', end=None, if_drop_index=False, collections=Collection(Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'), 'stock_day'))[source]
+

获取股票日线

+
+ +
+
+QUANTAXIS.QAFetch.QAQuery_Advance.QA_fetch_stock_day_full_adv(date)[source]
+

返回全市场某一天的数据

+
+ +
+
+QUANTAXIS.QAFetch.QAQuery_Advance.QA_fetch_stock_list_adv(collections=Collection(Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'), 'stock_list'))[source]
+

获取股票列表

+
+ +
+
+QUANTAXIS.QAFetch.QAQuery_Advance.QA_fetch_stock_min_adv(code, start, end=None, frequence='1min', if_drop_index=False, collections=Collection(Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'), 'stock_min'))[source]
+

获取股票分钟线

+
+ +
+
+QUANTAXIS.QAFetch.QAQuery_Advance.QA_fetch_stock_realtime_adv(code=None, num=1, collections=Collection(Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'), 'realtime_2018-05-07'))[source]
+

返回当日的上下五档, code可以是股票可以是list, num是每个股票获取的数量

+
+ +
+
+QUANTAXIS.QAFetch.QAQuery_Advance.QA_fetch_stock_transaction_adv(code, start, end=None, if_drop_index=False, collections=Collection(Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'), 'stock_transaction'))[source]
+
+ +
+
+

QUANTAXIS.QAFetch.QATdx module

+
+
+QUANTAXIS.QAFetch.QATdx.QA_fetch_depth_market_data(code=['000001', '000002'], ip='60.191.117.167', port=7709)[source]
+
+ +
+
+QUANTAXIS.QAFetch.QATdx.QA_fetch_get_future_day(code, start_date, end_date, frequence='day', ip='58.246.109.27', port=7721)[source]
+

期货数据 日线

+
+ +
+
+QUANTAXIS.QAFetch.QATdx.QA_fetch_get_future_list(ip='58.246.109.27', port=7721)[source]
+

期货代码list

+
+ +
+
+QUANTAXIS.QAFetch.QATdx.QA_fetch_get_future_min(code, start, end, frequence='1min', ip='58.246.109.27', port=7721)[source]
+

期货数据 分钟线

+
+ +
+
+QUANTAXIS.QAFetch.QATdx.QA_fetch_get_future_realtime(code, ip='58.246.109.27', port=7721)[source]
+

期货实时价格

+
+ +
+
+QUANTAXIS.QAFetch.QATdx.QA_fetch_get_future_transaction(ip='58.246.109.27', port=7721)[source]
+

期货历史成交分笔

+
+ +
+
+QUANTAXIS.QAFetch.QATdx.QA_fetch_get_future_transaction_realtime(ip='58.246.109.27', port=7721)[source]
+

期货历史成交分笔

+
+ +
+
+QUANTAXIS.QAFetch.QATdx.QA_fetch_get_index_day(code, start_date, end_date, frequence='day', ip='60.191.117.167', port=7709)[source]
+

指数日线

+
+ +
+
+QUANTAXIS.QAFetch.QATdx.QA_fetch_get_index_min(code, start, end, frequence='1min', ip='60.191.117.167', port=7709)[source]
+

指数分钟线

+
+ +
+
+QUANTAXIS.QAFetch.QATdx.QA_fetch_get_security_bars(code, _type, lens, ip='60.191.117.167', port=7709)[source]
+

按bar长度推算数据

+
+
Arguments:
+
code {[type]} -- [description] +_type {[type]} -- [description] +lens {[type]} -- [description]
+
Keyword Arguments:
+
ip {[type]} -- [description] (default: {best_ip}) +port {[type]} -- [description] (default: {7709})
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+QUANTAXIS.QAFetch.QATdx.QA_fetch_get_stock_block(ip='60.191.117.167', port=7709)[source]
+

板块数据

+
+ +
+
+QUANTAXIS.QAFetch.QATdx.QA_fetch_get_stock_day(code, start_date, end_date, if_fq='00', frequence='day', ip='60.191.117.167', port=7709)[source]
+

获取日线及以上级别的数据

+
+
Arguments:
+
code {str:6} -- code 是一个单独的code 6位长度的str +start_date {str:10} -- 10位长度的日期 比如'2017-01-01' +end_date {str:10} -- 10位长度的日期 比如'2018-01-01'
+
Keyword Arguments:
+
if_fq {str} -- '00'/'bfq' -- 不复权 '01'/'qfq' -- 前复权 '02'/'hfq' -- 后复权 '03'/'ddqfq' -- 定点前复权 '04'/'ddhfq' --定点后复权 +frequency {str} -- day/week/month/quarter/year 也可以是简写 D/W/M/Q/Y +ip {str} -- [description] (default: best_ip['stock']['ip']) ip可以通过select_best_ip()函数重新获取 +port {int} -- [description] (default: {7709})
+
Returns:
+
pd.DataFrame/None -- 返回的是dataframe,如果出错比如只获取了一天,而当天停牌,返回None
+
Exception:
+
如果出现网络问题/服务器拒绝, 会出现socket:time out 尝试再次获取/更换ip即可, 本函数不做处理
+
+
+ +
+
+QUANTAXIS.QAFetch.QATdx.QA_fetch_get_stock_info(code, ip='60.191.117.167', port=7709)[source]
+

股票基本信息

+
+ +
+
+QUANTAXIS.QAFetch.QATdx.QA_fetch_get_stock_latest(code, ip='60.191.117.167', port=7709)[source]
+
+ +
+
+QUANTAXIS.QAFetch.QATdx.QA_fetch_get_stock_list(type_='stock', ip='60.191.117.167', port=7709)[source]
+
+ +
+
+QUANTAXIS.QAFetch.QATdx.QA_fetch_get_stock_min(code, start, end, frequence='1min', ip='60.191.117.167', port=7709)[source]
+
+ +
+
+QUANTAXIS.QAFetch.QATdx.QA_fetch_get_stock_realtime(code=['000001', '000002'], ip='60.191.117.167', port=7709)[source]
+
+ +
+
+QUANTAXIS.QAFetch.QATdx.QA_fetch_get_stock_transaction(code, start, end, retry=2, ip='60.191.117.167', port=7709)[source]
+

历史逐笔成交 buyorsell 1--sell 0--buy 2--盘前

+
+ +
+
+QUANTAXIS.QAFetch.QATdx.QA_fetch_get_stock_transaction_realtime(code, ip='60.191.117.167', port=7709)[source]
+

实时逐笔成交 包含集合竞价 buyorsell 1--sell 0--buy 2--盘前

+
+ +
+
+QUANTAXIS.QAFetch.QATdx.QA_fetch_get_stock_xdxr(code, ip='60.191.117.167', port=7709)[source]
+

除权除息

+
+ +
+
+QUANTAXIS.QAFetch.QATdx.QA_fetch_get_wholemarket_list()[source]
+
+ +
+
+QUANTAXIS.QAFetch.QATdx.for_sh(code)[source]
+
+ +
+
+QUANTAXIS.QAFetch.QATdx.for_sz(code)[source]
+
+ +
+
+QUANTAXIS.QAFetch.QATdx.ping(ip, port=7709, type_='stock')[source]
+
+ +
+
+QUANTAXIS.QAFetch.QATdx.select_best_ip()[source]
+
+ +
+
+

QUANTAXIS.QAFetch.QATdx_adv module

+
+
+class QUANTAXIS.QAFetch.QATdx_adv.QA_Tdx_Executor(thread_num=2, *args, **kwargs)[source]
+

Bases: object

+
+
+api
+
+ +
+
+api_worker()[source]
+
+ +
+
+get_available()[source]
+
+ +
+
+get_frequence(frequence)[source]
+
+ +
+
+get_market(code)[source]
+
+ +
+
+get_realtime(code)[source]
+
+ +
+
+get_realtime_concurrent(code)[source]
+
+ +
+
+get_security_bar(code, _type, lens)[source]
+
+ +
+
+get_security_bar_concurrent(code, _type, lens)[source]
+
+ +
+
+ipsize
+
+ +
+
+save_mongo(data, client=Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'))[source]
+
+ +
+ +
+
+QUANTAXIS.QAFetch.QATdx_adv.bat()[source]
+
+ +
+
+QUANTAXIS.QAFetch.QATdx_adv.get_bar()[source]
+
+ +
+
+QUANTAXIS.QAFetch.QATdx_adv.get_day_once()[source]
+
+ +
+
+

QUANTAXIS.QAFetch.QAThs module

+
+
+QUANTAXIS.QAFetch.QAThs.QA_fetch_get_stock_block()[source]
+
+ +
+
+QUANTAXIS.QAFetch.QAThs.QA_fetch_get_stock_day(code, start, end, if_fq='00')[source]
+
+ +
+
+QUANTAXIS.QAFetch.QAThs.QA_fetch_get_stock_day_in_year(code, year, if_fq='00')[source]
+
+ +
+
+

QUANTAXIS.QAFetch.QATushare module

+
+
+QUANTAXIS.QAFetch.QATushare.QA_fetch_get_stock_day(name, start='', end='', if_fq='01', type_='json')[source]
+
+ +
+
+QUANTAXIS.QAFetch.QATushare.QA_fetch_get_stock_info(name)[source]
+
+ +
+
+QUANTAXIS.QAFetch.QATushare.QA_fetch_get_stock_list()[source]
+
+ +
+
+QUANTAXIS.QAFetch.QATushare.QA_fetch_get_stock_realtime()[source]
+
+ +
+
+QUANTAXIS.QAFetch.QATushare.QA_fetch_get_stock_tick(name, date)[source]
+
+ +
+
+QUANTAXIS.QAFetch.QATushare.QA_fetch_get_stock_time_to_market()[source]
+
+ +
+
+QUANTAXIS.QAFetch.QATushare.QA_fetch_get_trade_date(end, exchange)[source]
+
+ +
+
+

QUANTAXIS.QAFetch.QAWind module

+

QAWind

+

QAWind is a data fetch module just for WIND Institution Version

+

QAWind is under the [QAStandard#0.0.2 @101-1],[QAStandard#0.0.2 @501-0] protocol

+

@author: yutiansut

+

@last modified:2017/4/5

+
+
+QUANTAXIS.QAFetch.QAWind.QA_fetch_get_stock_day(name, startDate, endDate, if_fq='01')[source]
+
+ +
+
+QUANTAXIS.QAFetch.QAWind.QA_fetch_get_stock_day_simple(name, startDate, endDate)[source]
+
+ +
+
+QUANTAXIS.QAFetch.QAWind.QA_fetch_get_stock_financial(name, startDate, endDate)[source]
+
+ +
+
+QUANTAXIS.QAFetch.QAWind.QA_fetch_get_stock_indicator(name, startDate, endDate)[source]
+
+ +
+
+QUANTAXIS.QAFetch.QAWind.QA_fetch_get_stock_info(name, startDate, endDate)[source]
+
+ +
+
+QUANTAXIS.QAFetch.QAWind.QA_fetch_get_stock_list(date)[source]
+
+ +
+
+QUANTAXIS.QAFetch.QAWind.QA_fetch_get_stock_list_special(date, id)[source]
+
+ +
+
+QUANTAXIS.QAFetch.QAWind.QA_fetch_get_stock_risk(name, startDate, endDate)[source]
+
+ +
+
+QUANTAXIS.QAFetch.QAWind.QA_fetch_get_stock_shape(name, startDate, endDate)[source]
+
+ +
+
+QUANTAXIS.QAFetch.QAWind.QA_fetch_get_stock_xueqiu(name, startDate, endDate)[source]
+
+ +
+
+QUANTAXIS.QAFetch.QAWind.QA_fetch_get_trade_date(endDate, exchange)[source]
+
+ +
+
+

QUANTAXIS.QAFetch.QAfinancial module

+
+
+QUANTAXIS.QAFetch.QAfinancial.download()[source]
+

会创建一个download/文件夹

+
+ +
+
+QUANTAXIS.QAFetch.QAfinancial.get_and_parse(filename)[source]
+
+ +
+
+QUANTAXIS.QAFetch.QAfinancial.get_filename()[source]
+
+ +
+
+QUANTAXIS.QAFetch.QAfinancial.prase_all()[source]
+

解析目录下的所有文件

+
+ +
+
+

QUANTAXIS.QAFetch.base module

+
+
+

QUANTAXIS.QAFetch.data_list module

+

0201e20000000000 RZRQ (融资融券标的) 1000009226000000 RQ (转融券标的) a001050100000000 ST(ST股)

+

a001050200000000 SST (*ST) 1000023325000000 YJ(预警 SZSE) a001050d00000000 小盘股

+

a001050e00000000 大盘蓝筹 0201240000000000 cixin(次新股)

+
+
+

QUANTAXIS.QAFetch.realtime module

+

单线程的实时获取

+
+
+QUANTAXIS.QAFetch.realtime.get_today_all(output='pd')[source]
+

today all

+
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+

Module contents

+

QA fetch module

+

@yutiansut

+

QAFetch is Under [QAStandard#0.0.2@10x] Protocol

+
+
+QUANTAXIS.QAFetch.QA_fetch_get_future_day(package, code, start, end, frequence='day')[source]
+
+ +
+
+QUANTAXIS.QAFetch.QA_fetch_get_future_list(package)[source]
+
+ +
+
+QUANTAXIS.QAFetch.QA_fetch_get_future_min(package, code, start, end, frequence='1min')[source]
+
+ +
+
+QUANTAXIS.QAFetch.QA_fetch_get_index_day(package, code, start, end, level='day')[source]
+
+ +
+
+QUANTAXIS.QAFetch.QA_fetch_get_index_min(package, code, start, end, level='1min')[source]
+
+ +
+
+QUANTAXIS.QAFetch.QA_fetch_get_security_bars(code, _type, lens)[source]
+
+ +
+
+QUANTAXIS.QAFetch.QA_fetch_get_stock_block(package)[source]
+
+ +
+
+QUANTAXIS.QAFetch.QA_fetch_get_stock_day(package, code, start, end, if_fq='01', level='day', type_='json')[source]
+
+ +
+
+QUANTAXIS.QAFetch.QA_fetch_get_stock_indicator(package, code, start, end)[source]
+
+ +
+
+QUANTAXIS.QAFetch.QA_fetch_get_stock_info(package, code)[source]
+
+ +
+
+QUANTAXIS.QAFetch.QA_fetch_get_stock_list(package, type_='stock')[source]
+
+ +
+
+QUANTAXIS.QAFetch.QA_fetch_get_stock_min(package, code, start, end, level='1min')[source]
+
+ +
+
+QUANTAXIS.QAFetch.QA_fetch_get_stock_realtime(package, code)[source]
+
+ +
+
+QUANTAXIS.QAFetch.QA_fetch_get_stock_transaction(package, code, start, end, retry=2)[source]
+
+ +
+
+QUANTAXIS.QAFetch.QA_fetch_get_stock_transaction_realtime(package, code)[source]
+
+ +
+
+QUANTAXIS.QAFetch.QA_fetch_get_stock_xdxr(package, code)[source]
+
+ +
+
+QUANTAXIS.QAFetch.QA_fetch_get_trade_date(package, end, exchange)[source]
+
+ +
+
+QUANTAXIS.QAFetch.use(package)[source]
+
+ +
+
+ + +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/source/QUANTAXIS.QAIndicator.html b/_build/html/source/QUANTAXIS.QAIndicator.html new file mode 100644 index 000000000..b74e42251 --- /dev/null +++ b/_build/html/source/QUANTAXIS.QAIndicator.html @@ -0,0 +1,486 @@ + + + + + + + + QUANTAXIS.QAIndicator package — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

QUANTAXIS.QAIndicator package

+
+

Submodules

+
+
+

QUANTAXIS.QAIndicator.base module

+
+
+QUANTAXIS.QAIndicator.base.ABS(Series)[source]
+
+ +
+
+QUANTAXIS.QAIndicator.base.AVEDEV(Series, N)[source]
+

平均绝对偏差 mean absolute deviation

+
+ +
+
+QUANTAXIS.QAIndicator.base.BBI(Series, N1, N2, N3, N4)[source]
+

多空指标

+
+ +
+
+QUANTAXIS.QAIndicator.base.BBIBOLL(Series, N1, N2, N3, N4, N, M)[source]
+
+ +
+
+QUANTAXIS.QAIndicator.base.COUNT(COND, N)[source]
+
+ +
+
+QUANTAXIS.QAIndicator.base.CROSS(A, B)[source]
+
+ +
+
+QUANTAXIS.QAIndicator.base.DIFF(Series, N=1)[source]
+
+ +
+
+QUANTAXIS.QAIndicator.base.EMA(Series, N)[source]
+
+ +
+
+QUANTAXIS.QAIndicator.base.HHV(Series, N)[source]
+
+ +
+
+QUANTAXIS.QAIndicator.base.IF(COND, V1, V2)[source]
+
+ +
+
+QUANTAXIS.QAIndicator.base.LAST(COND, N1, N2)[source]
+

表达持续性

+
+
Arguments:
+
COND {[type]} -- [description] +N1 {[type]} -- [description] +N2 {[type]} -- [description]
+
+
+ +
+
+QUANTAXIS.QAIndicator.base.LLV(Series, N)[source]
+
+ +
+
+QUANTAXIS.QAIndicator.base.MA(Series, N)[source]
+
+ +
+
+QUANTAXIS.QAIndicator.base.MACD(Series, FAST, SLOW, MID)[source]
+

macd指标 仅适用于Series +对于DATAFRAME的应用请使用QA_indicator_macd

+
+ +
+
+QUANTAXIS.QAIndicator.base.MAX(A, B)[source]
+
+ +
+
+QUANTAXIS.QAIndicator.base.MIN(A, B)[source]
+
+ +
+
+QUANTAXIS.QAIndicator.base.REF(Series, N)[source]
+
+ +
+
+QUANTAXIS.QAIndicator.base.SMA(Series, N, M=1)[source]
+

威廉SMA算法

+

本次修正主要是对于返回值的优化,现在的返回值会带上原先输入的索引index +2018/5/3 +@yutiansut

+
+ +
+
+QUANTAXIS.QAIndicator.base.STD(Series, N)[source]
+
+ +
+
+QUANTAXIS.QAIndicator.base.SUM(Series, N)[source]
+
+ +
+
+

QUANTAXIS.QAIndicator.indicators module

+
+
+QUANTAXIS.QAIndicator.indicators.QA_indicator_ADTM(DataFrame, N=23, M=8)[source]
+

动态买卖气指标

+
+ +
+
+QUANTAXIS.QAIndicator.indicators.QA_indicator_ARBR(DataFrame, M1=26, M2=70, M3=150)[source]
+
+ +
+
+QUANTAXIS.QAIndicator.indicators.QA_indicator_ASI(DataFrame, M1=26, M2=10)[source]
+

LC=REF(CLOSE,1); +AA=ABS(HIGH-LC); +BB=ABS(LOW-LC); +CC=ABS(HIGH-REF(LOW,1)); +DD=ABS(LC-REF(OPEN,1)); +R=IF(AA>BB AND AA>CC,AA+BB/2+DD/4,IF(BB>CC AND BB>AA,BB+AA/2+DD/4,CC+DD/4)); +X=(CLOSE-LC+(CLOSE-OPEN)/2+LC-REF(OPEN,1)); +SI=16*X/R*MAX(AA,BB); +ASI:SUM(SI,M1); +ASIT:MA(ASI,M2);

+
+ +
+
+QUANTAXIS.QAIndicator.indicators.QA_indicator_ATR(DataFrame, N=14)[source]
+

输出TR:(最高价-最低价)和昨收-最高价的绝对值的较大值和昨收-最低价的绝对值的较大值 +输出真实波幅:TR的N日简单移动平均 +算法:今日振幅、今日最高与昨收差价、今日最低与昨收差价中的最大值,为真实波幅,求真实波幅的N日移动平均

+

参数:N 天数,一般取14

+
+ +
+
+QUANTAXIS.QAIndicator.indicators.QA_indicator_BBI(DataFrame, N1=3, N2=6, N3=12, N4=24)[source]
+

多空指标

+
+ +
+
+QUANTAXIS.QAIndicator.indicators.QA_indicator_BIAS(DataFrame, N1, N2, N3)[source]
+

乖离率

+
+ +
+
+QUANTAXIS.QAIndicator.indicators.QA_indicator_BOLL(DataFrame, N=20, P=2)[source]
+

布林线

+
+ +
+
+QUANTAXIS.QAIndicator.indicators.QA_indicator_CCI(DataFrame, N=14)[source]
+

TYP:=(HIGH+LOW+CLOSE)/3; +CCI:(TYP-MA(TYP,N))/(0.015*AVEDEV(TYP,N));

+
+ +
+
+QUANTAXIS.QAIndicator.indicators.QA_indicator_CHO(DataFrame, N1=10, N2=20, M=6)[source]
+

佳庆指标 CHO

+
+ +
+
+QUANTAXIS.QAIndicator.indicators.QA_indicator_CR(DataFrame, N=26, M1=5, M2=10, M3=20)[source]
+
+ +
+
+QUANTAXIS.QAIndicator.indicators.QA_indicator_DDI(DataFrame, N=13, N1=26, M=1, M1=5)[source]
+

'方向标准离差指数' +分析DDI柱状线,由红变绿(正变负),卖出信号参考;由绿变红,买入信号参考。

+
+ +
+
+QUANTAXIS.QAIndicator.indicators.QA_indicator_DMA(DataFrame, M1=10, M2=50, M3=10)[source]
+

平均线差 DMA

+
+ +
+
+QUANTAXIS.QAIndicator.indicators.QA_indicator_DMI(DataFrame, M1=14, M2=6)[source]
+

趋向指标 DMI

+
+ +
+
+QUANTAXIS.QAIndicator.indicators.QA_indicator_EMA(DataFrame, N)[source]
+
+ +
+
+QUANTAXIS.QAIndicator.indicators.QA_indicator_EXPMA(DataFrame, P1=5, P2=10, P3=20, P4=60)[source]
+

指数平均线 EXPMA

+
+ +
+
+QUANTAXIS.QAIndicator.indicators.QA_indicator_KDJ(DataFrame, N=9, M1=3, M2=3)[source]
+
+ +
+
+QUANTAXIS.QAIndicator.indicators.QA_indicator_MA(DataFrame, N)[source]
+
+ +
+
+QUANTAXIS.QAIndicator.indicators.QA_indicator_MACD(DataFrame, short=12, long=26, mid=9)[source]
+

MACD CALC

+
+ +
+
+QUANTAXIS.QAIndicator.indicators.QA_indicator_MFI(DataFrame, N=14)[source]
+

资金指标 +TYP := (HIGH + LOW + CLOSE)/3; +V1:=SUM(IF(TYP>REF(TYP,1),TYP*VOL,0),N)/SUM(IF(TYP<REF(TYP,1),TYP*VOL,0),N); +MFI:100-(100/(1+V1)); +赋值: (最高价 + 最低价 + 收盘价)/3 +V1赋值:如果TYP>1日前的TYP,返回TYP*成交量(手),否则返回0的N日累和/如果TYP<1日前的TYP,返回TYP*成交量(手),否则返回0的N日累和 +输出资金流量指标:100-(100/(1+V1))

+
+ +
+
+QUANTAXIS.QAIndicator.indicators.QA_indicator_MIKE(DataFrame, N=12)[source]
+

MIKE指标 +指标说明 +MIKE是另外一种形式的路径指标。 +买卖原则 +1 WEAK-S,MEDIUM-S,STRONG-S三条线代表初级、中级、强力支撑。 +2 WEAK-R,MEDIUM-R,STRONG-R三条线代表初级、中级、强力压力。

+
+ +
+
+QUANTAXIS.QAIndicator.indicators.QA_indicator_MTM(DataFrame, N=12, M=6)[source]
+

动量线

+
+ +
+
+QUANTAXIS.QAIndicator.indicators.QA_indicator_OBV(DataFrame)[source]
+

能量潮

+
+ +
+
+QUANTAXIS.QAIndicator.indicators.QA_indicator_OSC(DataFrame, N=20, M=6)[source]
+

变动速率线

+

震荡量指标OSC,也叫变动速率线。属于超买超卖类指标,是从移动平均线原理派生出来的一种分析指标。

+

它反应当日收盘价与一段时间内平均收盘价的差离值,从而测出股价的震荡幅度。

+

按照移动平均线原理,根据OSC的值可推断价格的趋势,如果远离平均线,就很可能向平均线回归。

+
+ +
+
+QUANTAXIS.QAIndicator.indicators.QA_indicator_PBX(DataFrame, N1=3, N2=5, N3=8, N4=13, N5=18, N6=24)[source]
+

瀑布线

+
+ +
+
+QUANTAXIS.QAIndicator.indicators.QA_indicator_PVT(DataFrame)[source]
+
+ +
+
+QUANTAXIS.QAIndicator.indicators.QA_indicator_ROC(DataFrame, N=12, M=6)[source]
+

变动率指标

+
+ +
+
+QUANTAXIS.QAIndicator.indicators.QA_indicator_RSI(DataFrame, N1=12, N2=26, N3=9)[source]
+

相对强弱指标RSI1:SMA(MAX(CLOSE-LC,0),N1,1)/SMA(ABS(CLOSE-LC),N1,1)*100;

+
+ +
+
+QUANTAXIS.QAIndicator.indicators.QA_indicator_SKDJ(DataFrame, N=9, M=3)[source]
+

1.指标>80 时,回档机率大;指标<20 时,反弹机率大; +2.K在20左右向上交叉D时,视为买进信号参考; +3.K在80左右向下交叉D时,视为卖出信号参考; +4.SKDJ波动于50左右的任何讯号,其作用不大。

+
+ +
+
+QUANTAXIS.QAIndicator.indicators.QA_indicator_SMA(DataFrame, N)[source]
+
+ +
+
+QUANTAXIS.QAIndicator.indicators.QA_indicator_VPT(DataFrame, N=51, M=6)[source]
+
+ +
+
+QUANTAXIS.QAIndicator.indicators.QA_indicator_VR(DataFrame, M1=26, M2=100, M3=200)[source]
+
+ +
+
+QUANTAXIS.QAIndicator.indicators.QA_indicator_VRSI(DataFrame, N=6)[source]
+
+ +
+
+QUANTAXIS.QAIndicator.indicators.QA_indicator_VSTD(DataFrame, N=10)[source]
+
+ +
+
+QUANTAXIS.QAIndicator.indicators.QA_indicator_WR(DataFrame, N, N1)[source]
+

威廉指标

+
+ +
+
+QUANTAXIS.QAIndicator.indicators.QA_indicator_shadow(DataFrame)[source]
+

上下影线指标

+
+ +
+
+QUANTAXIS.QAIndicator.indicators.amplitude(DataFrame)[source]
+
+ +
+
+QUANTAXIS.QAIndicator.indicators.body(DataFrame)[source]
+
+ +
+
+QUANTAXIS.QAIndicator.indicators.body_abs(DataFrame)[source]
+
+ +
+
+QUANTAXIS.QAIndicator.indicators.lower_shadow(DataFrame)[source]
+
+ +
+
+QUANTAXIS.QAIndicator.indicators.price_pcg(DataFrame)[source]
+
+ +
+
+QUANTAXIS.QAIndicator.indicators.upper_shadow(DataFrame)[source]
+
+ +
+
+

Module contents

+
+
+ + +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/source/QUANTAXIS.QAMarket.html b/_build/html/source/QUANTAXIS.QAMarket.html new file mode 100644 index 000000000..dc84a8ec4 --- /dev/null +++ b/_build/html/source/QUANTAXIS.QAMarket.html @@ -0,0 +1,1208 @@ + + + + + + + + QUANTAXIS.QAMarket package — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

QUANTAXIS.QAMarket package

+
+

Submodules

+
+
+

QUANTAXIS.QAMarket.Broker_Calender module

+
+
+

QUANTAXIS.QAMarket.QABacktestBroker module

+
+
+class QUANTAXIS.QAMarket.QABacktestBroker.QA_BacktestBroker(commission_fee_coeff=0.0015, if_nondatabase=False)[source]
+

Bases: QUANTAXIS.QAMarket.QABroker.QA_Broker

+

QUANTAXIS Broker 部分

+

回测 +股票/指数/期货/债券/ETF/基金 +@yutiansut

+

对于不同的市场规则: +股票市场 t+1 +期货/期权/加密货币市场 t+0

+

股票/加密货币市场不允许卖空 +期货/期权市场允许卖空

+

t+1的市场是 +当日的买入 更新持仓- 不更新可卖数量- 资金冻结 +当日的卖出 及时更新可用资金

+

t+0市场是: +当日买入 即时更新持仓和可卖 +当日卖出 即时更新

+

卖空的规则是 +允许无仓位的时候卖出证券(按市值和保证金比例限制算)

+
+
+get_market(order)[source]
+

get_market func

+

[description]

+
+
Arguments:
+
order {orders} -- [description]
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+query_data(code, start, end, frequence, market_type=None)[source]
+

标准格式是numpy

+
+ +
+
+receive_order(event)[source]
+

get the order and choice which market to trade

+
+ +
+
+run(event)[source]
+
+ +
+
+warp(order)[source]
+

对order/market的封装

+

[description]

+
+
Arguments:
+
order {[type]} -- [description]
+
Returns:
+
[type] -- [description]
+
+
+ +
+ +
+
+

QUANTAXIS.QAMarket.QABroker module

+

需要一个可以被修改和继承的基类

+

2017/8/12

+
+
+class QUANTAXIS.QAMarket.QABroker.QA_BROKER_EVENT(*args, **kwargs)[source]
+

Bases: QUANTAXIS.QAEngine.QAEvent.QA_Event

+
+ +
+
+class QUANTAXIS.QAMarket.QABroker.QA_Broker(*args, **kwargs)[source]
+

Bases: QUANTAXIS.QAEngine.QAEvent.QA_Worker

+

MARKET ENGINGE ABSTRACT

+

receive_order => warp => get_data => engine

+
+
+get_market(order)[source]
+
+ +
+
+receive_order(event)[source]
+
+ +
+
+warp(order)[source]
+

对order/market的封装

+

[description]

+
+
Arguments:
+
order {[type]} -- [description]
+
Returns:
+
[type] -- [description]
+
+
+ +
+ +
+
+

QUANTAXIS.QAMarket.QADealer module

+
+
+class QUANTAXIS.QAMarket.QADealer.QA_Dealer(commission_fee_coeff=0.00025, tax_coeff=0.001, *args, **kwargs)[source]
+

Bases: object

+

[summary]

+

对于不同的市场规则: +股票市场 t+1 +期货/期权/加密货币市场 t+0

+

股票/加密货币市场不允许卖空 +期货/期权市场允许卖空

+

t+1的市场是 +当日的买入 更新持仓- 不更新可卖数量- 资金冻结 +当日的卖出 及时更新可用资金

+

t+0市场是: +当日买入 即时更新持仓和可卖 +当日卖出 即时更新

+

卖空的规则是 +允许无仓位的时候卖出证券(按市值和保证金比例限制算)

+
+
+backtest_stock_dealer()[source]
+

MARKET ENGINE STOCK

+

在拿到市场数据后对于订单的撮合判断 生成成交信息

+

trading system +step1: check self.market_data +step2: deal +step3: return callback

+
+ +
+
+cal_fee()[source]
+
+ +
+
+callback_message()[source]
+
+ +
+
+deal(order, market_data)[source]
+
+ +
+ +
+
+class QUANTAXIS.QAMarket.QADealer.Stock_Dealer(*args, **kwargs)[source]
+

Bases: QUANTAXIS.QAMarket.QADealer.QA_Dealer

+
+ +
+
+class QUANTAXIS.QAMarket.QADealer.commission[source]
+

Bases: object

+
+
+if_buyside_commission = False
+
+ +
+
+if_commission = False
+
+ +
+
+if_sellside_commission = True
+
+ +
+ +
+
+class QUANTAXIS.QAMarket.QADealer.dealer_preset(market_type, *args, **kwargs)[source]
+

Bases: object

+
+
+load_preset()[source]
+
+ +
+ +
+
+

QUANTAXIS.QAMarket.QAMarket module

+
+
+class QUANTAXIS.QAMarket.QAMarket.QA_Market(*args, **kwargs)[source]
+

Bases: QUANTAXIS.QAMarket.QATrade.QA_Trade

+

QUANTAXIS MARKET 部分

+

交易前置/可连接到多个broker中

+

暂时还是采用多线程engine模式

+
+
+clear()[source]
+
+ +
+
+connect(broker)[source]
+
+ +
+
+get_account(account_cookie)[source]
+
+ +
+
+get_account_id()[source]
+
+ +
+
+get_trading_day()[source]
+
+ +
+
+insert_order(account_id, amount, amount_model, time, code, price, order_model, towards, market_type, frequence, broker_name)[source]
+
+ +
+
+login(broker_name, account_cookie, account=None)[source]
+
+ +
+
+logout(account_cookie, broker_name)[source]
+
+ +
+
+on_insert_order(order)[source]
+
+ +
+
+on_query_data(data)[source]
+
+ +
+
+on_trade_event(event)[source]
+
+ +
+
+query_assets(account_cookie)[source]
+
+ +
+
+query_cash(account_cookie)[source]
+
+ +
+
+query_currentbar(broker_name, market_type, code)[source]
+
+ +
+
+query_data(broker_name, frequence, market_type, code, start, end=None)[source]
+
+ +
+
+query_data_no_wait(broker_name, frequence, market_type, code, start, end=None)[source]
+
+ +
+
+query_order(broker_name, order_id)[source]
+
+ +
+
+query_position(account_cookie)[source]
+
+ +
+
+register(broker_name, broker)[source]
+
+ +
+
+start()[source]
+
+ +
+
+upcoming_data(broker, data)[source]
+
+ +
+ +
+
+

QUANTAXIS.QAMarket.QAOrder module

+
+
+class QUANTAXIS.QAMarket.QAOrder.QA_Order(price=None, date=None, datetime=None, sending_time=None, transact_time=None, amount=None, market_type=None, frequence=None, towards=None, code=None, user=None, account_cookie=None, strategy=None, order_model=None, amount_model='by_amount', order_id=None, trade_id=None, status='100', callback=False, *args, **kwargs)[source]
+

Bases: object

+
+
+from_dict(order)[source]
+
+ +
+
+info()[source]
+
+ +
+
+to_df()[source]
+
+ +
+
+to_dict()[source]
+
+ +
+ +
+
+class QUANTAXIS.QAMarket.QAOrder.QA_OrderQueue[source]
+

Bases: object

+

一个待成交队列 +这里面都是对于方法的封装

+
+
+insert_order(order)[source]
+
+ +
+
+order_ids
+
+ +
+
+pending
+

选择待成交列表

+

[description]

+
+
Returns:
+
dataframe
+
+
+ +
+
+query_order(order_id)[source]
+
+ +
+
+set_status(order_id, new_status)[source]
+
+ +
+
+settle()[source]
+

结算

+

清空订单簿

+
+ +
+
+trade_list
+

批量交易

+

[description]

+
+
Returns:
+
list of orders
+
+
+ +
+ +
+
+

QUANTAXIS.QAMarket.QAOrderHandler module

+
+
+class QUANTAXIS.QAMarket.QAOrderHandler.QA_OrderHandler(*args, **kwargs)[source]
+

Bases: QUANTAXIS.QAEngine.QAEvent.QA_Worker

+

ORDER执行器

+

ORDEHANDLDER 归属于MARKET前置

+

仅负责一个无状态的执行层

+

ORDER执行器的作用是因为 +在实盘中 当一个订单发送出去的时候,市场不会返回一个更新的订单类回来 +大部分时间都依赖子线程主动查询 或者是一个市场信息来进行判断

+

ORDER_Handler的作用就是根据信息更新Order

+

用于接受订单 发送给相应的marker_broker 再根据返回的信息 进行更新

+

可用的market_broker: +1.回测盘 +2.实时模拟盘 +3.实盘

+
+
+query_order(order_id)[source]
+
+ +
+
+run(event)[source]
+
+ +
+ +
+
+

QUANTAXIS.QAMarket.QARandomBroker module

+
+
+class QUANTAXIS.QAMarket.QARandomBroker.QA_RandomBroker(*args, **kwargs)[source]
+

Bases: QUANTAXIS.QAMarket.QABroker.QA_Broker

+
+
+get_data(order)[source]
+
+ +
+
+receive_order(order)[source]
+
+ +
+
+warp(order)[source]
+

对order/market的封装

+

[description]

+
+
Arguments:
+
order {[type]} -- [description]
+
Returns:
+
[type] -- [description]
+
+
+ +
+ +
+
+

QUANTAXIS.QAMarket.QARealBroker module

+
+
+class QUANTAXIS.QAMarket.QARealBroker.QA_RealBroker(*args, **kwargs)[source]
+

Bases: QUANTAXIS.QAMarket.QABroker.QA_Broker

+
+
+get_data(order)[source]
+
+ +
+
+receive_order(order)[source]
+
+ +
+
+warp(order)[source]
+

对order/market的封装

+

[description]

+
+
Arguments:
+
order {[type]} -- [description]
+
Returns:
+
[type] -- [description]
+
+
+ +
+ +
+
+

QUANTAXIS.QAMarket.QASimulatedBroker module

+
+
+class QUANTAXIS.QAMarket.QASimulatedBroker.QA_SimulatedBroker(*args, **kwargs)[source]
+

Bases: QUANTAXIS.QAMarket.QABroker.QA_Broker

+
+
+get_market(order)[source]
+
+ +
+
+query_data(code, start, end, frequence, market_type=None)[source]
+

标准格式是numpy

+
+ +
+
+receive_order(event)[source]
+
+ +
+ +
+
+

QUANTAXIS.QAMarket.QATrade module

+
+
+class QUANTAXIS.QAMarket.QATrade.QA_Trade(*args, **kwargs)[source]
+

Bases: object

+

多线程+generator模式

+
+
+cancel_order(*args, **kwargs)[source]
+
+ +
+
+connect(*args, **kwargs)[source]
+
+ +
+
+get_account_id(*args, **kwargs)[source]
+
+ +
+
+get_api_last_error(*args, **kwargs)[source]
+
+ +
+
+get_api_version(*args, **kwargs)[source]
+
+ +
+
+get_client_id(*args, **kwargs)[source]
+
+ +
+
+get_trading_day(*args, **kwargs)[source]
+
+ +
+
+insert_order(*args, **kwargs)[source]
+
+ +
+
+login(*args, **kwargs)[source]
+
+ +
+
+logout(*args, **kwargs)[source]
+
+ +
+
+on_cancel_order(*args, **kwargs)[source]
+
+ +
+
+on_cancel_order_event(*args, **kwargs)[source]
+
+ +
+
+on_connect(*args, **kwargs)[source]
+
+ +
+
+on_error(*args, **kwargs)[source]
+
+ +
+
+on_insert_order(*args, **kwargs)[source]
+
+ +
+
+on_order_event(*args, **kwargs)[source]
+
+ +
+
+on_query_assets(*args, **kwargs)[source]
+
+ +
+
+on_query_data(*args, **kwargs)[source]
+
+ +
+
+on_query_order(*args, **kwargs)[source]
+
+ +
+
+on_query_position(*args, **kwargs)[source]
+
+ +
+
+on_query_trade(*args, **kwargs)[source]
+
+ +
+
+on_trade_event(*args, **kwargs)[source]
+
+ +
+
+query_assets(*args, **kwargs)[source]
+
+ +
+
+query_data(*args, **kwargs)[source]
+
+ +
+
+query_order(*args, **kwargs)[source]
+
+ +
+
+query_position(*args, **kwargs)[source]
+
+ +
+
+query_trade(*args, **kwargs)[source]
+
+ +
+
+register_spi(*args, **kwargs)[source]
+
+ +
+
+release(*args, **kwargs)[source]
+
+ +
+
+subscribe_public_topic(*args, **kwargs)[source]
+
+ +
+ +
+
+

QUANTAXIS.QAMarket.shipaneBroker module

+
+
+class QUANTAXIS.QAMarket.shipaneBroker.SPETradeApi(endpoint='http://127.0.0.1:8888')[source]
+

Bases: QUANTAXIS.QAMarket.QABroker.QA_Broker

+
+
+call(func, params=None)[source]
+
+ +
+
+cancel_order(client_id, exchange_id, hth)[source]
+
+ +
+
+data_to_df(result)[source]
+
+ +
+
+get_quote(client_id, code)[source]
+
+ +
+
+logoff(client_id)[source]
+
+ +
+
+logon(ip, port, version, yyb_id, account_id, trade_account, jy_passwrod, tx_password)[source]
+
+ +
+
+ping()[source]
+
+ +
+
+query_data(client_id, category)[source]
+
+ +
+
+receive_order(event)[source]
+

0 限价委托; 上海限价委托 / 深圳限价委托 +1 市价委托(深圳对方最优价格) +2 市价委托(深圳本方最优价格) +3 市价委托(深圳即时成交剩余撤销) +4 市价委托(上海五档即成剩撤 / 深圳五档即成剩撤) +5 市价委托(深圳全额成交或撤销) +6 市价委托(上海五档即成转限价)

+
+ +
+
+repay(client_id, amount)[source]
+
+ +
+
+run(event)[source]
+
+ +
+
+send_order(client_id, category, price_type, gddm, zqdm, price, quantity)[source]
+
+ +
+ +
+
+

QUANTAXIS.QAMarket.shipaneclient module

+
+
+class QUANTAXIS.QAMarket.shipaneclient.Client(logger=None, **kwargs)[source]
+

Bases: object

+
+
+KEY_REGEX = 'key=([^&]*)'
+
+ +
+
+buy(client=None, timeout=None, **kwargs)[source]
+
+ +
+
+cancel(client=None, order_id=None, timeout=None)[source]
+
+ +
+
+cancel_all(client=None, timeout=None)[source]
+
+ +
+
+create_adjustment(client=None, request_json=None, timeout=None)[source]
+
+ +
+
+execute(client=None, timeout=None, **kwargs)[source]
+
+ +
+
+get_account(client=None, timeout=None)[source]
+
+ +
+
+get_orders(client=None, status='', timeout=None)[source]
+
+ +
+
+get_positions(client=None, media_type=<MediaType.DEFAULT: 'application/json'>, timeout=None)[source]
+
+ +
+
+get_statuses(timeout=None)[source]
+
+ +
+
+host
+
+ +
+
+ipo(client=None, timeout=None, **kwargs)[source]
+
+ +
+
+key
+
+ +
+
+port
+
+ +
+
+purchase_convertible_bonds(client=None, timeout=None)[source]
+
+ +
+
+purchase_new_stocks(client=None, timeout=None)[source]
+
+ +
+
+query(client=None, navigation=None, timeout=None)[source]
+
+ +
+
+query_convertible_bonds()[source]
+
+ +
+
+query_new_stocks()[source]
+
+ +
+
+sell(client=None, timeout=None, **kwargs)[source]
+
+ +
+
+shutdown_clients(timeout=None)[source]
+
+ +
+
+start_clients(timeout=None)[source]
+
+ +
+
+timeout
+
+ +
+ +
+
+class QUANTAXIS.QAMarket.shipaneclient.ConnectionMethod[source]
+

Bases: enum.Enum

+

An enumeration.

+
+
+DIRECT = 'DIRECT'
+
+ +
+
+PROXY = 'PROXY'
+
+ +
+ +
+
+class QUANTAXIS.QAMarket.shipaneclient.MediaType[source]
+

Bases: enum.Enum

+

An enumeration.

+
+
+DEFAULT = 'application/json'
+
+ +
+
+JOIN_QUANT = 'application/vnd.joinquant+json'
+
+ +
+ +
+
+

QUANTAXIS.QAMarket.tdxRealBroker module

+
+
+class QUANTAXIS.QAMarket.tdxRealBroker.TDXBroker(endpoint='http://127.0.0.1:10092/api', encoding='utf-8', enc_key=None, enc_iv=None)[source]
+

Bases: QUANTAXIS.QAMarket.QABroker.QA_Broker

+
+
+call(func, params=None)[source]
+
+ +
+
+cancel_order(client_id, exchange_id, hth)[source]
+
+ +
+
+data_to_df(result)[source]
+
+ +
+
+decrypt(source)[source]
+
+ +
+
+encrypt(source_obj)[source]
+
+ +
+
+get_quote(client_id, code)[source]
+
+ +
+
+logoff(client_id)[source]
+
+ +
+
+logon(ip, port, version, yyb_id, account_id, trade_account, jy_passwrod, tx_password)[source]
+
+ +
+
+ping()[source]
+
+ +
+
+query_data(client_id, category)[source]
+
+ +
+
+receive_order(event)[source]
+

0 限价委托; 上海限价委托 / 深圳限价委托 +1 市价委托(深圳对方最优价格) +2 市价委托(深圳本方最优价格) +3 市价委托(深圳即时成交剩余撤销) +4 市价委托(上海五档即成剩撤 / 深圳五档即成剩撤) +5 市价委托(深圳全额成交或撤销) +6 市价委托(上海五档即成转限价)

+
+ +
+
+repay(client_id, amount)[source]
+
+ +
+
+run(event)[source]
+
+ +
+
+send_order(client_id, category, price_type, gddm, zqdm, price, quantity)[source]
+
+ +
+ +
+
+class QUANTAXIS.QAMarket.tdxRealBroker.TdxTradeApiParams[source]
+

Bases: object

+

0 资金 +1 股份 +2 当日委托 +3 当日成交 +4 可撤单 +5 股东代码 +6 融资余额 +7 融券余额 +8 可融证券 +9 +10 +11 +12 可申购新股查询 +13 新股申购额度查询 +14 配号查询 +15 中签查询

+
+
+QUERY_CATEGORY_BALANCE_OF_MARGIN_LOAN = 6
+
+ +
+
+QUERY_CATEGORY_BALANCE_OF_STOCK_LOAN = 7
+
+ +
+
+QUERY_CATEGORY_CANCELABLE_ORDER = 4
+
+ +
+
+QUERY_CATEGORY_CASH = 0
+
+ +
+
+QUERY_CATEGORY_DEAL_OF_TODAY = 3
+
+ +
+
+QUERY_CATEGORY_NEW_STOCKS = 12
+
+ +
+
+QUERY_CATEGORY_NEW_STOCKS_QUOTA = 13
+
+ +
+
+QUERY_CATEGORY_NEW_STOCK_HIT = 15
+
+ +
+
+QUERY_CATEGORY_NEW_STOCK_NUMBER = 14
+
+ +
+
+QUERY_CATEGORY_OPERABLE_MARGIN_SOTCK = 8
+
+ +
+
+QUERY_CATEGORY_ORDER_OF_TODAY = 2
+
+ +
+
+QUERY_CATEGORY_SHAREHOLDERS_CODE = 5
+
+ +
+
+QUERY_CATEGORY_STOCKS = 1
+
+ +
+ +
+
+

Module contents

+
+
+ + +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/source/QUANTAXIS.QASU.html b/_build/html/source/QUANTAXIS.QASU.html new file mode 100644 index 000000000..e152b01f0 --- /dev/null +++ b/_build/html/source/QUANTAXIS.QASU.html @@ -0,0 +1,507 @@ + + + + + + + + QUANTAXIS.QASU package — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

QUANTAXIS.QASU package

+
+

Submodules

+
+
+

QUANTAXIS.QASU.main module

+
+
+QUANTAXIS.QASU.main.QA_SU_save_etf_day(engine, client=Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'))[source]
+

save etf_day

+
+
Arguments:
+
engine {[type]} -- [description]
+
Keyword Arguments:
+
client {[type]} -- [description] (default: {DATABASE})
+
+
+ +
+
+QUANTAXIS.QASU.main.QA_SU_save_etf_min(engine, client=Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'))[source]
+

save etf_min

+
+
Arguments:
+
engine {[type]} -- [description]
+
Keyword Arguments:
+
client {[type]} -- [description] (default: {DATABASE})
+
+
+ +
+
+QUANTAXIS.QASU.main.QA_SU_save_index_day(engine, client=Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'))[source]
+

save index_day

+
+
Arguments:
+
engine {[type]} -- [description]
+
Keyword Arguments:
+
client {[type]} -- [description] (default: {DATABASE})
+
+
+ +
+
+QUANTAXIS.QASU.main.QA_SU_save_index_min(engine, client=Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'))[source]
+

save index_min

+
+
Arguments:
+
engine {[type]} -- [description]
+
Keyword Arguments:
+
client {[type]} -- [description] (default: {DATABASE})
+
+
+ +
+
+QUANTAXIS.QASU.main.QA_SU_save_stock_block(engine, client=Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'))[source]
+

save stock_block

+
+
Arguments:
+
engine {[type]} -- [description]
+
Keyword Arguments:
+
client {[type]} -- [description] (default: {DATABASE})
+
+
+ +
+
+QUANTAXIS.QASU.main.QA_SU_save_stock_day(engine, client=Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'))[source]
+

save stock_day

+
+
Arguments:
+
engine {[type]} -- [description]
+
Keyword Arguments:
+
client {[type]} -- [description] (default: {DATABASE})
+
+
+ +
+
+QUANTAXIS.QASU.main.QA_SU_save_stock_info(engine, client=Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'))[source]
+

save stock info

+
+
Arguments:
+
engine {[type]} -- [description]
+
Keyword Arguments:
+
client {[type]} -- [description] (default: {DATABASE})
+
+
+ +
+
+QUANTAXIS.QASU.main.QA_SU_save_stock_list(engine, client=Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'))[source]
+

save stock_list

+
+
Arguments:
+
engine {[type]} -- [description]
+
Keyword Arguments:
+
client {[type]} -- [description] (default: {DATABASE})
+
+
+ +
+
+QUANTAXIS.QASU.main.QA_SU_save_stock_min(engine, client=Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'))[source]
+

save stock_min

+
+
Arguments:
+
engine {[type]} -- [description]
+
Keyword Arguments:
+
client {[type]} -- [description] (default: {DATABASE})
+
+
+ +
+
+QUANTAXIS.QASU.main.QA_SU_save_stock_min_5(file_dir, client=Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'))[source]
+

save stock_min5

+
+
Arguments:
+
file_dir {[type]} -- [description]
+
Keyword Arguments:
+
client {[type]} -- [description] (default: {DATABASE})
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+QUANTAXIS.QASU.main.QA_SU_save_stock_xdxr(engine, client=Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'))[source]
+

save stock_xdxr

+
+
Arguments:
+
engine {[type]} -- [description]
+
Keyword Arguments:
+
client {[type]} -- [description] (default: {DATABASE})
+
+
+ +
+
+QUANTAXIS.QASU.main.select_save_engine(engine)[source]
+

select save_engine

+
+
Arguments:
+
engine {[type]} -- [description]
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+

QUANTAXIS.QASU.save_account module

+
+
+QUANTAXIS.QASU.save_account.save_account(message, collection=Collection(Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'), 'account'))[source]
+

save account

+
+
Arguments:
+
message {[type]} -- [description]
+
Keyword Arguments:
+
collection {[type]} -- [description] (default: {DATABASE})
+
+
+ +
+
+QUANTAXIS.QASU.save_account.save_riskanalysis(message, collection=Collection(Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'), 'risk'))[source]
+
+ +
+
+QUANTAXIS.QASU.save_account.update_account(mes, collection=Collection(Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'), 'account'))[source]
+

update the account with account message

+
+
Arguments:
+
mes {[type]} -- [description]
+
Keyword Arguments:
+
collection {[type]} -- [description] (default: {DATABASE})
+
+
+ +
+
+

QUANTAXIS.QASU.save_backtest module

+
+
+QUANTAXIS.QASU.save_backtest.QA_SU_save_account_message(message, client)[source]
+
+ +
+
+QUANTAXIS.QASU.save_backtest.QA_SU_save_account_to_csv(message, path='E:\\quantaxis')[source]
+
+ +
+
+QUANTAXIS.QASU.save_backtest.QA_SU_save_backtest_message(message, client)[source]
+
+ +
+
+QUANTAXIS.QASU.save_backtest.QA_SU_save_pnl_to_csv(detail, cookie)[source]
+
+ +
+
+

QUANTAXIS.QASU.save_local module

+
+
+QUANTAXIS.QASU.save_local.make_cache()[source]
+
+ +
+
+QUANTAXIS.QASU.save_local.make_dir()[source]
+
+ +
+
+

QUANTAXIS.QASU.save_tdx module

+
+
+QUANTAXIS.QASU.save_tdx.QA_SU_save_etf_day(client=Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'))[source]
+

save etf_day

+
+
Keyword Arguments:
+
client {[type]} -- [description] (default: {DATABASE})
+
+
+ +
+
+QUANTAXIS.QASU.save_tdx.QA_SU_save_etf_min(client=Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'))[source]
+

save etf_min

+
+
Keyword Arguments:
+
client {[type]} -- [description] (default: {DATABASE})
+
+
+ +
+
+QUANTAXIS.QASU.save_tdx.QA_SU_save_index_day(client=Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'))[source]
+

save index_day

+
+
Keyword Arguments:
+
client {[type]} -- [description] (default: {DATABASE})
+
+
+ +
+
+QUANTAXIS.QASU.save_tdx.QA_SU_save_index_min(client=Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'))[source]
+

save index_min

+
+
Keyword Arguments:
+
client {[type]} -- [description] (default: {DATABASE})
+
+
+ +
+
+QUANTAXIS.QASU.save_tdx.QA_SU_save_stock_block(client=Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'))[source]
+

save stock_block

+
+
Keyword Arguments:
+
client {[type]} -- [description] (default: {DATABASE})
+
+
+ +
+
+QUANTAXIS.QASU.save_tdx.QA_SU_save_stock_day(client=Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'))[source]
+

save stock_day

+
+
Keyword Arguments:
+
client {[type]} -- [description] (default: {DATABASE})
+
+
+ +
+
+QUANTAXIS.QASU.save_tdx.QA_SU_save_stock_info(client=Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'))[source]
+

save stock_info

+
+
Keyword Arguments:
+
client {[type]} -- [description] (default: {DATABASE})
+
+
+ +
+
+QUANTAXIS.QASU.save_tdx.QA_SU_save_stock_list(client=Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'))[source]
+

save stock_list

+
+
Keyword Arguments:
+
client {[type]} -- [description] (default: {DATABASE})
+
+
+ +
+
+QUANTAXIS.QASU.save_tdx.QA_SU_save_stock_min(client=Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'))[source]
+

save stock_min

+
+
Keyword Arguments:
+
client {[type]} -- [description] (default: {DATABASE})
+
+
+ +
+
+QUANTAXIS.QASU.save_tdx.QA_SU_save_stock_transaction(client=Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'))[source]
+

save stock_transaction

+
+
Keyword Arguments:
+
client {[type]} -- [description] (default: {DATABASE})
+
+
+ +
+
+QUANTAXIS.QASU.save_tdx.QA_SU_save_stock_xdxr(client=Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'))[source]
+

[summary]

+
+
Keyword Arguments:
+
client {[type]} -- [description] (default: {DATABASE})
+
+
+ +
+
+QUANTAXIS.QASU.save_tdx.now_time()[source]
+
+ +
+
+

QUANTAXIS.QASU.save_tdx_file module

+
+
+QUANTAXIS.QASU.save_tdx_file.QA_save_tdx_to_mongo(file_dir, client=Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'))[source]
+

save file

+
+
Arguments:
+
file_dir {str:direction} -- 文件的地址
+
Keyword Arguments:
+
client {Mongodb:Connection} -- Mongo Connection (default: {DATABASE})
+
+
+ +
+
+

QUANTAXIS.QASU.save_tushare module

+
+
+QUANTAXIS.QASU.save_tushare.QA_SU_save_stock_info(client=Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'))[source]
+
+ +
+
+QUANTAXIS.QASU.save_tushare.QA_SU_save_stock_list(client=Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'))[source]
+
+ +
+
+QUANTAXIS.QASU.save_tushare.QA_SU_save_trade_date_all(client=Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'))[source]
+
+ +
+
+QUANTAXIS.QASU.save_tushare.QA_save_stock_day_all(client=Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'))[source]
+
+ +
+
+QUANTAXIS.QASU.save_tushare.QA_save_stock_day_all_bfq(client=Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'))[source]
+
+ +
+
+QUANTAXIS.QASU.save_tushare.QA_save_stock_day_with_fqfactor(client=Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'))[source]
+
+ +
+
+

QUANTAXIS.QASU.user module

+
+
+QUANTAXIS.QASU.user.QA_user_sign_in(name, password, client)[source]
+
+ +
+
+QUANTAXIS.QASU.user.QA_user_sign_up(name, password, client)[source]
+
+ +
+
+

Module contents

+
+
+ + +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/source/QUANTAXIS.QAUtil.html b/_build/html/source/QUANTAXIS.QAUtil.html new file mode 100644 index 000000000..6b6bf7283 --- /dev/null +++ b/_build/html/source/QUANTAXIS.QAUtil.html @@ -0,0 +1,1454 @@ + + + + + + + + QUANTAXIS.QAUtil package — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

QUANTAXIS.QAUtil package

+
+

Submodules

+
+
+

QUANTAXIS.QAUtil.QAAuth module

+
+
+

QUANTAXIS.QAUtil.QABar module

+
+
+QUANTAXIS.QAUtil.QABar.QA_util_make_hour_index(day, type_='1h')[source]
+

创建股票的小时线的index

+
+
Arguments:
+
day {[type]} -- [description]
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+QUANTAXIS.QAUtil.QABar.QA_util_make_min_index(day, type_='1min')[source]
+

创建股票分钟线的index

+
+
Arguments:
+
day {[type]} -- [description]
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+QUANTAXIS.QAUtil.QABar.QA_util_time_gap(time, gap, methods, type_)[source]
+

分钟线回测的时候的gap

+
+ +
+
+

QUANTAXIS.QAUtil.QACfg module

+
+
+QUANTAXIS.QAUtil.QACfg.QA_util_cfg_initial(CONFIG_FILE)[source]
+

[summary]

+
+
Arguments:
+
CONFIG_FILE {[type]} -- [description]
+
+
+ +
+
+QUANTAXIS.QAUtil.QACfg.QA_util_get_cfg(__file_path, __file_name)[source]
+

[summary]

+
+
Arguments:
+
__file_path {[type]} -- [description] +__file_name {[type]} -- [description]
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+

QUANTAXIS.QAUtil.QACode module

+

该文件主要是负责一些对于code名称的处理

+
+
+QUANTAXIS.QAUtil.QACode.QA_util_code_tolist(code)[source]
+
+ +
+
+QUANTAXIS.QAUtil.QACode.QA_util_code_tostr(code)[source]
+

将所有沪深股票从数字转化到6位的代码

+

因为有时候在csv等转换的时候,诸如 000001的股票会变成office强制转化成数字1

+
+ +
+
+

QUANTAXIS.QAUtil.QACsv module

+
+
+QUANTAXIS.QAUtil.QACsv.QA_util_save_csv(data, name, column, location)[source]
+

将list保存成csv +第一个参数是list +第二个参数是要保存的名字 +第三个参数是行的名称(可选) +第四个是保存位置(可选)

+

@yutiansut

+
+ +
+
+

QUANTAXIS.QAUtil.QADate module

+
+
+QUANTAXIS.QAUtil.QADate.QA_util_calc_time(func, *args, **kwargs)[source]
+

耗时长度的装饰器

+
+ +
+
+QUANTAXIS.QAUtil.QADate.QA_util_date_int2str(date)[source]
+

[summary]

+
+
Arguments:
+
date {[type]} -- [description]
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+QUANTAXIS.QAUtil.QADate.QA_util_date_stamp(date)[source]
+

[summary]

+
+
Arguments:
+
date {[type]} -- [description]
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+QUANTAXIS.QAUtil.QADate.QA_util_date_str2int(date)[source]
+

[summary]

+
+
Arguments:
+
date {[type]} -- [description]
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+QUANTAXIS.QAUtil.QADate.QA_util_date_today()[source]
+

[summary]

+
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+QUANTAXIS.QAUtil.QADate.QA_util_date_valid(date)[source]
+

[summary]

+
+
Arguments:
+
date {[type]} -- [description]
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+QUANTAXIS.QAUtil.QADate.QA_util_get_date_index(date, trade_list)[source]
+

返回在trade_list中的index位置

+
+
Arguments:
+
date {[type]} -- [description] +trade_list {[type]} -- [description]
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+QUANTAXIS.QAUtil.QADate.QA_util_get_index_date(id, trade_list)[source]
+
+ +
+
+QUANTAXIS.QAUtil.QADate.QA_util_id2date(idx, client)[source]
+

[summary]

+
+
Arguments:
+
idx {[type]} -- [description] +client {[type]} -- [description]
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+QUANTAXIS.QAUtil.QADate.QA_util_is_trade(date, code, client)[source]
+

判断是否是交易日

+
+
Arguments:
+
date {[type]} -- [description] +code {[type]} -- [description] +client {[type]} -- [description]
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+QUANTAXIS.QAUtil.QADate.QA_util_ms_stamp(ms)[source]
+

[summary]

+
+
Arguments:
+
ms {[type]} -- [description]
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+QUANTAXIS.QAUtil.QADate.QA_util_realtime(strtime, client)[source]
+

[summary]

+
+
Arguments:
+
strtime {[type]} -- [description] +client {[type]} -- [description]
+
+
+ +
+
+QUANTAXIS.QAUtil.QADate.QA_util_select_hours(time=None, gt=None, lt=None, gte=None, lte=None)[source]
+

quantaxis的时间选择函数,约定时间的范围,比如早上9点到11点

+
+ +
+
+QUANTAXIS.QAUtil.QADate.QA_util_select_min(time=None, gt=None, lt=None, gte=None, lte=None)[source]
+

quantaxis的时间选择函数,约定时间的范围,比如30分到59分

+
+ +
+
+QUANTAXIS.QAUtil.QADate.QA_util_stamp2datetime(timestamp)[source]
+

datestamp转datetime

+

pandas转出来的timestamp是13位整数 要/1000

+
+ +
+
+QUANTAXIS.QAUtil.QADate.QA_util_time_delay(time_=0)[source]
+

这是一个用于复用/比如说@装饰器的延时函数 使用threading里面的延时,为了是不阻塞进程 有时候,同时发进去两个函数,第一个函数需要延时 第二个不需要的话,用sleep就会阻塞掉第二个进程

+
+ +
+
+QUANTAXIS.QAUtil.QADate.QA_util_time_now()[source]
+

[summary]

+
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+QUANTAXIS.QAUtil.QADate.QA_util_time_stamp(time_)[source]
+

数据格式最好是%Y-%m-%d %H:%M:%S 中间要有空格

+
+ +
+
+QUANTAXIS.QAUtil.QADate.QA_util_to_datetime(time)[source]
+

[summary]

+
+
Arguments:
+
time {[type]} -- [description]
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+

QUANTAXIS.QAUtil.QADate_trade module

+
+
+QUANTAXIS.QAUtil.QADate_trade.QA_util_date_gap(date, gap, methods)[source]
+

[summary]

+
+
Arguments:
+
date {[type]} -- [description] +gap {[type]} -- [description] +methods {[type]} -- [description]
+
Returns:
+
[type] -- [description]
+
+
+ +
+
+QUANTAXIS.QAUtil.QADate_trade.QA_util_get_last_day(date, n=1)[source]
+

得到上一个(n)交易日

+
+ +
+
+QUANTAXIS.QAUtil.QADate_trade.QA_util_get_next_day(date, n=1)[source]
+

得到下一个(n)交易日

+
+ +
+
+QUANTAXIS.QAUtil.QADate_trade.QA_util_get_real_date(date, trade_list=['1990-12-19', '1990-12-20', '1990-12-21', '1990-12-24', '1990-12-25', '1990-12-26', '1990-12-27', '1990-12-28', '1990-12-31', '1991-01-02', '1991-01-03', '1991-01-04', '1991-01-07', '1991-01-08', '1991-01-09', '1991-01-10', '1991-01-11', '1991-01-14', '1991-01-15', '1991-01-16', '1991-01-17', '1991-01-18', '1991-01-21', '1991-01-22', '1991-01-23', '1991-01-24', '1991-01-25', '1991-01-28', '1991-01-29', '1991-01-30', '1991-01-31', '1991-02-01', '1991-02-04', '1991-02-05', '1991-02-06', '1991-02-07', '1991-02-08', '1991-02-11', '1991-02-12', '1991-02-13', '1991-02-14', '1991-02-19', '1991-02-20', '1991-02-21', '1991-02-22', '1991-02-25', '1991-02-26', '1991-02-27', '1991-02-28', '1991-03-01', '1991-03-04', '1991-03-05', '1991-03-06', '1991-03-07', '1991-03-08', '1991-03-11', '1991-03-12', '1991-03-13', '1991-03-14', '1991-03-15', '1991-03-18', '1991-03-19', '1991-03-20', '1991-03-21', '1991-03-22', '1991-03-25', '1991-03-26', '1991-03-27', '1991-03-28', '1991-03-29', '1991-04-01', '1991-04-02', '1991-04-03', '1991-04-04', '1991-04-05', '1991-04-08', '1991-04-09', '1991-04-10', '1991-04-11', '1991-04-12', '1991-04-15', '1991-04-16', '1991-04-17', '1991-04-18', '1991-04-19', '1991-04-22', '1991-04-23', '1991-04-24', '1991-04-25', '1991-04-26', '1991-04-29', '1991-04-30', '1991-05-02', '1991-05-03', '1991-05-06', '1991-05-07', '1991-05-08', '1991-05-09', '1991-05-10', '1991-05-13', '1991-05-14', '1991-05-15', '1991-05-16', '1991-05-17', '1991-05-20', '1991-05-21', '1991-05-22', '1991-05-23', '1991-05-24', '1991-05-27', '1991-05-28', '1991-05-29', '1991-05-30', '1991-05-31', '1991-06-03', '1991-06-04', '1991-06-05', '1991-06-06', '1991-06-07', '1991-06-10', '1991-06-11', '1991-06-12', '1991-06-13', '1991-06-14', '1991-06-17', '1991-06-18', '1991-06-19', '1991-06-20', '1991-06-21', '1991-06-24', '1991-06-25', '1991-06-26', '1991-06-27', '1991-06-28', '1991-07-01', '1991-07-02', '1991-07-03', '1991-07-04', '1991-07-05', '1991-07-08', '1991-07-09', '1991-07-10', '1991-07-11', '1991-07-12', '1991-07-15', '1991-07-16', '1991-07-17', '1991-07-18', '1991-07-19', '1991-07-22', '1991-07-23', '1991-07-24', '1991-07-25', '1991-07-26', '1991-07-29', '1991-07-30', '1991-07-31', '1991-08-01', '1991-08-02', '1991-08-05', '1991-08-06', '1991-08-07', '1991-08-08', '1991-08-09', '1991-08-12', '1991-08-13', '1991-08-14', '1991-08-15', '1991-08-16', '1991-08-19', '1991-08-20', '1991-08-21', '1991-08-22', '1991-08-23', '1991-08-26', '1991-08-27', '1991-08-28', '1991-08-29', '1991-08-30', '1991-09-02', '1991-09-03', '1991-09-04', '1991-09-05', '1991-09-06', '1991-09-09', '1991-09-10', '1991-09-11', '1991-09-12', '1991-09-13', '1991-09-16', '1991-09-17', '1991-09-18', '1991-09-19', '1991-09-20', '1991-09-23', '1991-09-24', '1991-09-25', '1991-09-26', '1991-09-27', '1991-09-30', '1991-10-03', '1991-10-04', '1991-10-07', '1991-10-08', '1991-10-09', '1991-10-10', '1991-10-11', '1991-10-14', '1991-10-15', '1991-10-16', '1991-10-17', '1991-10-18', '1991-10-21', '1991-10-22', '1991-10-23', '1991-10-24', '1991-10-25', '1991-10-28', '1991-10-29', '1991-10-30', '1991-10-31', '1991-11-01', '1991-11-04', '1991-11-05', '1991-11-06', '1991-11-07', '1991-11-08', '1991-11-11', '1991-11-12', '1991-11-13', '1991-11-14', '1991-11-15', '1991-11-18', '1991-11-19', '1991-11-20', '1991-11-21', '1991-11-22', '1991-11-25', '1991-11-26', '1991-11-27', '1991-11-28', '1991-11-29', '1991-12-02', '1991-12-03', '1991-12-04', '1991-12-05', '1991-12-06', '1991-12-09', '1991-12-10', '1991-12-11', '1991-12-12', '1991-12-13', '1991-12-16', '1991-12-17', '1991-12-18', '1991-12-19', '1991-12-20', '1991-12-23', '1991-12-24', '1991-12-25', '1991-12-26', '1991-12-27', '1991-12-30', '1991-12-31', '1992-01-02', '1992-01-03', '1992-01-06', '1992-01-07', '1992-01-08', '1992-01-09', '1992-01-10', '1992-01-13', '1992-01-14', '1992-01-15', '1992-01-16', '1992-01-17', '1992-01-20', '1992-01-21', '1992-01-22', '1992-01-23', '1992-01-24', '1992-01-27', '1992-01-28', '1992-01-29', '1992-01-30', '1992-01-31', '1992-02-03', '1992-02-07', '1992-02-10', '1992-02-11', '1992-02-12', '1992-02-13', '1992-02-14', '1992-02-17', '1992-02-18', '1992-02-19', '1992-02-20', '1992-02-21', '1992-02-24', '1992-02-25', '1992-02-26', '1992-02-27', '1992-02-28', '1992-03-02', '1992-03-03', '1992-03-04', '1992-03-05', '1992-03-06', '1992-03-09', '1992-03-10', '1992-03-11', '1992-03-12', '1992-03-13', '1992-03-16', '1992-03-17', '1992-03-18', '1992-03-19', '1992-03-20', '1992-03-23', '1992-03-24', '1992-03-25', '1992-03-26', '1992-03-27', '1992-03-30', '1992-03-31', '1992-04-01', '1992-04-02', '1992-04-03', '1992-04-06', '1992-04-07', '1992-04-08', '1992-04-09', '1992-04-10', '1992-04-13', '1992-04-14', '1992-04-15', '1992-04-16', '1992-04-17', '1992-04-20', '1992-04-21', '1992-04-22', '1992-04-23', '1992-04-24', '1992-04-27', '1992-04-28', '1992-04-29', '1992-04-30', '1992-05-04', '1992-05-05', '1992-05-06', '1992-05-07', '1992-05-08', '1992-05-11', '1992-05-12', '1992-05-13', '1992-05-14', '1992-05-15', '1992-05-18', '1992-05-19', '1992-05-20', '1992-05-21', '1992-05-22', '1992-05-25', '1992-05-26', '1992-05-27', '1992-05-28', '1992-05-29', '1992-06-01', '1992-06-02', '1992-06-03', '1992-06-04', '1992-06-05', '1992-06-08', '1992-06-09', '1992-06-10', '1992-06-11', '1992-06-12', '1992-06-15', '1992-06-16', '1992-06-17', '1992-06-18', '1992-06-19', '1992-06-22', '1992-06-23', '1992-06-24', '1992-06-25', '1992-06-26', '1992-06-29', '1992-06-30', '1992-07-01', '1992-07-02', '1992-07-03', '1992-07-06', '1992-07-07', '1992-07-08', '1992-07-09', '1992-07-10', '1992-07-13', '1992-07-14', '1992-07-15', '1992-07-16', '1992-07-17', '1992-07-20', '1992-07-21', '1992-07-22', '1992-07-23', '1992-07-24', '1992-07-27', '1992-07-28', '1992-07-29', '1992-07-30', '1992-07-31', '1992-08-03', '1992-08-04', '1992-08-05', '1992-08-06', '1992-08-07', '1992-08-10', '1992-08-11', '1992-08-12', '1992-08-13', '1992-08-14', '1992-08-17', '1992-08-18', '1992-08-19', '1992-08-20', '1992-08-21', '1992-08-24', '1992-08-25', '1992-08-26', '1992-08-27', '1992-08-28', '1992-08-31', '1992-09-01', '1992-09-02', '1992-09-03', '1992-09-04', '1992-09-07', '1992-09-08', '1992-09-09', '1992-09-10', '1992-09-11', '1992-09-14', '1992-09-15', '1992-09-16', '1992-09-17', '1992-09-18', '1992-09-21', '1992-09-22', '1992-09-23', '1992-09-24', '1992-09-25', '1992-09-28', '1992-09-29', '1992-09-30', '1992-10-05', '1992-10-06', '1992-10-07', '1992-10-08', '1992-10-09', '1992-10-12', '1992-10-13', '1992-10-14', '1992-10-15', '1992-10-16', '1992-10-19', '1992-10-20', '1992-10-21', '1992-10-22', '1992-10-23', '1992-10-26', '1992-10-27', '1992-10-28', '1992-10-29', '1992-10-30', '1992-11-02', '1992-11-03', '1992-11-04', '1992-11-05', '1992-11-06', '1992-11-09', '1992-11-10', '1992-11-11', '1992-11-12', '1992-11-13', '1992-11-16', '1992-11-17', '1992-11-18', '1992-11-19', '1992-11-20', '1992-11-23', '1992-11-24', '1992-11-25', '1992-11-26', '1992-11-27', '1992-11-30', '1992-12-01', '1992-12-02', '1992-12-03', '1992-12-04', '1992-12-07', '1992-12-08', '1992-12-09', '1992-12-10', '1992-12-11', '1992-12-14', '1992-12-15', '1992-12-16', '1992-12-17', '1992-12-18', '1992-12-21', '1992-12-22', '1992-12-23', '1992-12-24', '1992-12-25', '1992-12-28', '1992-12-29', '1992-12-30', '1992-12-31', '1993-01-04', '1993-01-05', '1993-01-06', '1993-01-07', '1993-01-08', '1993-01-11', '1993-01-12', '1993-01-13', '1993-01-14', '1993-01-15', '1993-01-18', '1993-01-19', '1993-01-20', '1993-01-21', '1993-01-22', '1993-01-27', '1993-01-28', '1993-01-29', '1993-02-01', '1993-02-02', '1993-02-03', '1993-02-04', '1993-02-05', '1993-02-08', '1993-02-09', '1993-02-10', '1993-02-11', '1993-02-12', '1993-02-15', '1993-02-16', '1993-02-17', '1993-02-18', '1993-02-19', '1993-02-22', '1993-02-23', '1993-02-24', '1993-02-25', '1993-02-26', '1993-03-01', '1993-03-02', '1993-03-03', '1993-03-04', '1993-03-05', '1993-03-08', '1993-03-09', '1993-03-10', '1993-03-11', '1993-03-12', '1993-03-15', '1993-03-16', '1993-03-17', '1993-03-18', '1993-03-19', '1993-03-22', '1993-03-23', '1993-03-24', '1993-03-25', '1993-03-26', '1993-03-29', '1993-03-30', '1993-03-31', '1993-04-01', '1993-04-02', '1993-04-05', '1993-04-06', '1993-04-07', '1993-04-08', '1993-04-09', '1993-04-12', '1993-04-13', '1993-04-14', '1993-04-15', '1993-04-16', '1993-04-19', '1993-04-20', '1993-04-21', '1993-04-22', '1993-04-23', '1993-04-26', '1993-04-27', '1993-04-28', '1993-04-29', '1993-04-30', '1993-05-03', '1993-05-04', '1993-05-05', '1993-05-06', '1993-05-07', '1993-05-10', '1993-05-11', '1993-05-12', '1993-05-13', '1993-05-14', '1993-05-17', '1993-05-18', '1993-05-19', '1993-05-20', '1993-05-21', '1993-05-24', '1993-05-25', '1993-05-26', '1993-05-27', '1993-05-28', '1993-05-31', '1993-06-01', '1993-06-02', '1993-06-03', '1993-06-04', '1993-06-07', '1993-06-08', '1993-06-09', '1993-06-10', '1993-06-11', '1993-06-14', '1993-06-15', '1993-06-16', '1993-06-17', '1993-06-18', '1993-06-21', '1993-06-22', '1993-06-23', '1993-06-24', '1993-06-25', '1993-06-28', '1993-06-29', '1993-06-30', '1993-07-01', '1993-07-02', '1993-07-05', '1993-07-06', '1993-07-07', '1993-07-08', '1993-07-09', '1993-07-12', '1993-07-13', '1993-07-14', '1993-07-15', '1993-07-16', '1993-07-19', '1993-07-20', '1993-07-21', '1993-07-22', '1993-07-23', '1993-07-26', '1993-07-27', '1993-07-28', '1993-07-29', '1993-07-30', '1993-08-02', '1993-08-03', '1993-08-04', '1993-08-05', '1993-08-06', '1993-08-09', '1993-08-10', '1993-08-11', '1993-08-12', '1993-08-13', '1993-08-16', '1993-08-17', '1993-08-18', '1993-08-19', '1993-08-20', '1993-08-23', '1993-08-24', '1993-08-25', '1993-08-26', '1993-08-27', '1993-08-30', '1993-08-31', '1993-09-01', '1993-09-02', '1993-09-03', '1993-09-06', '1993-09-07', '1993-09-08', '1993-09-09', '1993-09-10', '1993-09-13', '1993-09-14', '1993-09-15', '1993-09-16', '1993-09-17', '1993-09-20', '1993-09-21', '1993-09-22', '1993-09-23', '1993-09-24', '1993-09-27', '1993-09-28', '1993-09-29', '1993-09-30', '1993-10-04', '1993-10-05', '1993-10-06', '1993-10-07', '1993-10-08', '1993-10-11', '1993-10-12', '1993-10-13', '1993-10-14', '1993-10-15', '1993-10-18', '1993-10-19', '1993-10-20', '1993-10-21', '1993-10-22', '1993-10-25', '1993-10-26', '1993-10-27', '1993-10-28', '1993-10-29', '1993-11-01', '1993-11-02', '1993-11-03', '1993-11-04', '1993-11-05', '1993-11-08', '1993-11-09', '1993-11-10', '1993-11-11', '1993-11-12', '1993-11-15', '1993-11-16', '1993-11-17', '1993-11-18', '1993-11-19', '1993-11-22', '1993-11-23', '1993-11-24', '1993-11-25', '1993-11-26', '1993-11-29', '1993-11-30', '1993-12-01', '1993-12-02', '1993-12-03', '1993-12-06', '1993-12-07', '1993-12-08', '1993-12-09', '1993-12-10', '1993-12-13', '1993-12-14', '1993-12-15', '1993-12-16', '1993-12-17', '1993-12-20', '1993-12-21', '1993-12-22', '1993-12-23', '1993-12-24', '1993-12-27', '1993-12-28', '1993-12-29', '1993-12-30', '1993-12-31', '1994-01-03', '1994-01-04', '1994-01-05', '1994-01-06', '1994-01-07', '1994-01-10', '1994-01-11', '1994-01-12', '1994-01-13', '1994-01-14', '1994-01-17', '1994-01-18', '1994-01-19', '1994-01-20', '1994-01-21', '1994-01-24', '1994-01-25', '1994-01-26', '1994-01-27', '1994-01-28', '1994-01-31', '1994-02-01', '1994-02-02', '1994-02-03', '1994-02-04', '1994-02-14', '1994-02-15', '1994-02-16', '1994-02-17', '1994-02-18', '1994-02-21', '1994-02-22', '1994-02-23', '1994-02-24', '1994-02-25', '1994-02-28', '1994-03-01', '1994-03-02', '1994-03-03', '1994-03-04', '1994-03-07', '1994-03-08', '1994-03-09', '1994-03-10', '1994-03-11', '1994-03-14', '1994-03-15', '1994-03-16', '1994-03-17', '1994-03-18', '1994-03-21', '1994-03-22', '1994-03-23', '1994-03-24', '1994-03-25', '1994-03-28', '1994-03-29', '1994-03-30', '1994-03-31', '1994-04-01', '1994-04-04', '1994-04-05', '1994-04-06', '1994-04-07', '1994-04-08', '1994-04-11', '1994-04-12', '1994-04-13', '1994-04-14', '1994-04-15', '1994-04-18', '1994-04-19', '1994-04-20', '1994-04-21', '1994-04-22', '1994-04-25', '1994-04-26', '1994-04-27', '1994-04-28', '1994-04-29', '1994-05-03', '1994-05-04', '1994-05-05', '1994-05-06', '1994-05-09', '1994-05-10', '1994-05-11', '1994-05-12', '1994-05-13', '1994-05-16', '1994-05-17', '1994-05-18', '1994-05-19', '1994-05-20', '1994-05-23', '1994-05-24', '1994-05-25', '1994-05-26', '1994-05-27', '1994-05-30', '1994-05-31', '1994-06-01', '1994-06-02', '1994-06-03', '1994-06-06', '1994-06-07', '1994-06-08', '1994-06-09', '1994-06-10', '1994-06-13', '1994-06-14', '1994-06-15', '1994-06-16', '1994-06-17', '1994-06-20', '1994-06-21', '1994-06-22', '1994-06-23', '1994-06-24', '1994-06-27', '1994-06-28', '1994-06-29', '1994-06-30', '1994-07-01', '1994-07-04', '1994-07-05', '1994-07-06', '1994-07-07', '1994-07-08', '1994-07-11', '1994-07-12', '1994-07-13', '1994-07-14', '1994-07-15', '1994-07-18', '1994-07-19', '1994-07-20', '1994-07-21', '1994-07-22', '1994-07-25', '1994-07-26', '1994-07-27', '1994-07-28', '1994-07-29', '1994-08-01', '1994-08-02', '1994-08-03', '1994-08-04', '1994-08-05', '1994-08-08', '1994-08-09', '1994-08-10', '1994-08-11', '1994-08-12', '1994-08-15', '1994-08-16', '1994-08-17', '1994-08-18', '1994-08-19', '1994-08-22', '1994-08-23', '1994-08-24', '1994-08-25', '1994-08-26', '1994-08-29', '1994-08-30', '1994-08-31', '1994-09-01', '1994-09-02', '1994-09-05', '1994-09-06', '1994-09-07', '1994-09-08', '1994-09-09', '1994-09-12', '1994-09-13', '1994-09-14', '1994-09-15', '1994-09-16', '1994-09-19', '1994-09-20', '1994-09-21', '1994-09-22', '1994-09-23', '1994-09-26', '1994-09-27', '1994-09-28', '1994-09-29', '1994-09-30', '1994-10-05', '1994-10-06', '1994-10-07', '1994-10-10', '1994-10-11', '1994-10-12', '1994-10-13', '1994-10-14', '1994-10-17', '1994-10-18', '1994-10-19', '1994-10-20', '1994-10-21', '1994-10-24', '1994-10-25', '1994-10-26', '1994-10-27', '1994-10-28', '1994-10-31', '1994-11-01', '1994-11-02', '1994-11-03', '1994-11-04', '1994-11-07', '1994-11-08', '1994-11-09', '1994-11-10', '1994-11-11', '1994-11-14', '1994-11-15', '1994-11-16', '1994-11-17', '1994-11-18', '1994-11-21', '1994-11-22', '1994-11-23', '1994-11-24', '1994-11-25', '1994-11-28', '1994-11-29', '1994-11-30', '1994-12-01', '1994-12-02', '1994-12-05', '1994-12-06', '1994-12-07', '1994-12-08', '1994-12-09', '1994-12-12', '1994-12-13', '1994-12-14', '1994-12-15', '1994-12-16', '1994-12-19', '1994-12-20', '1994-12-21', '1994-12-22', '1994-12-23', '1994-12-26', '1994-12-27', '1994-12-28', '1994-12-29', '1994-12-30', '1995-01-03', '1995-01-04', '1995-01-05', '1995-01-06', '1995-01-09', '1995-01-10', '1995-01-11', '1995-01-12', '1995-01-13', '1995-01-16', '1995-01-17', '1995-01-18', '1995-01-19', '1995-01-20', '1995-01-23', '1995-01-24', '1995-01-25', '1995-01-26', '1995-01-27', '1995-02-06', '1995-02-07', '1995-02-08', '1995-02-09', '1995-02-10', '1995-02-13', '1995-02-14', '1995-02-15', '1995-02-16', '1995-02-17', '1995-02-20', '1995-02-21', '1995-02-22', '1995-02-23', '1995-02-24', '1995-02-27', '1995-02-28', '1995-03-01', '1995-03-02', '1995-03-03', '1995-03-06', '1995-03-07', '1995-03-08', '1995-03-09', '1995-03-10', '1995-03-13', '1995-03-14', '1995-03-15', '1995-03-16', '1995-03-17', '1995-03-20', '1995-03-21', '1995-03-22', '1995-03-23', '1995-03-24', '1995-03-27', '1995-03-28', '1995-03-29', '1995-03-30', '1995-03-31', '1995-04-03', '1995-04-04', '1995-04-05', '1995-04-06', '1995-04-07', '1995-04-10', '1995-04-11', '1995-04-12', '1995-04-13', '1995-04-14', '1995-04-17', '1995-04-18', '1995-04-19', '1995-04-20', '1995-04-21', '1995-04-24', '1995-04-25', '1995-04-26', '1995-04-27', '1995-04-28', '1995-05-02', '1995-05-03', '1995-05-04', '1995-05-05', '1995-05-08', '1995-05-09', '1995-05-10', '1995-05-11', '1995-05-12', '1995-05-15', '1995-05-16', '1995-05-17', '1995-05-18', '1995-05-19', '1995-05-22', '1995-05-23', '1995-05-24', '1995-05-25', '1995-05-26', '1995-05-29', '1995-05-30', '1995-05-31', '1995-06-01', '1995-06-02', '1995-06-05', '1995-06-06', '1995-06-07', '1995-06-08', '1995-06-09', '1995-06-12', '1995-06-13', '1995-06-14', '1995-06-15', '1995-06-16', '1995-06-19', '1995-06-20', '1995-06-21', '1995-06-22', '1995-06-23', '1995-06-26', '1995-06-27', '1995-06-28', '1995-06-29', '1995-06-30', '1995-07-03', '1995-07-04', '1995-07-05', '1995-07-06', '1995-07-07', '1995-07-10', '1995-07-11', '1995-07-12', '1995-07-13', '1995-07-14', '1995-07-17', '1995-07-18', '1995-07-19', '1995-07-20', '1995-07-21', '1995-07-24', '1995-07-25', '1995-07-26', '1995-07-27', '1995-07-28', '1995-07-31', '1995-08-01', '1995-08-02', '1995-08-03', '1995-08-04', '1995-08-07', '1995-08-08', '1995-08-09', '1995-08-10', '1995-08-11', '1995-08-14', '1995-08-15', '1995-08-16', '1995-08-17', '1995-08-18', '1995-08-21', '1995-08-22', '1995-08-23', '1995-08-24', '1995-08-25', '1995-08-28', '1995-08-29', '1995-08-30', '1995-08-31', '1995-09-01', '1995-09-04', '1995-09-05', '1995-09-06', '1995-09-07', '1995-09-08', '1995-09-11', '1995-09-12', '1995-09-13', '1995-09-14', '1995-09-15', '1995-09-18', '1995-09-19', '1995-09-20', '1995-09-21', '1995-09-22', '1995-09-25', '1995-09-26', '1995-09-27', '1995-09-28', '1995-09-29', '1995-10-04', '1995-10-05', '1995-10-06', '1995-10-09', '1995-10-10', '1995-10-11', '1995-10-12', '1995-10-13', '1995-10-16', '1995-10-17', '1995-10-18', '1995-10-19', '1995-10-20', '1995-10-23', '1995-10-24', '1995-10-25', '1995-10-26', '1995-10-27', '1995-10-30', '1995-10-31', '1995-11-01', '1995-11-02', '1995-11-03', '1995-11-06', '1995-11-07', '1995-11-08', '1995-11-09', '1995-11-10', '1995-11-13', '1995-11-14', '1995-11-15', '1995-11-16', '1995-11-17', '1995-11-20', '1995-11-21', '1995-11-22', '1995-11-23', '1995-11-24', '1995-11-27', '1995-11-28', '1995-11-29', '1995-11-30', '1995-12-01', '1995-12-04', '1995-12-05', '1995-12-06', '1995-12-07', '1995-12-08', '1995-12-11', '1995-12-12', '1995-12-13', '1995-12-14', '1995-12-15', '1995-12-18', '1995-12-19', '1995-12-20', '1995-12-21', '1995-12-22', '1995-12-25', '1995-12-26', '1995-12-27', '1995-12-28', '1995-12-29', '1996-01-02', '1996-01-03', '1996-01-04', '1996-01-05', '1996-01-08', '1996-01-09', '1996-01-10', '1996-01-11', '1996-01-12', '1996-01-15', '1996-01-16', '1996-01-17', '1996-01-18', '1996-01-19', '1996-01-22', '1996-01-23', '1996-01-24', '1996-01-25', '1996-01-26', '1996-01-29', '1996-01-30', '1996-01-31', '1996-02-01', '1996-02-02', '1996-02-05', '1996-02-06', '1996-02-07', '1996-02-08', '1996-02-09', '1996-02-12', '1996-02-13', '1996-02-14', '1996-02-15', '1996-02-16', '1996-03-04', '1996-03-05', '1996-03-06', '1996-03-07', '1996-03-08', '1996-03-11', '1996-03-12', '1996-03-13', '1996-03-14', '1996-03-15', '1996-03-18', '1996-03-19', '1996-03-20', '1996-03-21', '1996-03-22', '1996-03-25', '1996-03-26', '1996-03-27', '1996-03-28', '1996-03-29', '1996-04-01', '1996-04-02', '1996-04-03', '1996-04-04', '1996-04-05', '1996-04-08', '1996-04-09', '1996-04-10', '1996-04-11', '1996-04-12', '1996-04-15', '1996-04-16', '1996-04-17', '1996-04-18', '1996-04-19', '1996-04-22', '1996-04-23', '1996-04-24', '1996-04-25', '1996-04-26', '1996-04-29', '1996-04-30', '1996-05-02', '1996-05-03', '1996-05-06', '1996-05-07', '1996-05-08', '1996-05-09', '1996-05-10', '1996-05-13', '1996-05-14', '1996-05-15', '1996-05-16', '1996-05-17', '1996-05-20', '1996-05-21', '1996-05-22', '1996-05-23', '1996-05-24', '1996-05-27', '1996-05-28', '1996-05-29', '1996-05-30', '1996-05-31', '1996-06-03', '1996-06-04', '1996-06-05', '1996-06-06', '1996-06-07', '1996-06-10', '1996-06-11', '1996-06-12', '1996-06-13', '1996-06-14', '1996-06-17', '1996-06-18', '1996-06-19', '1996-06-20', '1996-06-21', '1996-06-24', '1996-06-25', '1996-06-26', '1996-06-27', '1996-06-28', '1996-07-01', '1996-07-02', '1996-07-03', '1996-07-04', '1996-07-05', '1996-07-08', '1996-07-09', '1996-07-10', '1996-07-11', '1996-07-12', '1996-07-15', '1996-07-16', '1996-07-17', '1996-07-18', '1996-07-19', '1996-07-22', '1996-07-23', '1996-07-24', '1996-07-25', '1996-07-26', '1996-07-29', '1996-07-30', '1996-07-31', '1996-08-01', '1996-08-02', '1996-08-05', '1996-08-06', '1996-08-07', '1996-08-08', '1996-08-09', '1996-08-12', '1996-08-13', '1996-08-14', '1996-08-15', '1996-08-16', '1996-08-19', '1996-08-20', '1996-08-21', '1996-08-22', '1996-08-23', '1996-08-26', '1996-08-27', '1996-08-28', '1996-08-29', '1996-08-30', '1996-09-02', '1996-09-03', '1996-09-04', '1996-09-05', '1996-09-06', '1996-09-09', '1996-09-10', '1996-09-11', '1996-09-12', '1996-09-13', '1996-09-16', '1996-09-17', '1996-09-18', '1996-09-19', '1996-09-20', '1996-09-23', '1996-09-24', '1996-09-25', '1996-09-26', '1996-09-27', '1996-10-03', '1996-10-04', '1996-10-07', '1996-10-08', '1996-10-09', '1996-10-10', '1996-10-11', '1996-10-14', '1996-10-15', '1996-10-16', '1996-10-17', '1996-10-18', '1996-10-21', '1996-10-22', '1996-10-23', '1996-10-24', '1996-10-25', '1996-10-28', '1996-10-29', '1996-10-30', '1996-10-31', '1996-11-01', '1996-11-04', '1996-11-05', '1996-11-06', '1996-11-07', '1996-11-08', '1996-11-11', '1996-11-12', '1996-11-13', '1996-11-14', '1996-11-15', '1996-11-18', '1996-11-19', '1996-11-20', '1996-11-21', '1996-11-22', '1996-11-25', '1996-11-26', '1996-11-27', '1996-11-28', '1996-11-29', '1996-12-02', '1996-12-03', '1996-12-04', '1996-12-05', '1996-12-06', '1996-12-09', '1996-12-10', '1996-12-11', '1996-12-12', '1996-12-13', '1996-12-16', '1996-12-17', '1996-12-18', '1996-12-19', '1996-12-20', '1996-12-23', '1996-12-24', '1996-12-25', '1996-12-26', '1996-12-27', '1996-12-30', '1996-12-31', '1997-01-02', '1997-01-03', '1997-01-06', '1997-01-07', '1997-01-08', '1997-01-09', '1997-01-10', '1997-01-13', '1997-01-14', '1997-01-15', '1997-01-16', '1997-01-17', '1997-01-20', '1997-01-21', '1997-01-22', '1997-01-23', '1997-01-24', '1997-01-27', '1997-01-28', '1997-01-29', '1997-01-30', '1997-01-31', '1997-02-17', '1997-02-18', '1997-02-19', '1997-02-20', '1997-02-21', '1997-02-24', '1997-02-25', '1997-02-26', '1997-02-27', '1997-02-28', '1997-03-03', '1997-03-04', '1997-03-05', '1997-03-06', '1997-03-07', '1997-03-10', '1997-03-11', '1997-03-12', '1997-03-13', '1997-03-14', '1997-03-17', '1997-03-18', '1997-03-19', '1997-03-20', '1997-03-21', '1997-03-24', '1997-03-25', '1997-03-26', '1997-03-27', '1997-03-28', '1997-03-31', '1997-04-01', '1997-04-02', '1997-04-03', '1997-04-04', '1997-04-07', '1997-04-08', '1997-04-09', '1997-04-10', '1997-04-11', '1997-04-14', '1997-04-15', '1997-04-16', '1997-04-17', '1997-04-18', '1997-04-21', '1997-04-22', '1997-04-23', '1997-04-24', '1997-04-25', '1997-04-28', '1997-04-29', '1997-04-30', '1997-05-05', '1997-05-06', '1997-05-07', '1997-05-08', '1997-05-09', '1997-05-12', '1997-05-13', '1997-05-14', '1997-05-15', '1997-05-16', '1997-05-19', '1997-05-20', '1997-05-21', '1997-05-22', '1997-05-23', '1997-05-26', '1997-05-27', '1997-05-28', '1997-05-29', '1997-05-30', '1997-06-02', '1997-06-03', '1997-06-04', '1997-06-05', '1997-06-06', '1997-06-09', '1997-06-10', '1997-06-11', '1997-06-12', '1997-06-13', '1997-06-16', '1997-06-17', '1997-06-18', '1997-06-19', '1997-06-20', '1997-06-23', '1997-06-24', '1997-06-25', '1997-06-26', '1997-06-27', '1997-07-02', '1997-07-03', '1997-07-04', '1997-07-07', '1997-07-08', '1997-07-09', '1997-07-10', '1997-07-11', '1997-07-14', '1997-07-15', '1997-07-16', '1997-07-17', '1997-07-18', '1997-07-21', '1997-07-22', '1997-07-23', '1997-07-24', '1997-07-25', '1997-07-28', '1997-07-29', '1997-07-30', '1997-07-31', '1997-08-01', '1997-08-04', '1997-08-05', '1997-08-06', '1997-08-07', '1997-08-08', '1997-08-11', '1997-08-12', '1997-08-13', '1997-08-14', '1997-08-15', '1997-08-18', '1997-08-19', '1997-08-20', '1997-08-21', '1997-08-22', '1997-08-25', '1997-08-26', '1997-08-27', '1997-08-28', '1997-08-29', '1997-09-01', '1997-09-02', '1997-09-03', '1997-09-04', '1997-09-05', '1997-09-08', '1997-09-09', '1997-09-10', '1997-09-11', '1997-09-12', '1997-09-15', '1997-09-16', '1997-09-17', '1997-09-18', '1997-09-19', '1997-09-22', '1997-09-23', '1997-09-24', '1997-09-25', '1997-09-26', '1997-09-29', '1997-09-30', '1997-10-06', '1997-10-07', '1997-10-08', '1997-10-09', '1997-10-10', '1997-10-13', '1997-10-14', '1997-10-15', '1997-10-16', '1997-10-17', '1997-10-20', '1997-10-21', '1997-10-22', '1997-10-23', '1997-10-24', '1997-10-27', '1997-10-28', '1997-10-29', '1997-10-30', '1997-10-31', '1997-11-03', '1997-11-04', '1997-11-05', '1997-11-06', '1997-11-07', '1997-11-10', '1997-11-11', '1997-11-12', '1997-11-13', '1997-11-14', '1997-11-17', '1997-11-18', '1997-11-19', '1997-11-20', '1997-11-21', '1997-11-24', '1997-11-25', '1997-11-26', '1997-11-27', '1997-11-28', '1997-12-01', '1997-12-02', '1997-12-03', '1997-12-04', '1997-12-05', '1997-12-08', '1997-12-09', '1997-12-10', '1997-12-11', '1997-12-12', '1997-12-15', '1997-12-16', '1997-12-17', '1997-12-18', '1997-12-19', '1997-12-22', '1997-12-23', '1997-12-24', '1997-12-25', '1997-12-26', '1997-12-29', '1997-12-30', '1997-12-31', '1998-01-05', '1998-01-06', '1998-01-07', '1998-01-08', '1998-01-09', '1998-01-12', '1998-01-13', '1998-01-14', '1998-01-15', '1998-01-16', '1998-01-19', '1998-01-20', '1998-01-21', '1998-01-22', '1998-01-23', '1998-02-09', '1998-02-10', '1998-02-11', '1998-02-12', '1998-02-13', '1998-02-16', '1998-02-17', '1998-02-18', '1998-02-19', '1998-02-20', '1998-02-23', '1998-02-24', '1998-02-25', '1998-02-26', '1998-02-27', '1998-03-02', '1998-03-03', '1998-03-04', '1998-03-05', '1998-03-06', '1998-03-09', '1998-03-10', '1998-03-11', '1998-03-12', '1998-03-13', '1998-03-16', '1998-03-17', '1998-03-18', '1998-03-19', '1998-03-20', '1998-03-23', '1998-03-24', '1998-03-25', '1998-03-26', '1998-03-27', '1998-03-30', '1998-03-31', '1998-04-01', '1998-04-02', '1998-04-03', '1998-04-06', '1998-04-07', '1998-04-08', '1998-04-09', '1998-04-10', '1998-04-13', '1998-04-14', '1998-04-15', '1998-04-16', '1998-04-17', '1998-04-20', '1998-04-21', '1998-04-22', '1998-04-23', '1998-04-24', '1998-04-27', '1998-04-28', '1998-04-29', '1998-04-30', '1998-05-04', '1998-05-05', '1998-05-06', '1998-05-07', '1998-05-08', '1998-05-11', '1998-05-12', '1998-05-13', '1998-05-14', '1998-05-15', '1998-05-18', '1998-05-19', '1998-05-20', '1998-05-21', '1998-05-22', '1998-05-25', '1998-05-26', '1998-05-27', '1998-05-28', '1998-05-29', '1998-06-01', '1998-06-02', '1998-06-03', '1998-06-04', '1998-06-05', '1998-06-08', '1998-06-09', '1998-06-10', '1998-06-11', '1998-06-12', '1998-06-15', '1998-06-16', '1998-06-17', '1998-06-18', '1998-06-19', '1998-06-22', '1998-06-23', '1998-06-24', '1998-06-25', '1998-06-26', '1998-06-29', '1998-06-30', '1998-07-01', '1998-07-02', '1998-07-03', '1998-07-06', '1998-07-07', '1998-07-08', '1998-07-09', '1998-07-10', '1998-07-13', '1998-07-14', '1998-07-15', '1998-07-16', '1998-07-17', '1998-07-20', '1998-07-21', '1998-07-22', '1998-07-23', '1998-07-24', '1998-07-27', '1998-07-28', '1998-07-29', '1998-07-30', '1998-07-31', '1998-08-03', '1998-08-04', '1998-08-05', '1998-08-06', '1998-08-07', '1998-08-10', '1998-08-11', '1998-08-12', '1998-08-13', '1998-08-14', '1998-08-17', '1998-08-18', '1998-08-19', '1998-08-20', '1998-08-21', '1998-08-24', '1998-08-25', '1998-08-26', '1998-08-27', '1998-08-28', '1998-08-31', '1998-09-01', '1998-09-02', '1998-09-03', '1998-09-04', '1998-09-07', '1998-09-08', '1998-09-09', '1998-09-10', '1998-09-11', '1998-09-14', '1998-09-15', '1998-09-16', '1998-09-17', '1998-09-18', '1998-09-21', '1998-09-22', '1998-09-23', '1998-09-24', '1998-09-25', '1998-09-28', '1998-09-29', '1998-09-30', '1998-10-05', '1998-10-06', '1998-10-07', '1998-10-08', '1998-10-09', '1998-10-12', '1998-10-13', '1998-10-14', '1998-10-15', '1998-10-16', '1998-10-19', '1998-10-20', '1998-10-21', '1998-10-22', '1998-10-23', '1998-10-26', '1998-10-27', '1998-10-28', '1998-10-29', '1998-10-30', '1998-11-02', '1998-11-03', '1998-11-04', '1998-11-05', '1998-11-06', '1998-11-09', '1998-11-10', '1998-11-11', '1998-11-12', '1998-11-13', '1998-11-16', '1998-11-17', '1998-11-18', '1998-11-19', '1998-11-20', '1998-11-23', '1998-11-24', '1998-11-25', '1998-11-26', '1998-11-27', '1998-11-30', '1998-12-01', '1998-12-02', '1998-12-03', '1998-12-04', '1998-12-07', '1998-12-08', '1998-12-09', '1998-12-10', '1998-12-11', '1998-12-14', '1998-12-15', '1998-12-16', '1998-12-17', '1998-12-18', '1998-12-21', '1998-12-22', '1998-12-23', '1998-12-24', '1998-12-25', '1998-12-28', '1998-12-29', '1998-12-30', '1998-12-31', '1999-01-04', '1999-01-05', '1999-01-06', '1999-01-07', '1999-01-08', '1999-01-11', '1999-01-12', '1999-01-13', '1999-01-14', '1999-01-15', '1999-01-18', '1999-01-19', '1999-01-20', '1999-01-21', '1999-01-22', '1999-01-25', '1999-01-26', '1999-01-27', '1999-01-28', '1999-01-29', '1999-02-01', '1999-02-02', '1999-02-03', '1999-02-04', '1999-02-05', '1999-02-08', '1999-02-09', '1999-03-01', '1999-03-02', '1999-03-03', '1999-03-04', '1999-03-05', '1999-03-08', '1999-03-09', '1999-03-10', '1999-03-11', '1999-03-12', '1999-03-15', '1999-03-16', '1999-03-17', '1999-03-18', '1999-03-19', '1999-03-22', '1999-03-23', '1999-03-24', '1999-03-25', '1999-03-26', '1999-03-29', '1999-03-30', '1999-03-31', '1999-04-01', '1999-04-02', '1999-04-05', '1999-04-06', '1999-04-07', '1999-04-08', '1999-04-09', '1999-04-12', '1999-04-13', '1999-04-14', '1999-04-15', '1999-04-16', '1999-04-19', '1999-04-20', '1999-04-21', '1999-04-22', '1999-04-23', '1999-04-26', '1999-04-27', '1999-04-28', '1999-04-29', '1999-04-30', '1999-05-04', '1999-05-05', '1999-05-06', '1999-05-07', '1999-05-10', '1999-05-11', '1999-05-12', '1999-05-13', '1999-05-14', '1999-05-17', '1999-05-18', '1999-05-19', '1999-05-20', '1999-05-21', '1999-05-24', '1999-05-25', '1999-05-26', '1999-05-27', '1999-05-28', '1999-05-31', '1999-06-01', '1999-06-02', '1999-06-03', '1999-06-04', '1999-06-07', '1999-06-08', '1999-06-09', '1999-06-10', '1999-06-11', '1999-06-14', '1999-06-15', '1999-06-16', '1999-06-17', '1999-06-18', '1999-06-21', '1999-06-22', '1999-06-23', '1999-06-24', '1999-06-25', '1999-06-28', '1999-06-29', '1999-06-30', '1999-07-01', '1999-07-02', '1999-07-05', '1999-07-06', '1999-07-07', '1999-07-08', '1999-07-09', '1999-07-12', '1999-07-13', '1999-07-14', '1999-07-15', '1999-07-16', '1999-07-19', '1999-07-20', '1999-07-21', '1999-07-22', '1999-07-23', '1999-07-26', '1999-07-27', '1999-07-28', '1999-07-29', '1999-07-30', '1999-08-02', '1999-08-03', '1999-08-04', '1999-08-05', '1999-08-06', '1999-08-09', '1999-08-10', '1999-08-11', '1999-08-12', '1999-08-13', '1999-08-16', '1999-08-17', '1999-08-18', '1999-08-19', '1999-08-20', '1999-08-23', '1999-08-24', '1999-08-25', '1999-08-26', '1999-08-27', '1999-08-30', '1999-08-31', '1999-09-01', '1999-09-02', '1999-09-03', '1999-09-06', '1999-09-07', '1999-09-08', '1999-09-09', '1999-09-10', '1999-09-13', '1999-09-14', '1999-09-15', '1999-09-16', '1999-09-17', '1999-09-20', '1999-09-21', '1999-09-22', '1999-09-23', '1999-09-24', '1999-09-27', '1999-09-28', '1999-09-29', '1999-09-30', '1999-10-08', '1999-10-11', '1999-10-12', '1999-10-13', '1999-10-14', '1999-10-15', '1999-10-18', '1999-10-19', '1999-10-20', '1999-10-21', '1999-10-22', '1999-10-25', '1999-10-26', '1999-10-27', '1999-10-28', '1999-10-29', '1999-11-01', '1999-11-02', '1999-11-03', '1999-11-04', '1999-11-05', '1999-11-08', '1999-11-09', '1999-11-10', '1999-11-11', '1999-11-12', '1999-11-15', '1999-11-16', '1999-11-17', '1999-11-18', '1999-11-19', '1999-11-22', '1999-11-23', '1999-11-24', '1999-11-25', '1999-11-26', '1999-11-29', '1999-11-30', '1999-12-01', '1999-12-02', '1999-12-03', '1999-12-06', '1999-12-07', '1999-12-08', '1999-12-09', '1999-12-10', '1999-12-13', '1999-12-14', '1999-12-15', '1999-12-16', '1999-12-17', '1999-12-21', '1999-12-22', '1999-12-23', '1999-12-24', '1999-12-27', '1999-12-28', '1999-12-29', '1999-12-30', '2000-01-04', '2000-01-05', '2000-01-06', '2000-01-07', '2000-01-10', '2000-01-11', '2000-01-12', '2000-01-13', '2000-01-14', '2000-01-17', '2000-01-18', '2000-01-19', '2000-01-20', '2000-01-21', '2000-01-24', '2000-01-25', '2000-01-26', '2000-01-27', '2000-01-28', '2000-02-14', '2000-02-15', '2000-02-16', '2000-02-17', '2000-02-18', '2000-02-21', '2000-02-22', '2000-02-23', '2000-02-24', '2000-02-25', '2000-02-28', '2000-02-29', '2000-03-01', '2000-03-02', '2000-03-03', '2000-03-06', '2000-03-07', '2000-03-08', '2000-03-09', '2000-03-10', '2000-03-13', '2000-03-14', '2000-03-15', '2000-03-16', '2000-03-17', '2000-03-20', '2000-03-21', '2000-03-22', '2000-03-23', '2000-03-24', '2000-03-27', '2000-03-28', '2000-03-29', '2000-03-30', '2000-03-31', '2000-04-03', '2000-04-04', '2000-04-05', '2000-04-06', '2000-04-07', '2000-04-10', '2000-04-11', '2000-04-12', '2000-04-13', '2000-04-14', '2000-04-17', '2000-04-18', '2000-04-19', '2000-04-20', '2000-04-21', '2000-04-24', '2000-04-25', '2000-04-26', '2000-04-27', '2000-04-28', '2000-05-08', '2000-05-09', '2000-05-10', '2000-05-11', '2000-05-12', '2000-05-15', '2000-05-16', '2000-05-17', '2000-05-18', '2000-05-19', '2000-05-22', '2000-05-23', '2000-05-24', '2000-05-25', '2000-05-26', '2000-05-29', '2000-05-30', '2000-05-31', '2000-06-01', '2000-06-02', '2000-06-05', '2000-06-06', '2000-06-07', '2000-06-08', '2000-06-09', '2000-06-12', '2000-06-13', '2000-06-14', '2000-06-15', '2000-06-16', '2000-06-19', '2000-06-20', '2000-06-21', '2000-06-22', '2000-06-23', '2000-06-26', '2000-06-27', '2000-06-28', '2000-06-29', '2000-06-30', '2000-07-03', '2000-07-04', '2000-07-05', '2000-07-06', '2000-07-07', '2000-07-10', '2000-07-11', '2000-07-12', '2000-07-13', '2000-07-14', '2000-07-17', '2000-07-18', '2000-07-19', '2000-07-20', '2000-07-21', '2000-07-24', '2000-07-25', '2000-07-26', '2000-07-27', '2000-07-28', '2000-07-31', '2000-08-01', '2000-08-02', '2000-08-03', '2000-08-04', '2000-08-07', '2000-08-08', '2000-08-09', '2000-08-10', '2000-08-11', '2000-08-14', '2000-08-15', '2000-08-16', '2000-08-17', '2000-08-18', '2000-08-21', '2000-08-22', '2000-08-23', '2000-08-24', '2000-08-25', '2000-08-28', '2000-08-29', '2000-08-30', '2000-08-31', '2000-09-01', '2000-09-04', '2000-09-05', '2000-09-06', '2000-09-07', '2000-09-08', '2000-09-11', '2000-09-12', '2000-09-13', '2000-09-14', '2000-09-15', '2000-09-18', '2000-09-19', '2000-09-20', '2000-09-21', '2000-09-22', '2000-09-25', '2000-09-26', '2000-09-27', '2000-09-28', '2000-09-29', '2000-10-09', '2000-10-10', '2000-10-11', '2000-10-12', '2000-10-13', '2000-10-16', '2000-10-17', '2000-10-18', '2000-10-19', '2000-10-20', '2000-10-23', '2000-10-24', '2000-10-25', '2000-10-26', '2000-10-27', '2000-10-30', '2000-10-31', '2000-11-01', '2000-11-02', '2000-11-03', '2000-11-06', '2000-11-07', '2000-11-08', '2000-11-09', '2000-11-10', '2000-11-13', '2000-11-14', '2000-11-15', '2000-11-16', '2000-11-17', '2000-11-20', '2000-11-21', '2000-11-22', '2000-11-23', '2000-11-24', '2000-11-27', '2000-11-28', '2000-11-29', '2000-11-30', '2000-12-01', '2000-12-04', '2000-12-05', '2000-12-06', '2000-12-07', '2000-12-08', '2000-12-11', '2000-12-12', '2000-12-13', '2000-12-14', '2000-12-15', '2000-12-18', '2000-12-19', '2000-12-20', '2000-12-21', '2000-12-22', '2000-12-25', '2000-12-26', '2000-12-27', '2000-12-28', '2000-12-29', '2001-01-02', '2001-01-03', '2001-01-04', '2001-01-05', '2001-01-08', '2001-01-09', '2001-01-10', '2001-01-11', '2001-01-12', '2001-01-15', '2001-01-16', '2001-01-17', '2001-01-18', '2001-01-19', '2001-02-05', '2001-02-06', '2001-02-07', '2001-02-08', '2001-02-09', '2001-02-12', '2001-02-13', '2001-02-14', '2001-02-15', '2001-02-16', '2001-02-19', '2001-02-20', '2001-02-21', '2001-02-22', '2001-02-23', '2001-02-26', '2001-02-27', '2001-02-28', '2001-03-01', '2001-03-02', '2001-03-05', '2001-03-06', '2001-03-07', '2001-03-08', '2001-03-09', '2001-03-12', '2001-03-13', '2001-03-14', '2001-03-15', '2001-03-16', '2001-03-19', '2001-03-20', '2001-03-21', '2001-03-22', '2001-03-23', '2001-03-26', '2001-03-27', '2001-03-28', '2001-03-29', '2001-03-30', '2001-04-02', '2001-04-03', '2001-04-04', '2001-04-05', '2001-04-06', '2001-04-09', '2001-04-10', '2001-04-11', '2001-04-12', '2001-04-13', '2001-04-16', '2001-04-17', '2001-04-18', '2001-04-19', '2001-04-20', '2001-04-23', '2001-04-24', '2001-04-25', '2001-04-26', '2001-04-27', '2001-04-30', '2001-05-08', '2001-05-09', '2001-05-10', '2001-05-11', '2001-05-14', '2001-05-15', '2001-05-16', '2001-05-17', '2001-05-18', '2001-05-21', '2001-05-22', '2001-05-23', '2001-05-24', '2001-05-25', '2001-05-28', '2001-05-29', '2001-05-30', '2001-05-31', '2001-06-01', '2001-06-04', '2001-06-05', '2001-06-06', '2001-06-07', '2001-06-08', '2001-06-11', '2001-06-12', '2001-06-13', '2001-06-14', '2001-06-15', '2001-06-18', '2001-06-19', '2001-06-20', '2001-06-21', '2001-06-22', '2001-06-25', '2001-06-26', '2001-06-27', '2001-06-28', '2001-06-29', '2001-07-02', '2001-07-03', '2001-07-04', '2001-07-05', '2001-07-06', '2001-07-09', '2001-07-10', '2001-07-11', '2001-07-12', '2001-07-13', '2001-07-16', '2001-07-17', '2001-07-18', '2001-07-19', '2001-07-20', '2001-07-23', '2001-07-24', '2001-07-25', '2001-07-26', '2001-07-27', '2001-07-30', '2001-07-31', '2001-08-01', '2001-08-02', '2001-08-03', '2001-08-06', '2001-08-07', '2001-08-08', '2001-08-09', '2001-08-10', '2001-08-13', '2001-08-14', '2001-08-15', '2001-08-16', '2001-08-17', '2001-08-20', '2001-08-21', '2001-08-22', '2001-08-23', '2001-08-24', '2001-08-27', '2001-08-28', '2001-08-29', '2001-08-30', '2001-08-31', '2001-09-03', '2001-09-04', '2001-09-05', '2001-09-06', '2001-09-07', '2001-09-10', '2001-09-11', '2001-09-12', '2001-09-13', '2001-09-14', '2001-09-17', '2001-09-18', '2001-09-19', '2001-09-20', '2001-09-21', '2001-09-24', '2001-09-25', '2001-09-26', '2001-09-27', '2001-09-28', '2001-10-08', '2001-10-09', '2001-10-10', '2001-10-11', '2001-10-12', '2001-10-15', '2001-10-16', '2001-10-17', '2001-10-18', '2001-10-19', '2001-10-22', '2001-10-23', '2001-10-24', '2001-10-25', '2001-10-26', '2001-10-29', '2001-10-30', '2001-10-31', '2001-11-01', '2001-11-02', '2001-11-05', '2001-11-06', '2001-11-07', '2001-11-08', '2001-11-09', '2001-11-12', '2001-11-13', '2001-11-14', '2001-11-15', '2001-11-16', '2001-11-19', '2001-11-20', '2001-11-21', '2001-11-22', '2001-11-23', '2001-11-26', '2001-11-27', '2001-11-28', '2001-11-29', '2001-11-30', '2001-12-03', '2001-12-04', '2001-12-05', '2001-12-06', '2001-12-07', '2001-12-10', '2001-12-11', '2001-12-12', '2001-12-13', '2001-12-14', '2001-12-17', '2001-12-18', '2001-12-19', '2001-12-20', '2001-12-21', '2001-12-24', '2001-12-25', '2001-12-26', '2001-12-27', '2001-12-28', '2001-12-31', '2002-01-04', '2002-01-07', '2002-01-08', '2002-01-09', '2002-01-10', '2002-01-11', '2002-01-14', '2002-01-15', '2002-01-16', '2002-01-17', '2002-01-18', '2002-01-21', '2002-01-22', '2002-01-23', '2002-01-24', '2002-01-25', '2002-01-28', '2002-01-29', '2002-01-30', '2002-01-31', '2002-02-01', '2002-02-04', '2002-02-05', '2002-02-06', '2002-02-07', '2002-02-08', '2002-02-25', '2002-02-26', '2002-02-27', '2002-02-28', '2002-03-01', '2002-03-04', '2002-03-05', '2002-03-06', '2002-03-07', '2002-03-08', '2002-03-11', '2002-03-12', '2002-03-13', '2002-03-14', '2002-03-15', '2002-03-18', '2002-03-19', '2002-03-20', '2002-03-21', '2002-03-22', '2002-03-25', '2002-03-26', '2002-03-27', '2002-03-28', '2002-03-29', '2002-04-01', '2002-04-02', '2002-04-03', '2002-04-04', '2002-04-05', '2002-04-08', '2002-04-09', '2002-04-10', '2002-04-11', '2002-04-12', '2002-04-15', '2002-04-16', '2002-04-17', '2002-04-18', '2002-04-19', '2002-04-22', '2002-04-23', '2002-04-24', '2002-04-25', '2002-04-26', '2002-04-29', '2002-04-30', '2002-05-08', '2002-05-09', '2002-05-10', '2002-05-13', '2002-05-14', '2002-05-15', '2002-05-16', '2002-05-17', '2002-05-20', '2002-05-21', '2002-05-22', '2002-05-23', '2002-05-24', '2002-05-27', '2002-05-28', '2002-05-29', '2002-05-30', '2002-05-31', '2002-06-03', '2002-06-04', '2002-06-05', '2002-06-06', '2002-06-07', '2002-06-10', '2002-06-11', '2002-06-12', '2002-06-13', '2002-06-14', '2002-06-17', '2002-06-18', '2002-06-19', '2002-06-20', '2002-06-21', '2002-06-24', '2002-06-25', '2002-06-26', '2002-06-27', '2002-06-28', '2002-07-01', '2002-07-02', '2002-07-03', '2002-07-04', '2002-07-05', '2002-07-08', '2002-07-09', '2002-07-10', '2002-07-11', '2002-07-12', '2002-07-15', '2002-07-16', '2002-07-17', '2002-07-18', '2002-07-19', '2002-07-22', '2002-07-23', '2002-07-24', '2002-07-25', '2002-07-26', '2002-07-29', '2002-07-30', '2002-07-31', '2002-08-01', '2002-08-02', '2002-08-05', '2002-08-06', '2002-08-07', '2002-08-08', '2002-08-09', '2002-08-12', '2002-08-13', '2002-08-14', '2002-08-15', '2002-08-16', '2002-08-19', '2002-08-20', '2002-08-21', '2002-08-22', '2002-08-23', '2002-08-26', '2002-08-27', '2002-08-28', '2002-08-29', '2002-08-30', '2002-09-02', '2002-09-03', '2002-09-04', '2002-09-05', '2002-09-06', '2002-09-09', '2002-09-10', '2002-09-11', '2002-09-12', '2002-09-13', '2002-09-16', '2002-09-17', '2002-09-18', '2002-09-19', '2002-09-20', '2002-09-23', '2002-09-24', '2002-09-25', '2002-09-26', '2002-09-27', '2002-10-08', '2002-10-09', '2002-10-10', '2002-10-11', '2002-10-14', '2002-10-15', '2002-10-16', '2002-10-17', '2002-10-18', '2002-10-21', '2002-10-22', '2002-10-23', '2002-10-24', '2002-10-25', '2002-10-28', '2002-10-29', '2002-10-30', '2002-10-31', '2002-11-01', '2002-11-04', '2002-11-05', '2002-11-06', '2002-11-07', '2002-11-08', '2002-11-11', '2002-11-12', '2002-11-13', '2002-11-14', '2002-11-15', '2002-11-18', '2002-11-19', '2002-11-20', '2002-11-21', '2002-11-22', '2002-11-25', '2002-11-26', '2002-11-27', '2002-11-28', '2002-11-29', '2002-12-02', '2002-12-03', '2002-12-04', '2002-12-05', '2002-12-06', '2002-12-09', '2002-12-10', '2002-12-11', '2002-12-12', '2002-12-13', '2002-12-16', '2002-12-17', '2002-12-18', '2002-12-19', '2002-12-20', '2002-12-23', '2002-12-24', '2002-12-25', '2002-12-26', '2002-12-27', '2002-12-30', '2002-12-31', '2003-01-02', '2003-01-03', '2003-01-06', '2003-01-07', '2003-01-08', '2003-01-09', '2003-01-10', '2003-01-13', '2003-01-14', '2003-01-15', '2003-01-16', '2003-01-17', '2003-01-20', '2003-01-21', '2003-01-22', '2003-01-23', '2003-01-24', '2003-01-27', '2003-01-28', '2003-01-29', '2003-02-10', '2003-02-11', '2003-02-12', '2003-02-13', '2003-02-14', '2003-02-17', '2003-02-18', '2003-02-19', '2003-02-20', '2003-02-21', '2003-02-24', '2003-02-25', '2003-02-26', '2003-02-27', '2003-02-28', '2003-03-03', '2003-03-04', '2003-03-05', '2003-03-06', '2003-03-07', '2003-03-10', '2003-03-11', '2003-03-12', '2003-03-13', '2003-03-14', '2003-03-17', '2003-03-18', '2003-03-19', '2003-03-20', '2003-03-21', '2003-03-24', '2003-03-25', '2003-03-26', '2003-03-27', '2003-03-28', '2003-03-31', '2003-04-01', '2003-04-02', '2003-04-03', '2003-04-04', '2003-04-07', '2003-04-08', '2003-04-09', '2003-04-10', '2003-04-11', '2003-04-14', '2003-04-15', '2003-04-16', '2003-04-17', '2003-04-18', '2003-04-21', '2003-04-22', '2003-04-23', '2003-04-24', '2003-04-25', '2003-04-28', '2003-04-29', '2003-04-30', '2003-05-12', '2003-05-13', '2003-05-14', '2003-05-15', '2003-05-16', '2003-05-19', '2003-05-20', '2003-05-21', '2003-05-22', '2003-05-23', '2003-05-26', '2003-05-27', '2003-05-28', '2003-05-29', '2003-05-30', '2003-06-02', '2003-06-03', '2003-06-04', '2003-06-05', '2003-06-06', '2003-06-09', '2003-06-10', '2003-06-11', '2003-06-12', '2003-06-13', '2003-06-16', '2003-06-17', '2003-06-18', '2003-06-19', '2003-06-20', '2003-06-23', '2003-06-24', '2003-06-25', '2003-06-26', '2003-06-27', '2003-06-30', '2003-07-01', '2003-07-02', '2003-07-03', '2003-07-04', '2003-07-07', '2003-07-08', '2003-07-09', '2003-07-10', '2003-07-11', '2003-07-14', '2003-07-15', '2003-07-16', '2003-07-17', '2003-07-18', '2003-07-21', '2003-07-22', '2003-07-23', '2003-07-24', '2003-07-25', '2003-07-28', '2003-07-29', '2003-07-30', '2003-07-31', '2003-08-01', '2003-08-04', '2003-08-05', '2003-08-06', '2003-08-07', '2003-08-08', '2003-08-11', '2003-08-12', '2003-08-13', '2003-08-14', '2003-08-15', '2003-08-18', '2003-08-19', '2003-08-20', '2003-08-21', '2003-08-22', '2003-08-25', '2003-08-26', '2003-08-27', '2003-08-28', '2003-08-29', '2003-09-01', '2003-09-02', '2003-09-03', '2003-09-04', '2003-09-05', '2003-09-08', '2003-09-09', '2003-09-10', '2003-09-11', '2003-09-12', '2003-09-15', '2003-09-16', '2003-09-17', '2003-09-18', '2003-09-19', '2003-09-22', '2003-09-23', '2003-09-24', '2003-09-25', '2003-09-26', '2003-09-29', '2003-09-30', '2003-10-08', '2003-10-09', '2003-10-10', '2003-10-13', '2003-10-14', '2003-10-15', '2003-10-16', '2003-10-17', '2003-10-20', '2003-10-21', '2003-10-22', '2003-10-23', '2003-10-24', '2003-10-27', '2003-10-28', '2003-10-29', '2003-10-30', '2003-10-31', '2003-11-03', '2003-11-04', '2003-11-05', '2003-11-06', '2003-11-07', '2003-11-10', '2003-11-11', '2003-11-12', '2003-11-13', '2003-11-14', '2003-11-17', '2003-11-18', '2003-11-19', '2003-11-20', '2003-11-21', '2003-11-24', '2003-11-25', '2003-11-26', '2003-11-27', '2003-11-28', '2003-12-01', '2003-12-02', '2003-12-03', '2003-12-04', '2003-12-05', '2003-12-08', '2003-12-09', '2003-12-10', '2003-12-11', '2003-12-12', '2003-12-15', '2003-12-16', '2003-12-17', '2003-12-18', '2003-12-19', '2003-12-22', '2003-12-23', '2003-12-24', '2003-12-25', '2003-12-26', '2003-12-29', '2003-12-30', '2003-12-31', '2004-01-02', '2004-01-05', '2004-01-06', '2004-01-07', '2004-01-08', '2004-01-09', '2004-01-12', '2004-01-13', '2004-01-14', '2004-01-15', '2004-01-16', '2004-01-29', '2004-01-30', '2004-02-02', '2004-02-03', '2004-02-04', '2004-02-05', '2004-02-06', '2004-02-09', '2004-02-10', '2004-02-11', '2004-02-12', '2004-02-13', '2004-02-16', '2004-02-17', '2004-02-18', '2004-02-19', '2004-02-20', '2004-02-23', '2004-02-24', '2004-02-25', '2004-02-26', '2004-02-27', '2004-03-01', '2004-03-02', '2004-03-03', '2004-03-04', '2004-03-05', '2004-03-08', '2004-03-09', '2004-03-10', '2004-03-11', '2004-03-12', '2004-03-15', '2004-03-16', '2004-03-17', '2004-03-18', '2004-03-19', '2004-03-22', '2004-03-23', '2004-03-24', '2004-03-25', '2004-03-26', '2004-03-29', '2004-03-30', '2004-03-31', '2004-04-01', '2004-04-02', '2004-04-05', '2004-04-06', '2004-04-07', '2004-04-08', '2004-04-09', '2004-04-12', '2004-04-13', '2004-04-14', '2004-04-15', '2004-04-16', '2004-04-19', '2004-04-20', '2004-04-21', '2004-04-22', '2004-04-23', '2004-04-26', '2004-04-27', '2004-04-28', '2004-04-29', '2004-04-30', '2004-05-10', '2004-05-11', '2004-05-12', '2004-05-13', '2004-05-14', '2004-05-17', '2004-05-18', '2004-05-19', '2004-05-20', '2004-05-21', '2004-05-24', '2004-05-25', '2004-05-26', '2004-05-27', '2004-05-28', '2004-05-31', '2004-06-01', '2004-06-02', '2004-06-03', '2004-06-04', '2004-06-07', '2004-06-08', '2004-06-09', '2004-06-10', '2004-06-11', '2004-06-14', '2004-06-15', '2004-06-16', '2004-06-17', '2004-06-18', '2004-06-21', '2004-06-22', '2004-06-23', '2004-06-24', '2004-06-25', '2004-06-28', '2004-06-29', '2004-06-30', '2004-07-01', '2004-07-02', '2004-07-05', '2004-07-06', '2004-07-07', '2004-07-08', '2004-07-09', '2004-07-12', '2004-07-13', '2004-07-14', '2004-07-15', '2004-07-16', '2004-07-19', '2004-07-20', '2004-07-21', '2004-07-22', '2004-07-23', '2004-07-26', '2004-07-27', '2004-07-28', '2004-07-29', '2004-07-30', '2004-08-02', '2004-08-03', '2004-08-04', '2004-08-05', '2004-08-06', '2004-08-09', '2004-08-10', '2004-08-11', '2004-08-12', '2004-08-13', '2004-08-16', '2004-08-17', '2004-08-18', '2004-08-19', '2004-08-20', '2004-08-23', '2004-08-24', '2004-08-25', '2004-08-26', '2004-08-27', '2004-08-30', '2004-08-31', '2004-09-01', '2004-09-02', '2004-09-03', '2004-09-06', '2004-09-07', '2004-09-08', '2004-09-09', '2004-09-10', '2004-09-13', '2004-09-14', '2004-09-15', '2004-09-16', '2004-09-17', '2004-09-20', '2004-09-21', '2004-09-22', '2004-09-23', '2004-09-24', '2004-09-27', '2004-09-28', '2004-09-29', '2004-09-30', '2004-10-08', '2004-10-11', '2004-10-12', '2004-10-13', '2004-10-14', '2004-10-15', '2004-10-18', '2004-10-19', '2004-10-20', '2004-10-21', '2004-10-22', '2004-10-25', '2004-10-26', '2004-10-27', '2004-10-28', '2004-10-29', '2004-11-01', '2004-11-02', '2004-11-03', '2004-11-04', '2004-11-05', '2004-11-08', '2004-11-09', '2004-11-10', '2004-11-11', '2004-11-12', '2004-11-15', '2004-11-16', '2004-11-17', '2004-11-18', '2004-11-19', '2004-11-22', '2004-11-23', '2004-11-24', '2004-11-25', '2004-11-26', '2004-11-29', '2004-11-30', '2004-12-01', '2004-12-02', '2004-12-03', '2004-12-06', '2004-12-07', '2004-12-08', '2004-12-09', '2004-12-10', '2004-12-13', '2004-12-14', '2004-12-15', '2004-12-16', '2004-12-17', '2004-12-20', '2004-12-21', '2004-12-22', '2004-12-23', '2004-12-24', '2004-12-27', '2004-12-28', '2004-12-29', '2004-12-30', '2004-12-31', '2005-01-04', '2005-01-05', '2005-01-06', '2005-01-07', '2005-01-10', '2005-01-11', '2005-01-12', '2005-01-13', '2005-01-14', '2005-01-17', '2005-01-18', '2005-01-19', '2005-01-20', '2005-01-21', '2005-01-24', '2005-01-25', '2005-01-26', '2005-01-27', '2005-01-28', '2005-01-31', '2005-02-01', '2005-02-02', '2005-02-03', '2005-02-04', '2005-02-16', '2005-02-17', '2005-02-18', '2005-02-21', '2005-02-22', '2005-02-23', '2005-02-24', '2005-02-25', '2005-02-28', '2005-03-01', '2005-03-02', '2005-03-03', '2005-03-04', '2005-03-07', '2005-03-08', '2005-03-09', '2005-03-10', '2005-03-11', '2005-03-14', '2005-03-15', '2005-03-16', '2005-03-17', '2005-03-18', '2005-03-21', '2005-03-22', '2005-03-23', '2005-03-24', '2005-03-25', '2005-03-28', '2005-03-29', '2005-03-30', '2005-03-31', '2005-04-01', '2005-04-04', '2005-04-05', '2005-04-06', '2005-04-07', '2005-04-08', '2005-04-11', '2005-04-12', '2005-04-13', '2005-04-14', '2005-04-15', '2005-04-18', '2005-04-19', '2005-04-20', '2005-04-21', '2005-04-22', '2005-04-25', '2005-04-26', '2005-04-27', '2005-04-28', '2005-04-29', '2005-05-09', '2005-05-10', '2005-05-11', '2005-05-12', '2005-05-13', '2005-05-16', '2005-05-17', '2005-05-18', '2005-05-19', '2005-05-20', '2005-05-23', '2005-05-24', '2005-05-25', '2005-05-26', '2005-05-27', '2005-05-30', '2005-05-31', '2005-06-01', '2005-06-02', '2005-06-03', '2005-06-06', '2005-06-07', '2005-06-08', '2005-06-09', '2005-06-10', '2005-06-13', '2005-06-14', '2005-06-15', '2005-06-16', '2005-06-17', '2005-06-20', '2005-06-21', '2005-06-22', '2005-06-23', '2005-06-24', '2005-06-27', '2005-06-28', '2005-06-29', '2005-06-30', '2005-07-01', '2005-07-04', '2005-07-05', '2005-07-06', '2005-07-07', '2005-07-08', '2005-07-11', '2005-07-12', '2005-07-13', '2005-07-14', '2005-07-15', '2005-07-18', '2005-07-19', '2005-07-20', '2005-07-21', '2005-07-22', '2005-07-25', '2005-07-26', '2005-07-27', '2005-07-28', '2005-07-29', '2005-08-01', '2005-08-02', '2005-08-03', '2005-08-04', '2005-08-05', '2005-08-08', '2005-08-09', '2005-08-10', '2005-08-11', '2005-08-12', '2005-08-15', '2005-08-16', '2005-08-17', '2005-08-18', '2005-08-19', '2005-08-22', '2005-08-23', '2005-08-24', '2005-08-25', '2005-08-26', '2005-08-29', '2005-08-30', '2005-08-31', '2005-09-01', '2005-09-02', '2005-09-05', '2005-09-06', '2005-09-07', '2005-09-08', '2005-09-09', '2005-09-12', '2005-09-13', '2005-09-14', '2005-09-15', '2005-09-16', '2005-09-19', '2005-09-20', '2005-09-21', '2005-09-22', '2005-09-23', '2005-09-26', '2005-09-27', '2005-09-28', '2005-09-29', '2005-09-30', '2005-10-10', '2005-10-11', '2005-10-12', '2005-10-13', '2005-10-14', '2005-10-17', '2005-10-18', '2005-10-19', '2005-10-20', '2005-10-21', '2005-10-24', '2005-10-25', '2005-10-26', '2005-10-27', '2005-10-28', '2005-10-31', '2005-11-01', '2005-11-02', '2005-11-03', '2005-11-04', '2005-11-07', '2005-11-08', '2005-11-09', '2005-11-10', '2005-11-11', '2005-11-14', '2005-11-15', '2005-11-16', '2005-11-17', '2005-11-18', '2005-11-21', '2005-11-22', '2005-11-23', '2005-11-24', '2005-11-25', '2005-11-28', '2005-11-29', '2005-11-30', '2005-12-01', '2005-12-02', '2005-12-05', '2005-12-06', '2005-12-07', '2005-12-08', '2005-12-09', '2005-12-12', '2005-12-13', '2005-12-14', '2005-12-15', '2005-12-16', '2005-12-19', '2005-12-20', '2005-12-21', '2005-12-22', '2005-12-23', '2005-12-26', '2005-12-27', '2005-12-28', '2005-12-29', '2005-12-30', '2006-01-04', '2006-01-05', '2006-01-06', '2006-01-09', '2006-01-10', '2006-01-11', '2006-01-12', '2006-01-13', '2006-01-16', '2006-01-17', '2006-01-18', '2006-01-19', '2006-01-20', '2006-01-23', '2006-01-24', '2006-01-25', '2006-02-06', '2006-02-07', '2006-02-08', '2006-02-09', '2006-02-10', '2006-02-13', '2006-02-14', '2006-02-15', '2006-02-16', '2006-02-17', '2006-02-20', '2006-02-21', '2006-02-22', '2006-02-23', '2006-02-24', '2006-02-27', '2006-02-28', '2006-03-01', '2006-03-02', '2006-03-03', '2006-03-06', '2006-03-07', '2006-03-08', '2006-03-09', '2006-03-10', '2006-03-13', '2006-03-14', '2006-03-15', '2006-03-16', '2006-03-17', '2006-03-20', '2006-03-21', '2006-03-22', '2006-03-23', '2006-03-24', '2006-03-27', '2006-03-28', '2006-03-29', '2006-03-30', '2006-03-31', '2006-04-03', '2006-04-04', '2006-04-05', '2006-04-06', '2006-04-07', '2006-04-10', '2006-04-11', '2006-04-12', '2006-04-13', '2006-04-14', '2006-04-17', '2006-04-18', '2006-04-19', '2006-04-20', '2006-04-21', '2006-04-24', '2006-04-25', '2006-04-26', '2006-04-27', '2006-04-28', '2006-05-08', '2006-05-09', '2006-05-10', '2006-05-11', '2006-05-12', '2006-05-15', '2006-05-16', '2006-05-17', '2006-05-18', '2006-05-19', '2006-05-22', '2006-05-23', '2006-05-24', '2006-05-25', '2006-05-26', '2006-05-29', '2006-05-30', '2006-05-31', '2006-06-01', '2006-06-02', '2006-06-05', '2006-06-06', '2006-06-07', '2006-06-08', '2006-06-09', '2006-06-12', '2006-06-13', '2006-06-14', '2006-06-15', '2006-06-16', '2006-06-19', '2006-06-20', '2006-06-21', '2006-06-22', '2006-06-23', '2006-06-26', '2006-06-27', '2006-06-28', '2006-06-29', '2006-06-30', '2006-07-03', '2006-07-04', '2006-07-05', '2006-07-06', '2006-07-07', '2006-07-10', '2006-07-11', '2006-07-12', '2006-07-13', '2006-07-14', '2006-07-17', '2006-07-18', '2006-07-19', '2006-07-20', '2006-07-21', '2006-07-24', '2006-07-25', '2006-07-26', '2006-07-27', '2006-07-28', '2006-07-31', '2006-08-01', '2006-08-02', '2006-08-03', '2006-08-04', '2006-08-07', '2006-08-08', '2006-08-09', '2006-08-10', '2006-08-11', '2006-08-14', '2006-08-15', '2006-08-16', '2006-08-17', '2006-08-18', '2006-08-21', '2006-08-22', '2006-08-23', '2006-08-24', '2006-08-25', '2006-08-28', '2006-08-29', '2006-08-30', '2006-08-31', '2006-09-01', '2006-09-04', '2006-09-05', '2006-09-06', '2006-09-07', '2006-09-08', '2006-09-11', '2006-09-12', '2006-09-13', '2006-09-14', '2006-09-15', '2006-09-18', '2006-09-19', '2006-09-20', '2006-09-21', '2006-09-22', '2006-09-25', '2006-09-26', '2006-09-27', '2006-09-28', '2006-09-29', '2006-10-09', '2006-10-10', '2006-10-11', '2006-10-12', '2006-10-13', '2006-10-16', '2006-10-17', '2006-10-18', '2006-10-19', '2006-10-20', '2006-10-23', '2006-10-24', '2006-10-25', '2006-10-26', '2006-10-27', '2006-10-30', '2006-10-31', '2006-11-01', '2006-11-02', '2006-11-03', '2006-11-06', '2006-11-07', '2006-11-08', '2006-11-09', '2006-11-10', '2006-11-13', '2006-11-14', '2006-11-15', '2006-11-16', '2006-11-17', '2006-11-20', '2006-11-21', '2006-11-22', '2006-11-23', '2006-11-24', '2006-11-27', '2006-11-28', '2006-11-29', '2006-11-30', '2006-12-01', '2006-12-04', '2006-12-05', '2006-12-06', '2006-12-07', '2006-12-08', '2006-12-11', '2006-12-12', '2006-12-13', '2006-12-14', '2006-12-15', '2006-12-18', '2006-12-19', '2006-12-20', '2006-12-21', '2006-12-22', '2006-12-25', '2006-12-26', '2006-12-27', '2006-12-28', '2006-12-29', '2007-01-04', '2007-01-05', '2007-01-08', '2007-01-09', '2007-01-10', '2007-01-11', '2007-01-12', '2007-01-15', '2007-01-16', '2007-01-17', '2007-01-18', '2007-01-19', '2007-01-22', '2007-01-23', '2007-01-24', '2007-01-25', '2007-01-26', '2007-01-29', '2007-01-30', '2007-01-31', '2007-02-01', '2007-02-02', '2007-02-05', '2007-02-06', '2007-02-07', '2007-02-08', '2007-02-09', '2007-02-12', '2007-02-13', '2007-02-14', '2007-02-15', '2007-02-16', '2007-02-26', '2007-02-27', '2007-02-28', '2007-03-01', '2007-03-02', '2007-03-05', '2007-03-06', '2007-03-07', '2007-03-08', '2007-03-09', '2007-03-12', '2007-03-13', '2007-03-14', '2007-03-15', '2007-03-16', '2007-03-19', '2007-03-20', '2007-03-21', '2007-03-22', '2007-03-23', '2007-03-26', '2007-03-27', '2007-03-28', '2007-03-29', '2007-03-30', '2007-04-02', '2007-04-03', '2007-04-04', '2007-04-05', '2007-04-06', '2007-04-09', '2007-04-10', '2007-04-11', '2007-04-12', '2007-04-13', '2007-04-16', '2007-04-17', '2007-04-18', '2007-04-19', '2007-04-20', '2007-04-23', '2007-04-24', '2007-04-25', '2007-04-26', '2007-04-27', '2007-04-30', '2007-05-08', '2007-05-09', '2007-05-10', '2007-05-11', '2007-05-14', '2007-05-15', '2007-05-16', '2007-05-17', '2007-05-18', '2007-05-21', '2007-05-22', '2007-05-23', '2007-05-24', '2007-05-25', '2007-05-28', '2007-05-29', '2007-05-30', '2007-05-31', '2007-06-01', '2007-06-04', '2007-06-05', '2007-06-06', '2007-06-07', '2007-06-08', '2007-06-11', '2007-06-12', '2007-06-13', '2007-06-14', '2007-06-15', '2007-06-18', '2007-06-19', '2007-06-20', '2007-06-21', '2007-06-22', '2007-06-25', '2007-06-26', '2007-06-27', '2007-06-28', '2007-06-29', '2007-07-02', '2007-07-03', '2007-07-04', '2007-07-05', '2007-07-06', '2007-07-09', '2007-07-10', '2007-07-11', '2007-07-12', '2007-07-13', '2007-07-16', '2007-07-17', '2007-07-18', '2007-07-19', '2007-07-20', '2007-07-23', '2007-07-24', '2007-07-25', '2007-07-26', '2007-07-27', '2007-07-30', '2007-07-31', '2007-08-01', '2007-08-02', '2007-08-03', '2007-08-06', '2007-08-07', '2007-08-08', '2007-08-09', '2007-08-10', '2007-08-13', '2007-08-14', '2007-08-15', '2007-08-16', '2007-08-17', '2007-08-20', '2007-08-21', '2007-08-22', '2007-08-23', '2007-08-24', '2007-08-27', '2007-08-28', '2007-08-29', '2007-08-30', '2007-08-31', '2007-09-03', '2007-09-04', '2007-09-05', '2007-09-06', '2007-09-07', '2007-09-10', '2007-09-11', '2007-09-12', '2007-09-13', '2007-09-14', '2007-09-17', '2007-09-18', '2007-09-19', '2007-09-20', '2007-09-21', '2007-09-24', '2007-09-25', '2007-09-26', '2007-09-27', '2007-09-28', '2007-10-08', '2007-10-09', '2007-10-10', '2007-10-11', '2007-10-12', '2007-10-15', '2007-10-16', '2007-10-17', '2007-10-18', '2007-10-19', '2007-10-22', '2007-10-23', '2007-10-24', '2007-10-25', '2007-10-26', '2007-10-29', '2007-10-30', '2007-10-31', '2007-11-01', '2007-11-02', '2007-11-05', '2007-11-06', '2007-11-07', '2007-11-08', '2007-11-09', '2007-11-12', '2007-11-13', '2007-11-14', '2007-11-15', '2007-11-16', '2007-11-19', '2007-11-20', '2007-11-21', '2007-11-22', '2007-11-23', '2007-11-26', '2007-11-27', '2007-11-28', '2007-11-29', '2007-11-30', '2007-12-03', '2007-12-04', '2007-12-05', '2007-12-06', '2007-12-07', '2007-12-10', '2007-12-11', '2007-12-12', '2007-12-13', '2007-12-14', '2007-12-17', '2007-12-18', '2007-12-19', '2007-12-20', '2007-12-21', '2007-12-24', '2007-12-25', '2007-12-26', '2007-12-27', '2007-12-28', '2008-01-02', '2008-01-03', '2008-01-04', '2008-01-07', '2008-01-08', '2008-01-09', '2008-01-10', '2008-01-11', '2008-01-14', '2008-01-15', '2008-01-16', '2008-01-17', '2008-01-18', '2008-01-21', '2008-01-22', '2008-01-23', '2008-01-24', '2008-01-25', '2008-01-28', '2008-01-29', '2008-01-30', '2008-01-31', '2008-02-01', '2008-02-04', '2008-02-05', '2008-02-13', '2008-02-14', '2008-02-15', '2008-02-18', '2008-02-19', '2008-02-20', '2008-02-21', '2008-02-22', '2008-02-25', '2008-02-26', '2008-02-27', '2008-02-28', '2008-02-29', '2008-03-03', '2008-03-04', '2008-03-05', '2008-03-06', '2008-03-07', '2008-03-10', '2008-03-11', '2008-03-12', '2008-03-13', '2008-03-14', '2008-03-17', '2008-03-18', '2008-03-19', '2008-03-20', '2008-03-21', '2008-03-24', '2008-03-25', '2008-03-26', '2008-03-27', '2008-03-28', '2008-03-31', '2008-04-01', '2008-04-02', '2008-04-03', '2008-04-07', '2008-04-08', '2008-04-09', '2008-04-10', '2008-04-11', '2008-04-14', '2008-04-15', '2008-04-16', '2008-04-17', '2008-04-18', '2008-04-21', '2008-04-22', '2008-04-23', '2008-04-24', '2008-04-25', '2008-04-28', '2008-04-29', '2008-04-30', '2008-05-05', '2008-05-06', '2008-05-07', '2008-05-08', '2008-05-09', '2008-05-12', '2008-05-13', '2008-05-14', '2008-05-15', '2008-05-16', '2008-05-19', '2008-05-20', '2008-05-21', '2008-05-22', '2008-05-23', '2008-05-26', '2008-05-27', '2008-05-28', '2008-05-29', '2008-05-30', '2008-06-02', '2008-06-03', '2008-06-04', '2008-06-05', '2008-06-06', '2008-06-10', '2008-06-11', '2008-06-12', '2008-06-13', '2008-06-16', '2008-06-17', '2008-06-18', '2008-06-19', '2008-06-20', '2008-06-23', '2008-06-24', '2008-06-25', '2008-06-26', '2008-06-27', '2008-06-30', '2008-07-01', '2008-07-02', '2008-07-03', '2008-07-04', '2008-07-07', '2008-07-08', '2008-07-09', '2008-07-10', '2008-07-11', '2008-07-14', '2008-07-15', '2008-07-16', '2008-07-17', '2008-07-18', '2008-07-21', '2008-07-22', '2008-07-23', '2008-07-24', '2008-07-25', '2008-07-28', '2008-07-29', '2008-07-30', '2008-07-31', '2008-08-01', '2008-08-04', '2008-08-05', '2008-08-06', '2008-08-07', '2008-08-08', '2008-08-11', '2008-08-12', '2008-08-13', '2008-08-14', '2008-08-15', '2008-08-18', '2008-08-19', '2008-08-20', '2008-08-21', '2008-08-22', '2008-08-25', '2008-08-26', '2008-08-27', '2008-08-28', '2008-08-29', '2008-09-01', '2008-09-02', '2008-09-03', '2008-09-04', '2008-09-05', '2008-09-08', '2008-09-09', '2008-09-10', '2008-09-11', '2008-09-12', '2008-09-16', '2008-09-17', '2008-09-18', '2008-09-19', '2008-09-22', '2008-09-23', '2008-09-24', '2008-09-25', '2008-09-26', '2008-10-06', '2008-10-07', '2008-10-08', '2008-10-09', '2008-10-10', '2008-10-13', '2008-10-14', '2008-10-15', '2008-10-16', '2008-10-17', '2008-10-20', '2008-10-21', '2008-10-22', '2008-10-23', '2008-10-24', '2008-10-27', '2008-10-28', '2008-10-29', '2008-10-30', '2008-10-31', '2008-11-03', '2008-11-04', '2008-11-05', '2008-11-06', '2008-11-07', '2008-11-10', '2008-11-11', '2008-11-12', '2008-11-13', '2008-11-14', '2008-11-17', '2008-11-18', '2008-11-19', '2008-11-20', '2008-11-21', '2008-11-24', '2008-11-25', '2008-11-26', '2008-11-27', '2008-11-28', '2008-12-01', '2008-12-02', '2008-12-03', '2008-12-04', '2008-12-05', '2008-12-08', '2008-12-09', '2008-12-10', '2008-12-11', '2008-12-12', '2008-12-15', '2008-12-16', '2008-12-17', '2008-12-18', '2008-12-19', '2008-12-22', '2008-12-23', '2008-12-24', '2008-12-25', '2008-12-26', '2008-12-29', '2008-12-30', '2008-12-31', '2009-01-05', '2009-01-06', '2009-01-07', '2009-01-08', '2009-01-09', '2009-01-12', '2009-01-13', '2009-01-14', '2009-01-15', '2009-01-16', '2009-01-19', '2009-01-20', '2009-01-21', '2009-01-22', '2009-01-23', '2009-02-02', '2009-02-03', '2009-02-04', '2009-02-05', '2009-02-06', '2009-02-09', '2009-02-10', '2009-02-11', '2009-02-12', '2009-02-13', '2009-02-16', '2009-02-17', '2009-02-18', '2009-02-19', '2009-02-20', '2009-02-23', '2009-02-24', '2009-02-25', '2009-02-26', '2009-02-27', '2009-03-02', '2009-03-03', '2009-03-04', '2009-03-05', '2009-03-06', '2009-03-09', '2009-03-10', '2009-03-11', '2009-03-12', '2009-03-13', '2009-03-16', '2009-03-17', '2009-03-18', '2009-03-19', '2009-03-20', '2009-03-23', '2009-03-24', '2009-03-25', '2009-03-26', '2009-03-27', '2009-03-30', '2009-03-31', '2009-04-01', '2009-04-02', '2009-04-03', '2009-04-07', '2009-04-08', '2009-04-09', '2009-04-10', '2009-04-13', '2009-04-14', '2009-04-15', '2009-04-16', '2009-04-17', '2009-04-20', '2009-04-21', '2009-04-22', '2009-04-23', '2009-04-24', '2009-04-27', '2009-04-28', '2009-04-29', '2009-04-30', '2009-05-04', '2009-05-05', '2009-05-06', '2009-05-07', '2009-05-08', '2009-05-11', '2009-05-12', '2009-05-13', '2009-05-14', '2009-05-15', '2009-05-18', '2009-05-19', '2009-05-20', '2009-05-21', '2009-05-22', '2009-05-25', '2009-05-26', '2009-05-27', '2009-06-01', '2009-06-02', '2009-06-03', '2009-06-04', '2009-06-05', '2009-06-08', '2009-06-09', '2009-06-10', '2009-06-11', '2009-06-12', '2009-06-15', '2009-06-16', '2009-06-17', '2009-06-18', '2009-06-19', '2009-06-22', '2009-06-23', '2009-06-24', '2009-06-25', '2009-06-26', '2009-06-29', '2009-06-30', '2009-07-01', '2009-07-02', '2009-07-03', '2009-07-06', '2009-07-07', '2009-07-08', '2009-07-09', '2009-07-10', '2009-07-13', '2009-07-14', '2009-07-15', '2009-07-16', '2009-07-17', '2009-07-20', '2009-07-21', '2009-07-22', '2009-07-23', '2009-07-24', '2009-07-27', '2009-07-28', '2009-07-29', '2009-07-30', '2009-07-31', '2009-08-03', '2009-08-04', '2009-08-05', '2009-08-06', '2009-08-07', '2009-08-10', '2009-08-11', '2009-08-12', '2009-08-13', '2009-08-14', '2009-08-17', '2009-08-18', '2009-08-19', '2009-08-20', '2009-08-21', '2009-08-24', '2009-08-25', '2009-08-26', '2009-08-27', '2009-08-28', '2009-08-31', '2009-09-01', '2009-09-02', '2009-09-03', '2009-09-04', '2009-09-07', '2009-09-08', '2009-09-09', '2009-09-10', '2009-09-11', '2009-09-14', '2009-09-15', '2009-09-16', '2009-09-17', '2009-09-18', '2009-09-21', '2009-09-22', '2009-09-23', '2009-09-24', '2009-09-25', '2009-09-28', '2009-09-29', '2009-09-30', '2009-10-09', '2009-10-12', '2009-10-13', '2009-10-14', '2009-10-15', '2009-10-16', '2009-10-19', '2009-10-20', '2009-10-21', '2009-10-22', '2009-10-23', '2009-10-26', '2009-10-27', '2009-10-28', '2009-10-29', '2009-10-30', '2009-11-02', '2009-11-03', '2009-11-04', '2009-11-05', '2009-11-06', '2009-11-09', '2009-11-10', '2009-11-11', '2009-11-12', '2009-11-13', '2009-11-16', '2009-11-17', '2009-11-18', '2009-11-19', '2009-11-20', '2009-11-23', '2009-11-24', '2009-11-25', '2009-11-26', '2009-11-27', '2009-11-30', '2009-12-01', '2009-12-02', '2009-12-03', '2009-12-04', '2009-12-07', '2009-12-08', '2009-12-09', '2009-12-10', '2009-12-11', '2009-12-14', '2009-12-15', '2009-12-16', '2009-12-17', '2009-12-18', '2009-12-21', '2009-12-22', '2009-12-23', '2009-12-24', '2009-12-25', '2009-12-28', '2009-12-29', '2009-12-30', '2009-12-31', '2010-01-04', '2010-01-05', '2010-01-06', '2010-01-07', '2010-01-08', '2010-01-11', '2010-01-12', '2010-01-13', '2010-01-14', '2010-01-15', '2010-01-18', '2010-01-19', '2010-01-20', '2010-01-21', '2010-01-22', '2010-01-25', '2010-01-26', '2010-01-27', '2010-01-28', '2010-01-29', '2010-02-01', '2010-02-02', '2010-02-03', '2010-02-04', '2010-02-05', '2010-02-08', '2010-02-09', '2010-02-10', '2010-02-11', '2010-02-12', '2010-02-22', '2010-02-23', '2010-02-24', '2010-02-25', '2010-02-26', '2010-03-01', '2010-03-02', '2010-03-03', '2010-03-04', '2010-03-05', '2010-03-08', '2010-03-09', '2010-03-10', '2010-03-11', '2010-03-12', '2010-03-15', '2010-03-16', '2010-03-17', '2010-03-18', '2010-03-19', '2010-03-22', '2010-03-23', '2010-03-24', '2010-03-25', '2010-03-26', '2010-03-29', '2010-03-30', '2010-03-31', '2010-04-01', '2010-04-02', '2010-04-06', '2010-04-07', '2010-04-08', '2010-04-09', '2010-04-12', '2010-04-13', '2010-04-14', '2010-04-15', '2010-04-16', '2010-04-19', '2010-04-20', '2010-04-21', '2010-04-22', '2010-04-23', '2010-04-26', '2010-04-27', '2010-04-28', '2010-04-29', '2010-04-30', '2010-05-04', '2010-05-05', '2010-05-06', '2010-05-07', '2010-05-10', '2010-05-11', '2010-05-12', '2010-05-13', '2010-05-14', '2010-05-17', '2010-05-18', '2010-05-19', '2010-05-20', '2010-05-21', '2010-05-24', '2010-05-25', '2010-05-26', '2010-05-27', '2010-05-28', '2010-05-31', '2010-06-01', '2010-06-02', '2010-06-03', '2010-06-04', '2010-06-07', '2010-06-08', '2010-06-09', '2010-06-10', '2010-06-11', '2010-06-17', '2010-06-18', '2010-06-21', '2010-06-22', '2010-06-23', '2010-06-24', '2010-06-25', '2010-06-28', '2010-06-29', '2010-06-30', '2010-07-01', '2010-07-02', '2010-07-05', '2010-07-06', '2010-07-07', '2010-07-08', '2010-07-09', '2010-07-12', '2010-07-13', '2010-07-14', '2010-07-15', '2010-07-16', '2010-07-19', '2010-07-20', '2010-07-21', '2010-07-22', '2010-07-23', '2010-07-26', '2010-07-27', '2010-07-28', '2010-07-29', '2010-07-30', '2010-08-02', '2010-08-03', '2010-08-04', '2010-08-05', '2010-08-06', '2010-08-09', '2010-08-10', '2010-08-11', '2010-08-12', '2010-08-13', '2010-08-16', '2010-08-17', '2010-08-18', '2010-08-19', '2010-08-20', '2010-08-23', '2010-08-24', '2010-08-25', '2010-08-26', '2010-08-27', '2010-08-30', '2010-08-31', '2010-09-01', '2010-09-02', '2010-09-03', '2010-09-06', '2010-09-07', '2010-09-08', '2010-09-09', '2010-09-10', '2010-09-13', '2010-09-14', '2010-09-15', '2010-09-16', '2010-09-17', '2010-09-20', '2010-09-21', '2010-09-27', '2010-09-28', '2010-09-29', '2010-09-30', '2010-10-08', '2010-10-11', '2010-10-12', '2010-10-13', '2010-10-14', '2010-10-15', '2010-10-18', '2010-10-19', '2010-10-20', '2010-10-21', '2010-10-22', '2010-10-25', '2010-10-26', '2010-10-27', '2010-10-28', '2010-10-29', '2010-11-01', '2010-11-02', '2010-11-03', '2010-11-04', '2010-11-05', '2010-11-08', '2010-11-09', '2010-11-10', '2010-11-11', '2010-11-12', '2010-11-15', '2010-11-16', '2010-11-17', '2010-11-18', '2010-11-19', '2010-11-22', '2010-11-23', '2010-11-24', '2010-11-25', '2010-11-26', '2010-11-29', '2010-11-30', '2010-12-01', '2010-12-02', '2010-12-03', '2010-12-06', '2010-12-07', '2010-12-08', '2010-12-09', '2010-12-10', '2010-12-13', '2010-12-14', '2010-12-15', '2010-12-16', '2010-12-17', '2010-12-20', '2010-12-21', '2010-12-22', '2010-12-23', '2010-12-24', '2010-12-27', '2010-12-28', '2010-12-29', '2010-12-30', '2010-12-31', '2011-01-04', '2011-01-05', '2011-01-06', '2011-01-07', '2011-01-10', '2011-01-11', '2011-01-12', '2011-01-13', '2011-01-14', '2011-01-17', '2011-01-18', '2011-01-19', '2011-01-20', '2011-01-21', '2011-01-24', '2011-01-25', '2011-01-26', '2011-01-27', '2011-01-28', '2011-01-31', '2011-02-01', '2011-02-09', '2011-02-10', '2011-02-11', '2011-02-14', '2011-02-15', '2011-02-16', '2011-02-17', '2011-02-18', '2011-02-21', '2011-02-22', '2011-02-23', '2011-02-24', '2011-02-25', '2011-02-28', '2011-03-01', '2011-03-02', '2011-03-03', '2011-03-04', '2011-03-07', '2011-03-08', '2011-03-09', '2011-03-10', '2011-03-11', '2011-03-14', '2011-03-15', '2011-03-16', '2011-03-17', '2011-03-18', '2011-03-21', '2011-03-22', '2011-03-23', '2011-03-24', '2011-03-25', '2011-03-28', '2011-03-29', '2011-03-30', '2011-03-31', '2011-04-01', '2011-04-06', '2011-04-07', '2011-04-08', '2011-04-11', '2011-04-12', '2011-04-13', '2011-04-14', '2011-04-15', '2011-04-18', '2011-04-19', '2011-04-20', '2011-04-21', '2011-04-22', '2011-04-25', '2011-04-26', '2011-04-27', '2011-04-28', '2011-04-29', '2011-05-03', '2011-05-04', '2011-05-05', '2011-05-06', '2011-05-09', '2011-05-10', '2011-05-11', '2011-05-12', '2011-05-13', '2011-05-16', '2011-05-17', '2011-05-18', '2011-05-19', '2011-05-20', '2011-05-23', '2011-05-24', '2011-05-25', '2011-05-26', '2011-05-27', '2011-05-30', '2011-05-31', '2011-06-01', '2011-06-02', '2011-06-03', '2011-06-07', '2011-06-08', '2011-06-09', '2011-06-10', '2011-06-13', '2011-06-14', '2011-06-15', '2011-06-16', '2011-06-17', '2011-06-20', '2011-06-21', '2011-06-22', '2011-06-23', '2011-06-24', '2011-06-27', '2011-06-28', '2011-06-29', '2011-06-30', '2011-07-01', '2011-07-04', '2011-07-05', '2011-07-06', '2011-07-07', '2011-07-08', '2011-07-11', '2011-07-12', '2011-07-13', '2011-07-14', '2011-07-15', '2011-07-18', '2011-07-19', '2011-07-20', '2011-07-21', '2011-07-22', '2011-07-25', '2011-07-26', '2011-07-27', '2011-07-28', '2011-07-29', '2011-08-01', '2011-08-02', '2011-08-03', '2011-08-04', '2011-08-05', '2011-08-08', '2011-08-09', '2011-08-10', '2011-08-11', '2011-08-12', '2011-08-15', '2011-08-16', '2011-08-17', '2011-08-18', '2011-08-19', '2011-08-22', '2011-08-23', '2011-08-24', '2011-08-25', '2011-08-26', '2011-08-29', '2011-08-30', '2011-08-31', '2011-09-01', '2011-09-02', '2011-09-05', '2011-09-06', '2011-09-07', '2011-09-08', '2011-09-09', '2011-09-13', '2011-09-14', '2011-09-15', '2011-09-16', '2011-09-19', '2011-09-20', '2011-09-21', '2011-09-22', '2011-09-23', '2011-09-26', '2011-09-27', '2011-09-28', '2011-09-29', '2011-09-30', '2011-10-10', '2011-10-11', '2011-10-12', '2011-10-13', '2011-10-14', '2011-10-17', '2011-10-18', '2011-10-19', '2011-10-20', '2011-10-21', '2011-10-24', '2011-10-25', '2011-10-26', '2011-10-27', '2011-10-28', '2011-10-31', '2011-11-01', '2011-11-02', '2011-11-03', '2011-11-04', '2011-11-07', '2011-11-08', '2011-11-09', '2011-11-10', '2011-11-11', '2011-11-14', '2011-11-15', '2011-11-16', '2011-11-17', '2011-11-18', '2011-11-21', '2011-11-22', '2011-11-23', '2011-11-24', '2011-11-25', '2011-11-28', '2011-11-29', '2011-11-30', '2011-12-01', '2011-12-02', '2011-12-05', '2011-12-06', '2011-12-07', '2011-12-08', '2011-12-09', '2011-12-12', '2011-12-13', '2011-12-14', '2011-12-15', '2011-12-16', '2011-12-19', '2011-12-20', '2011-12-21', '2011-12-22', '2011-12-23', '2011-12-26', '2011-12-27', '2011-12-28', '2011-12-29', '2011-12-30', '2012-01-04', '2012-01-05', '2012-01-06', '2012-01-09', '2012-01-10', '2012-01-11', '2012-01-12', '2012-01-13', '2012-01-16', '2012-01-17', '2012-01-18', '2012-01-19', '2012-01-20', '2012-01-30', '2012-01-31', '2012-02-01', '2012-02-02', '2012-02-03', '2012-02-06', '2012-02-07', '2012-02-08', '2012-02-09', '2012-02-10', '2012-02-13', '2012-02-14', '2012-02-15', '2012-02-16', '2012-02-17', '2012-02-20', '2012-02-21', '2012-02-22', '2012-02-23', '2012-02-24', '2012-02-27', '2012-02-28', '2012-02-29', '2012-03-01', '2012-03-02', '2012-03-05', '2012-03-06', '2012-03-07', '2012-03-08', '2012-03-09', '2012-03-12', '2012-03-13', '2012-03-14', '2012-03-15', '2012-03-16', '2012-03-19', '2012-03-20', '2012-03-21', '2012-03-22', '2012-03-23', '2012-03-26', '2012-03-27', '2012-03-28', '2012-03-29', '2012-03-30', '2012-04-05', '2012-04-06', '2012-04-09', '2012-04-10', '2012-04-11', '2012-04-12', '2012-04-13', '2012-04-16', '2012-04-17', '2012-04-18', '2012-04-19', '2012-04-20', '2012-04-23', '2012-04-24', '2012-04-25', '2012-04-26', '2012-04-27', '2012-05-02', '2012-05-03', '2012-05-04', '2012-05-07', '2012-05-08', '2012-05-09', '2012-05-10', '2012-05-11', '2012-05-14', '2012-05-15', '2012-05-16', '2012-05-17', '2012-05-18', '2012-05-21', '2012-05-22', '2012-05-23', '2012-05-24', '2012-05-25', '2012-05-28', '2012-05-29', '2012-05-30', '2012-05-31', '2012-06-01', '2012-06-04', '2012-06-05', '2012-06-06', '2012-06-07', '2012-06-08', '2012-06-11', '2012-06-12', '2012-06-13', '2012-06-14', '2012-06-15', '2012-06-18', '2012-06-19', '2012-06-20', '2012-06-21', '2012-06-25', '2012-06-26', '2012-06-27', '2012-06-28', '2012-06-29', '2012-07-02', '2012-07-03', '2012-07-04', '2012-07-05', '2012-07-06', '2012-07-09', '2012-07-10', '2012-07-11', '2012-07-12', '2012-07-13', '2012-07-16', '2012-07-17', '2012-07-18', '2012-07-19', '2012-07-20', '2012-07-23', '2012-07-24', '2012-07-25', '2012-07-26', '2012-07-27', '2012-07-30', '2012-07-31', '2012-08-01', '2012-08-02', '2012-08-03', '2012-08-06', '2012-08-07', '2012-08-08', '2012-08-09', '2012-08-10', '2012-08-13', '2012-08-14', '2012-08-15', '2012-08-16', '2012-08-17', '2012-08-20', '2012-08-21', '2012-08-22', '2012-08-23', '2012-08-24', '2012-08-27', '2012-08-28', '2012-08-29', '2012-08-30', '2012-08-31', '2012-09-03', '2012-09-04', '2012-09-05', '2012-09-06', '2012-09-07', '2012-09-10', '2012-09-11', '2012-09-12', '2012-09-13', '2012-09-14', '2012-09-17', '2012-09-18', '2012-09-19', '2012-09-20', '2012-09-21', '2012-09-24', '2012-09-25', '2012-09-26', '2012-09-27', '2012-09-28', '2012-10-08', '2012-10-09', '2012-10-10', '2012-10-11', '2012-10-12', '2012-10-15', '2012-10-16', '2012-10-17', '2012-10-18', '2012-10-19', '2012-10-22', '2012-10-23', '2012-10-24', '2012-10-25', '2012-10-26', '2012-10-29', '2012-10-30', '2012-10-31', '2012-11-01', '2012-11-02', '2012-11-05', '2012-11-06', '2012-11-07', '2012-11-08', '2012-11-09', '2012-11-12', '2012-11-13', '2012-11-14', '2012-11-15', '2012-11-16', '2012-11-19', '2012-11-20', '2012-11-21', '2012-11-22', '2012-11-23', '2012-11-26', '2012-11-27', '2012-11-28', '2012-11-29', '2012-11-30', '2012-12-03', '2012-12-04', '2012-12-05', '2012-12-06', '2012-12-07', '2012-12-10', '2012-12-11', '2012-12-12', '2012-12-13', '2012-12-14', '2012-12-17', '2012-12-18', '2012-12-19', '2012-12-20', '2012-12-21', '2012-12-24', '2012-12-25', '2012-12-26', '2012-12-27', '2012-12-28', '2012-12-31', '2013-01-04', '2013-01-07', '2013-01-08', '2013-01-09', '2013-01-10', '2013-01-11', '2013-01-14', '2013-01-15', '2013-01-16', '2013-01-17', '2013-01-18', '2013-01-21', '2013-01-22', '2013-01-23', '2013-01-24', '2013-01-25', '2013-01-28', '2013-01-29', '2013-01-30', '2013-01-31', '2013-02-01', '2013-02-04', '2013-02-05', '2013-02-06', '2013-02-07', '2013-02-08', '2013-02-18', '2013-02-19', '2013-02-20', '2013-02-21', '2013-02-22', '2013-02-25', '2013-02-26', '2013-02-27', '2013-02-28', '2013-03-01', '2013-03-04', '2013-03-05', '2013-03-06', '2013-03-07', '2013-03-08', '2013-03-11', '2013-03-12', '2013-03-13', '2013-03-14', '2013-03-15', '2013-03-18', '2013-03-19', '2013-03-20', '2013-03-21', '2013-03-22', '2013-03-25', '2013-03-26', '2013-03-27', '2013-03-28', '2013-03-29', '2013-04-01', '2013-04-02', '2013-04-03', '2013-04-08', '2013-04-09', '2013-04-10', '2013-04-11', '2013-04-12', '2013-04-15', '2013-04-16', '2013-04-17', '2013-04-18', '2013-04-19', '2013-04-22', '2013-04-23', '2013-04-24', '2013-04-25', '2013-04-26', '2013-05-02', '2013-05-03', '2013-05-06', '2013-05-07', '2013-05-08', '2013-05-09', '2013-05-10', '2013-05-13', '2013-05-14', '2013-05-15', '2013-05-16', '2013-05-17', '2013-05-20', '2013-05-21', '2013-05-22', '2013-05-23', '2013-05-24', '2013-05-27', '2013-05-28', '2013-05-29', '2013-05-30', '2013-05-31', '2013-06-03', '2013-06-04', '2013-06-05', '2013-06-06', '2013-06-07', '2013-06-13', '2013-06-14', '2013-06-17', '2013-06-18', '2013-06-19', '2013-06-20', '2013-06-21', '2013-06-24', '2013-06-25', '2013-06-26', '2013-06-27', '2013-06-28', '2013-07-01', '2013-07-02', '2013-07-03', '2013-07-04', '2013-07-05', '2013-07-08', '2013-07-09', '2013-07-10', '2013-07-11', '2013-07-12', '2013-07-15', '2013-07-16', '2013-07-17', '2013-07-18', '2013-07-19', '2013-07-22', '2013-07-23', '2013-07-24', '2013-07-25', '2013-07-26', '2013-07-29', '2013-07-30', '2013-07-31', '2013-08-01', '2013-08-02', '2013-08-05', '2013-08-06', '2013-08-07', '2013-08-08', '2013-08-09', '2013-08-12', '2013-08-13', '2013-08-14', '2013-08-15', '2013-08-16', '2013-08-19', '2013-08-20', '2013-08-21', '2013-08-22', '2013-08-23', '2013-08-26', '2013-08-27', '2013-08-28', '2013-08-29', '2013-08-30', '2013-09-02', '2013-09-03', '2013-09-04', '2013-09-05', '2013-09-06', '2013-09-09', '2013-09-10', '2013-09-11', '2013-09-12', '2013-09-13', '2013-09-16', '2013-09-17', '2013-09-18', '2013-09-23', '2013-09-24', '2013-09-25', '2013-09-26', '2013-09-27', '2013-09-30', '2013-10-08', '2013-10-09', '2013-10-10', '2013-10-11', '2013-10-14', '2013-10-15', '2013-10-16', '2013-10-17', '2013-10-18', '2013-10-21', '2013-10-22', '2013-10-23', '2013-10-24', '2013-10-25', '2013-10-28', '2013-10-29', '2013-10-30', '2013-10-31', '2013-11-01', '2013-11-04', '2013-11-05', '2013-11-06', '2013-11-07', '2013-11-08', '2013-11-11', '2013-11-12', '2013-11-13', '2013-11-14', '2013-11-15', '2013-11-18', '2013-11-19', '2013-11-20', '2013-11-21', '2013-11-22', '2013-11-25', '2013-11-26', '2013-11-27', '2013-11-28', '2013-11-29', '2013-12-02', '2013-12-03', '2013-12-04', '2013-12-05', '2013-12-06', '2013-12-09', '2013-12-10', '2013-12-11', '2013-12-12', '2013-12-13', '2013-12-16', '2013-12-17', '2013-12-18', '2013-12-19', '2013-12-20', '2013-12-23', '2013-12-24', '2013-12-25', '2013-12-26', '2013-12-27', '2013-12-30', '2013-12-31', '2014-01-02', '2014-01-03', '2014-01-06', '2014-01-07', '2014-01-08', '2014-01-09', '2014-01-10', '2014-01-13', '2014-01-14', '2014-01-15', '2014-01-16', '2014-01-17', '2014-01-20', '2014-01-21', '2014-01-22', '2014-01-23', '2014-01-24', '2014-01-27', '2014-01-28', '2014-01-29', '2014-01-30', '2014-02-07', '2014-02-10', '2014-02-11', '2014-02-12', '2014-02-13', '2014-02-14', '2014-02-17', '2014-02-18', '2014-02-19', '2014-02-20', '2014-02-21', '2014-02-24', '2014-02-25', '2014-02-26', '2014-02-27', '2014-02-28', '2014-03-03', '2014-03-04', '2014-03-05', '2014-03-06', '2014-03-07', '2014-03-10', '2014-03-11', '2014-03-12', '2014-03-13', '2014-03-14', '2014-03-17', '2014-03-18', '2014-03-19', '2014-03-20', '2014-03-21', '2014-03-24', '2014-03-25', '2014-03-26', '2014-03-27', '2014-03-28', '2014-03-31', '2014-04-01', '2014-04-02', '2014-04-03', '2014-04-04', '2014-04-08', '2014-04-09', '2014-04-10', '2014-04-11', '2014-04-14', '2014-04-15', '2014-04-16', '2014-04-17', '2014-04-18', '2014-04-21', '2014-04-22', '2014-04-23', '2014-04-24', '2014-04-25', '2014-04-28', '2014-04-29', '2014-04-30', '2014-05-05', '2014-05-06', '2014-05-07', '2014-05-08', '2014-05-09', '2014-05-12', '2014-05-13', '2014-05-14', '2014-05-15', '2014-05-16', '2014-05-19', '2014-05-20', '2014-05-21', '2014-05-22', '2014-05-23', '2014-05-26', '2014-05-27', '2014-05-28', '2014-05-29', '2014-05-30', '2014-06-03', '2014-06-04', '2014-06-05', '2014-06-06', '2014-06-09', '2014-06-10', '2014-06-11', '2014-06-12', '2014-06-13', '2014-06-16', '2014-06-17', '2014-06-18', '2014-06-19', '2014-06-20', '2014-06-23', '2014-06-24', '2014-06-25', '2014-06-26', '2014-06-27', '2014-06-30', '2014-07-01', '2014-07-02', '2014-07-03', '2014-07-04', '2014-07-07', '2014-07-08', '2014-07-09', '2014-07-10', '2014-07-11', '2014-07-14', '2014-07-15', '2014-07-16', '2014-07-17', '2014-07-18', '2014-07-21', '2014-07-22', '2014-07-23', '2014-07-24', '2014-07-25', '2014-07-28', '2014-07-29', '2014-07-30', '2014-07-31', '2014-08-01', '2014-08-04', '2014-08-05', '2014-08-06', '2014-08-07', '2014-08-08', '2014-08-11', '2014-08-12', '2014-08-13', '2014-08-14', '2014-08-15', '2014-08-18', '2014-08-19', '2014-08-20', '2014-08-21', '2014-08-22', '2014-08-25', '2014-08-26', '2014-08-27', '2014-08-28', '2014-08-29', '2014-09-01', '2014-09-02', '2014-09-03', '2014-09-04', '2014-09-05', '2014-09-09', '2014-09-10', '2014-09-11', '2014-09-12', '2014-09-15', '2014-09-16', '2014-09-17', '2014-09-18', '2014-09-19', '2014-09-22', '2014-09-23', '2014-09-24', '2014-09-25', '2014-09-26', '2014-09-29', '2014-09-30', '2014-10-08', '2014-10-09', '2014-10-10', '2014-10-13', '2014-10-14', '2014-10-15', '2014-10-16', '2014-10-17', '2014-10-20', '2014-10-21', '2014-10-22', '2014-10-23', '2014-10-24', '2014-10-27', '2014-10-28', '2014-10-29', '2014-10-30', '2014-10-31', '2014-11-03', '2014-11-04', '2014-11-05', '2014-11-06', '2014-11-07', '2014-11-10', '2014-11-11', '2014-11-12', '2014-11-13', '2014-11-14', '2014-11-17', '2014-11-18', '2014-11-19', '2014-11-20', '2014-11-21', '2014-11-24', '2014-11-25', '2014-11-26', '2014-11-27', '2014-11-28', '2014-12-01', '2014-12-02', '2014-12-03', '2014-12-04', '2014-12-05', '2014-12-08', '2014-12-09', '2014-12-10', '2014-12-11', '2014-12-12', '2014-12-15', '2014-12-16', '2014-12-17', '2014-12-18', '2014-12-19', '2014-12-22', '2014-12-23', '2014-12-24', '2014-12-25', '2014-12-26', '2014-12-29', '2014-12-30', '2014-12-31', '2015-01-05', '2015-01-06', '2015-01-07', '2015-01-08', '2015-01-09', '2015-01-12', '2015-01-13', '2015-01-14', '2015-01-15', '2015-01-16', '2015-01-19', '2015-01-20', '2015-01-21', '2015-01-22', '2015-01-23', '2015-01-26', '2015-01-27', '2015-01-28', '2015-01-29', '2015-01-30', '2015-02-02', '2015-02-03', '2015-02-04', '2015-02-05', '2015-02-06', '2015-02-09', '2015-02-10', '2015-02-11', '2015-02-12', '2015-02-13', '2015-02-16', '2015-02-17', '2015-02-25', '2015-02-26', '2015-02-27', '2015-03-02', '2015-03-03', '2015-03-04', '2015-03-05', '2015-03-06', '2015-03-09', '2015-03-10', '2015-03-11', '2015-03-12', '2015-03-13', '2015-03-16', '2015-03-17', '2015-03-18', '2015-03-19', '2015-03-20', '2015-03-23', '2015-03-24', '2015-03-25', '2015-03-26', '2015-03-27', '2015-03-30', '2015-03-31', '2015-04-01', '2015-04-02', '2015-04-03', '2015-04-07', '2015-04-08', '2015-04-09', '2015-04-10', '2015-04-13', '2015-04-14', '2015-04-15', '2015-04-16', '2015-04-17', '2015-04-20', '2015-04-21', '2015-04-22', '2015-04-23', '2015-04-24', '2015-04-27', '2015-04-28', '2015-04-29', '2015-04-30', '2015-05-04', '2015-05-05', '2015-05-06', '2015-05-07', '2015-05-08', '2015-05-11', '2015-05-12', '2015-05-13', '2015-05-14', '2015-05-15', '2015-05-18', '2015-05-19', '2015-05-20', '2015-05-21', '2015-05-22', '2015-05-25', '2015-05-26', '2015-05-27', '2015-05-28', '2015-05-29', '2015-06-01', '2015-06-02', '2015-06-03', '2015-06-04', '2015-06-05', '2015-06-08', '2015-06-09', '2015-06-10', '2015-06-11', '2015-06-12', '2015-06-15', '2015-06-16', '2015-06-17', '2015-06-18', '2015-06-19', '2015-06-23', '2015-06-24', '2015-06-25', '2015-06-26', '2015-06-29', '2015-06-30', '2015-07-01', '2015-07-02', '2015-07-03', '2015-07-06', '2015-07-07', '2015-07-08', '2015-07-09', '2015-07-10', '2015-07-13', '2015-07-14', '2015-07-15', '2015-07-16', '2015-07-17', '2015-07-20', '2015-07-21', '2015-07-22', '2015-07-23', '2015-07-24', '2015-07-27', '2015-07-28', '2015-07-29', '2015-07-30', '2015-07-31', '2015-08-03', '2015-08-04', '2015-08-05', '2015-08-06', '2015-08-07', '2015-08-10', '2015-08-11', '2015-08-12', '2015-08-13', '2015-08-14', '2015-08-17', '2015-08-18', '2015-08-19', '2015-08-20', '2015-08-21', '2015-08-24', '2015-08-25', '2015-08-26', '2015-08-27', '2015-08-28', '2015-08-31', '2015-09-01', '2015-09-02', '2015-09-07', '2015-09-08', '2015-09-09', '2015-09-10', '2015-09-11', '2015-09-14', '2015-09-15', '2015-09-16', '2015-09-17', '2015-09-18', '2015-09-21', '2015-09-22', '2015-09-23', '2015-09-24', '2015-09-25', '2015-09-28', '2015-09-29', '2015-09-30', '2015-10-08', '2015-10-09', '2015-10-12', '2015-10-13', '2015-10-14', '2015-10-15', '2015-10-16', '2015-10-19', '2015-10-20', '2015-10-21', '2015-10-22', '2015-10-23', '2015-10-26', '2015-10-27', '2015-10-28', '2015-10-29', '2015-10-30', '2015-11-02', '2015-11-03', '2015-11-04', '2015-11-05', '2015-11-06', '2015-11-09', '2015-11-10', '2015-11-11', '2015-11-12', '2015-11-13', '2015-11-16', '2015-11-17', '2015-11-18', '2015-11-19', '2015-11-20', '2015-11-23', '2015-11-24', '2015-11-25', '2015-11-26', '2015-11-27', '2015-11-30', '2015-12-01', '2015-12-02', '2015-12-03', '2015-12-04', '2015-12-07', '2015-12-08', '2015-12-09', '2015-12-10', '2015-12-11', '2015-12-14', '2015-12-15', '2015-12-16', '2015-12-17', '2015-12-18', '2015-12-21', '2015-12-22', '2015-12-23', '2015-12-24', '2015-12-25', '2015-12-28', '2015-12-29', '2015-12-30', '2015-12-31', '2016-01-04', '2016-01-05', '2016-01-06', '2016-01-07', '2016-01-08', '2016-01-11', '2016-01-12', '2016-01-13', '2016-01-14', '2016-01-15', '2016-01-18', '2016-01-19', '2016-01-20', '2016-01-21', '2016-01-22', '2016-01-25', '2016-01-26', '2016-01-27', '2016-01-28', '2016-01-29', '2016-02-01', '2016-02-02', '2016-02-03', '2016-02-04', '2016-02-05', '2016-02-15', '2016-02-16', '2016-02-17', '2016-02-18', '2016-02-19', '2016-02-22', '2016-02-23', '2016-02-24', '2016-02-25', '2016-02-26', '2016-02-29', '2016-03-01', '2016-03-02', '2016-03-03', '2016-03-04', '2016-03-07', '2016-03-08', '2016-03-09', '2016-03-10', '2016-03-11', '2016-03-14', '2016-03-15', '2016-03-16', '2016-03-17', '2016-03-18', '2016-03-21', '2016-03-22', '2016-03-23', '2016-03-24', '2016-03-25', '2016-03-28', '2016-03-29', '2016-03-30', '2016-03-31', '2016-04-01', '2016-04-05', '2016-04-06', '2016-04-07', '2016-04-08', '2016-04-11', '2016-04-12', '2016-04-13', '2016-04-14', '2016-04-15', '2016-04-18', '2016-04-19', '2016-04-20', '2016-04-21', '2016-04-22', '2016-04-25', '2016-04-26', '2016-04-27', '2016-04-28', '2016-04-29', '2016-05-03', '2016-05-04', '2016-05-05', '2016-05-06', '2016-05-09', '2016-05-10', '2016-05-11', '2016-05-12', '2016-05-13', '2016-05-16', '2016-05-17', '2016-05-18', '2016-05-19', '2016-05-20', '2016-05-23', '2016-05-24', '2016-05-25', '2016-05-26', '2016-05-27', '2016-05-30', '2016-05-31', '2016-06-01', '2016-06-02', '2016-06-03', '2016-06-06', '2016-06-07', '2016-06-08', '2016-06-13', '2016-06-14', '2016-06-15', '2016-06-16', '2016-06-17', '2016-06-20', '2016-06-21', '2016-06-22', '2016-06-23', '2016-06-24', '2016-06-27', '2016-06-28', '2016-06-29', '2016-06-30', '2016-07-01', '2016-07-04', '2016-07-05', '2016-07-06', '2016-07-07', '2016-07-08', '2016-07-11', '2016-07-12', '2016-07-13', '2016-07-14', '2016-07-15', '2016-07-18', '2016-07-19', '2016-07-20', '2016-07-21', '2016-07-22', '2016-07-25', '2016-07-26', '2016-07-27', '2016-07-28', '2016-07-29', '2016-08-01', '2016-08-02', '2016-08-03', '2016-08-04', '2016-08-05', '2016-08-08', '2016-08-09', '2016-08-10', '2016-08-11', '2016-08-12', '2016-08-15', '2016-08-16', '2016-08-17', '2016-08-18', '2016-08-19', '2016-08-22', '2016-08-23', '2016-08-24', '2016-08-25', '2016-08-26', '2016-08-29', '2016-08-30', '2016-08-31', '2016-09-01', '2016-09-02', '2016-09-05', '2016-09-06', '2016-09-07', '2016-09-08', '2016-09-09', '2016-09-12', '2016-09-13', '2016-09-14', '2016-09-19', '2016-09-20', '2016-09-21', '2016-09-22', '2016-09-23', '2016-09-26', '2016-09-27', '2016-09-28', '2016-09-29', '2016-09-30', '2016-10-10', '2016-10-11', '2016-10-12', '2016-10-13', '2016-10-14', '2016-10-17', '2016-10-18', '2016-10-19', '2016-10-20', '2016-10-21', '2016-10-24', '2016-10-25', '2016-10-26', '2016-10-27', '2016-10-28', '2016-10-31', '2016-11-01', '2016-11-02', '2016-11-03', '2016-11-04', '2016-11-07', '2016-11-08', '2016-11-09', '2016-11-10', '2016-11-11', '2016-11-14', '2016-11-15', '2016-11-16', '2016-11-17', '2016-11-18', '2016-11-21', '2016-11-22', '2016-11-23', '2016-11-24', '2016-11-25', '2016-11-28', '2016-11-29', '2016-11-30', '2016-12-01', '2016-12-02', '2016-12-05', '2016-12-06', '2016-12-07', '2016-12-08', '2016-12-09', '2016-12-12', '2016-12-13', '2016-12-14', '2016-12-15', '2016-12-16', '2016-12-19', '2016-12-20', '2016-12-21', '2016-12-22', '2016-12-23', '2016-12-26', '2016-12-27', '2016-12-28', '2016-12-29', '2016-12-30', '2017-01-03', '2017-01-04', '2017-01-05', '2017-01-06', '2017-01-09', '2017-01-10', '2017-01-11', '2017-01-12', '2017-01-13', '2017-01-16', '2017-01-17', '2017-01-18', '2017-01-19', '2017-01-20', '2017-01-23', '2017-01-24', '2017-01-25', '2017-01-26', '2017-02-03', '2017-02-06', '2017-02-07', '2017-02-08', '2017-02-09', '2017-02-10', '2017-02-13', '2017-02-14', '2017-02-15', '2017-02-16', '2017-02-17', '2017-02-20', '2017-02-21', '2017-02-22', '2017-02-23', '2017-02-24', '2017-02-27', '2017-02-28', '2017-03-01', '2017-03-02', '2017-03-03', '2017-03-06', '2017-03-07', '2017-03-08', '2017-03-09', '2017-03-10', '2017-03-13', '2017-03-14', '2017-03-15', '2017-03-16', '2017-03-17', '2017-03-20', '2017-03-21', '2017-03-22', '2017-03-23', '2017-03-24', '2017-03-27', '2017-03-28', '2017-03-29', '2017-03-30', '2017-03-31', '2017-04-05', '2017-04-06', '2017-04-07', '2017-04-10', '2017-04-11', '2017-04-12', '2017-04-13', '2017-04-14', '2017-04-17', '2017-04-18', '2017-04-19', '2017-04-20', '2017-04-21', '2017-04-24', '2017-04-25', '2017-04-26', '2017-04-27', '2017-04-28', '2017-05-02', '2017-05-03', '2017-05-04', '2017-05-05', '2017-05-08', '2017-05-09', '2017-05-10', '2017-05-11', '2017-05-12', '2017-05-15', '2017-05-16', '2017-05-17', '2017-05-18', '2017-05-19', '2017-05-22', '2017-05-23', '2017-05-24', '2017-05-25', '2017-05-26', '2017-05-31', '2017-06-01', '2017-06-02', '2017-06-05', '2017-06-06', '2017-06-07', '2017-06-08', '2017-06-09', '2017-06-12', '2017-06-13', '2017-06-14', '2017-06-15', '2017-06-16', '2017-06-19', '2017-06-20', '2017-06-21', '2017-06-22', '2017-06-23', '2017-06-26', '2017-06-27', '2017-06-28', '2017-06-29', '2017-06-30', '2017-07-03', '2017-07-04', '2017-07-05', '2017-07-06', '2017-07-07', '2017-07-10', '2017-07-11', '2017-07-12', '2017-07-13', '2017-07-14', '2017-07-17', '2017-07-18', '2017-07-19', '2017-07-20', '2017-07-21', '2017-07-24', '2017-07-25', '2017-07-26', '2017-07-27', '2017-07-28', '2017-07-31', '2017-08-01', '2017-08-02', '2017-08-03', '2017-08-04', '2017-08-07', '2017-08-08', '2017-08-09', '2017-08-10', '2017-08-11', '2017-08-14', '2017-08-15', '2017-08-16', '2017-08-17', '2017-08-18', '2017-08-21', '2017-08-22', '2017-08-23', '2017-08-24', '2017-08-25', '2017-08-28', '2017-08-29', '2017-08-30', '2017-08-31', '2017-09-01', '2017-09-04', '2017-09-05', '2017-09-06', '2017-09-07', '2017-09-08', '2017-09-11', '2017-09-12', '2017-09-13', '2017-09-14', '2017-09-15', '2017-09-18', '2017-09-19', '2017-09-20', '2017-09-21', '2017-09-22', '2017-09-25', '2017-09-26', '2017-09-27', '2017-09-28', '2017-09-29', '2017-10-09', '2017-10-10', '2017-10-11', '2017-10-12', '2017-10-13', '2017-10-16', '2017-10-17', '2017-10-18', '2017-10-19', '2017-10-20', '2017-10-23', '2017-10-24', '2017-10-25', '2017-10-26', '2017-10-27', '2017-10-30', '2017-10-31', '2017-11-01', '2017-11-02', '2017-11-03', '2017-11-06', '2017-11-07', '2017-11-08', '2017-11-09', '2017-11-10', '2017-11-13', '2017-11-14', '2017-11-15', '2017-11-16', '2017-11-17', '2017-11-20', '2017-11-21', '2017-11-22', '2017-11-23', '2017-11-24', '2017-11-27', '2017-11-28', '2017-11-29', '2017-11-30', '2017-12-01', '2017-12-04', '2017-12-05', '2017-12-06', '2017-12-07', '2017-12-08', '2017-12-11', '2017-12-12', '2017-12-13', '2017-12-14', '2017-12-15', '2017-12-18', '2017-12-19', '2017-12-20', '2017-12-21', '2017-12-22', '2017-12-25', '2017-12-26', '2017-12-27', '2017-12-28', '2017-12-29', '2018-01-02', '2018-01-03', '2018-01-04', '2018-01-05', '2018-01-08', '2018-01-09', '2018-01-10', '2018-01-11', '2018-01-12', '2018-01-15', '2018-01-16', '2018-01-17', '2018-01-18', '2018-01-19', '2018-01-22', '2018-01-23', '2018-01-24', '2018-01-25', '2018-01-26', '2018-01-29', '2018-01-30', '2018-01-31', '2018-02-01', '2018-02-02', '2018-02-05', '2018-02-06', '2018-02-07', '2018-02-08', '2018-02-09', '2018-02-12', '2018-02-13', '2018-02-14', '2018-02-22', '2018-02-23', '2018-02-26', '2018-02-27', '2018-02-28', '2018-03-01', '2018-03-02', '2018-03-05', '2018-03-06', '2018-03-07', '2018-03-08', '2018-03-09', '2018-03-12', '2018-03-13', '2018-03-14', '2018-03-15', '2018-03-16', '2018-03-19', '2018-03-20', '2018-03-21', '2018-03-22', '2018-03-23', '2018-03-26', '2018-03-27', '2018-03-28', '2018-03-29', '2018-03-30', '2018-04-02', '2018-04-03', '2018-04-04', '2018-04-09', '2018-04-10', '2018-04-11', '2018-04-12', '2018-04-13', '2018-04-16', '2018-04-17', '2018-04-18', '2018-04-19', '2018-04-20', '2018-04-23', '2018-04-24', '2018-04-25', '2018-04-26', '2018-04-27', '2018-05-02', '2018-05-03', '2018-05-04', '2018-05-07', '2018-05-08', '2018-05-09', '2018-05-10', '2018-05-11', '2018-05-14', '2018-05-15', '2018-05-16', '2018-05-17', '2018-05-18', '2018-05-21', '2018-05-22', '2018-05-23', '2018-05-24', '2018-05-25', '2018-05-28', '2018-05-29', '2018-05-30', '2018-05-31', '2018-06-01', '2018-06-04', '2018-06-05', '2018-06-06', '2018-06-07', '2018-06-08', '2018-06-11', '2018-06-12', '2018-06-13', '2018-06-14', '2018-06-15', '2018-06-19', '2018-06-20', '2018-06-21', '2018-06-22', '2018-06-25', '2018-06-26', '2018-06-27', '2018-06-28', '2018-06-29', '2018-07-02', '2018-07-03', '2018-07-04', '2018-07-05', '2018-07-06', '2018-07-09', '2018-07-10', '2018-07-11', '2018-07-12', '2018-07-13', '2018-07-16', '2018-07-17', '2018-07-18', '2018-07-19', '2018-07-20', '2018-07-23', '2018-07-24', '2018-07-25', '2018-07-26', '2018-07-27', '2018-07-30', '2018-07-31', '2018-08-01', '2018-08-02', '2018-08-03', '2018-08-06', '2018-08-07', '2018-08-08', '2018-08-09', '2018-08-10', '2018-08-13', '2018-08-14', '2018-08-15', '2018-08-16', '2018-08-17', '2018-08-20', '2018-08-21', '2018-08-22', '2018-08-23', '2018-08-24', '2018-08-27', '2018-08-28', '2018-08-29', '2018-08-30', '2018-08-31', '2018-09-03', '2018-09-04', '2018-09-05', '2018-09-06', '2018-09-07', '2018-09-10', '2018-09-11', '2018-09-12', '2018-09-13', '2018-09-14', '2018-09-17', '2018-09-18', '2018-09-19', '2018-09-20', '2018-09-21', '2018-09-25', '2018-09-26', '2018-09-27', '2018-09-28', '2018-10-08', '2018-10-09', '2018-10-10', '2018-10-11', '2018-10-12', '2018-10-15', '2018-10-16', '2018-10-17', '2018-10-18', '2018-10-19', '2018-10-22', '2018-10-23', '2018-10-24', '2018-10-25', '2018-10-26', '2018-10-29', '2018-10-30', '2018-10-31', '2018-11-01', '2018-11-02', '2018-11-05', '2018-11-06', '2018-11-07', '2018-11-08', '2018-11-09', '2018-11-12', '2018-11-13', '2018-11-14', '2018-11-15', '2018-11-16', '2018-11-19', '2018-11-20', '2018-11-21', '2018-11-22', '2018-11-23', '2018-11-26', '2018-11-27', '2018-11-28', '2018-11-29', '2018-11-30', '2018-12-03', '2018-12-04', '2018-12-05', '2018-12-06', '2018-12-07', '2018-12-10', '2018-12-11', '2018-12-12', '2018-12-13', '2018-12-14', '2018-12-17', '2018-12-18', '2018-12-19', '2018-12-20', '2018-12-21', '2018-12-24', '2018-12-25', '2018-12-26', '2018-12-27', '2018-12-28', '2018-12-31'], towards=-1)[source]
+

获取真实的交易日期,其中,第三个参数towards是表示向前/向后推 +towards=1 日期向后迭代 +towards=-1 日期向前迭代 +@ yutiansut

+
+ +
+
+QUANTAXIS.QAUtil.QADate_trade.QA_util_get_real_datelist(start, end)[source]
+

取数据的真实区间,返回的时候用 start,end=QA_util_get_real_datelist +@yutiansut +2017/8/10

+

当start end中间没有交易日 返回None, None +@yutiansut/ 2017-12-19

+
+ +
+
+QUANTAXIS.QAUtil.QADate_trade.QA_util_get_trade_gap(start, end)[source]
+

返回start_day到end_day中间有多少个交易天 算首尾

+
+ +
+
+QUANTAXIS.QAUtil.QADate_trade.QA_util_get_trade_range(start, end)[source]
+

给出交易具体时间

+
+ +
+
+QUANTAXIS.QAUtil.QADate_trade.QA_util_if_trade(day)[source]
+

日期是否交易

+
+ +
+
+QUANTAXIS.QAUtil.QADate_trade.QA_util_if_tradetime(_time, market='stock_cn', code=None)[source]
+

时间是否交易

+
+ +
+
+

QUANTAXIS.QAUtil.QADict module

+
+
+QUANTAXIS.QAUtil.QADict.QA_util_dict_remove_key(dicts, key)[source]
+

输入一个dict 返回删除后的

+
+ +
+
+

QUANTAXIS.QAUtil.QAList module

+
+
+QUANTAXIS.QAUtil.QAList.QA_util_diff_list(datastruct)[source]
+
+ +
+
+QUANTAXIS.QAUtil.QAList.QA_util_multi_demension_list(row_, col_=0)[source]
+

如果需要创建一个[[],[]], 那就用 row_=2,col=0 +其他时候,返回的都是[[None]]

+
+ +
+
+

QUANTAXIS.QAUtil.QALocalize module

+
+
+

QUANTAXIS.QAUtil.QALogs module

+

QUANTAXIS Log Module +@yutiansut

+

QA_util_log_x is under [QAStandard#0.0.2@602-x] Protocol +QA_util_log_info() +QA_util_log_debug() +QA_util_log_expection()

+
+
+QUANTAXIS.QAUtil.QALogs.QA_util_log_debug(logs)[source]
+

QUANTAXIS Log Module +@yutiansut

+

QA_util_log_x is under [QAStandard#0.0.2@602-x] Protocol

+
+ +
+
+QUANTAXIS.QAUtil.QALogs.QA_util_log_expection(logs)[source]
+

QUANTAXIS Log Module +@yutiansut

+

QA_util_log_x is under [QAStandard#0.0.2@602-x] Protocol

+
+ +
+
+QUANTAXIS.QAUtil.QALogs.QA_util_log_info(logs)[source]
+

QUANTAXIS Log Module +@yutiansut

+

QA_util_log_x is under [QAStandard#0.0.2@602-x] Protocol

+
+ +
+
+

QUANTAXIS.QAUtil.QAMail module

+
+
+QUANTAXIS.QAUtil.QAMail.QA_util_send_mail(msg, title, from_user, from_password, to_addr, smtp)[source]
+

邮件发送

+
+
Arguments:
+
msg {[type]} -- [description] +title {[type]} -- [description] +from_user {[type]} -- [description] +from_password {[type]} -- [description] +to_addr {[type]} -- [description] +smtp {[type]} -- [description]
+
+
+ +
+
+

QUANTAXIS.QAUtil.QAMongo module

+
+
+QUANTAXIS.QAUtil.QAMongo.QA_util_mongo_infos(db=Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'))[source]
+
+ +
+
+QUANTAXIS.QAUtil.QAMongo.QA_util_mongo_initial(db=Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'))[source]
+
+ +
+
+QUANTAXIS.QAUtil.QAMongo.QA_util_mongo_status(db=Database(MongoClient(host=['127.0.0.1:27017'], document_class=dict, tz_aware=False, connect=True), 'quantaxis'))[source]
+
+ +
+
+

QUANTAXIS.QAUtil.QAParameter module

+

这里定义的是一些常用常量

+
+
+class QUANTAXIS.QAUtil.QAParameter.ACCOUNT_EVENT[source]
+

Bases: object

+

账户事件

+
+
+MAKE_ORDER = 'account_make_order'
+
+ +
+
+SETTLE = 'account_settle'
+
+ +
+
+UPDATE = 'account_update'
+
+ +
+ +
+
+class QUANTAXIS.QAUtil.QAParameter.AMOUNT_MODEL[source]
+

Bases: object

+

订单的成交量

+

by_price是按固定成交总额下单,动态计算成交量 +by_amount 按固定成家量下单

+
+
+BY_AMOUNT = 'by_amount'
+
+ +
+
+BY_PRICE = 'by_price'
+
+ +
+ +
+
+class QUANTAXIS.QAUtil.QAParameter.BROKER_EVENT[source]
+

Bases: object

+

BROKER事件 +BROKER +有加载数据的任务 load data +撮合成交的任务 broker_trade

+
+
+DAILY_SETTLE = 'broker_dailysettle'
+
+ +
+
+LOAD_DATA = 'load_data'
+
+ +
+
+RECEIVE_ORDER = 'receive_order'
+
+ +
+
+SETTLE = 'broker_settle'
+
+ +
+
+TRADE = 'broker_trade'
+
+ +
+ +
+
+class QUANTAXIS.QAUtil.QAParameter.BROKER_TYPE[source]
+

Bases: object

+

执行环境

+

回测 +模拟 +实盘 +随机(按算法/分布随机生成行情)/仅用于训练测试

+
+
+BACKETEST = 'backtest'
+
+ +
+
+RANODM = 'random'
+
+ +
+
+REAL = 'real'
+
+ +
+
+SIMULATION = 'simulation'
+
+ +
+ +
+
+class QUANTAXIS.QAUtil.QAParameter.CURRENCY_TYPE[source]
+

Bases: object

+

货币种类

+
+
+AUD = 'aud'
+
+ +
+
+BTC = 'btc'
+
+ +
+
+CAD = 'cad'
+
+ +
+
+EUR = 'eur'
+
+ +
+
+GBP = 'GBP'
+
+ +
+
+HKD = 'hkd'
+
+ +
+
+JPY = 'jpy'
+
+ +
+
+RMB = 'rmb'
+
+ +
+
+USD = 'usd'
+
+ +
+ +
+
+class QUANTAXIS.QAUtil.QAParameter.DATASOURCE[source]
+

Bases: object

+

数据来源

+
+
+CCXT = 'ccxt'
+
+ +
+
+CHOICE = 'choice'
+
+ +
+
+EASTMONEY = 'eastmoney'
+
+ +
+
+LOCALFILE = 'localfile'
+
+ +
+
+MONGO = 'mongo'
+
+ +
+
+TDB = 'tdb'
+
+ +
+
+TDX = 'tdx'
+
+ +
+
+THS = 'ths'
+
+ +
+
+TUSHARE = 'tushare'
+
+ +
+
+WIND = 'wind'
+
+ +
+ +
+
+class QUANTAXIS.QAUtil.QAParameter.ENGINE_EVENT[source]
+

Bases: object

+

引擎事件

+
+
+BAR_SETTLE = 'bar_settle'
+
+ +
+
+DAILY_SETTLE = 'daily_settle'
+
+ +
+
+MARKET_INIT = 'market_init'
+
+ +
+
+UPCOMING_DATA = 'upcoming_data'
+
+ +
+
+UPDATE = 'update'
+
+ +
+ +
+
+class QUANTAXIS.QAUtil.QAParameter.EVENT_TYPE[source]
+

Bases: object

+
+
+ACCOUNT_EVENT = 'account_event'
+
+ +
+
+BROKER_EVENT = 'broker_event'
+
+ +
+
+ENGINE_EVENT = 'engine_event'
+
+ +
+
+MARKET_EVENT = 'market_event'
+
+ +
+
+ORDER_EVENT = 'order_event'
+
+ +
+
+TRADE_EVENT = 'trade_event'
+
+ +
+ +
+
+class QUANTAXIS.QAUtil.QAParameter.FREQUENCE[source]
+

Bases: object

+

查询的级别

+

[description]

+
+
+CURRENT = 'current'
+
+ +
+
+DAY = 'day'
+
+ +
+
+FIFTEEN_MIN = '15min'
+
+ +
+
+FIVE_MIN = '5min'
+
+ +
+
+HOUR = '60min'
+
+ +
+
+MONTH = 'month'
+
+ +
+
+ONE_MIN = '1min'
+
+ +
+
+QUARTER = 'quarter'
+
+ +
+
+SIXTY_MIN = '60min'
+
+ +
+
+THIRTY_MIN = '30min'
+
+ +
+
+TICK = 'tick'
+
+ +
+
+WEEK = 'week'
+
+ +
+
+YEAR = 'year'
+
+ +
+ +
+
+class QUANTAXIS.QAUtil.QAParameter.MARKET_ERROR[source]
+

Bases: object

+
+
+ACCOUNT_EXIST = 'Account has already exist'
+
+ +
+ +
+
+class QUANTAXIS.QAUtil.QAParameter.MARKET_EVENT[source]
+

Bases: object

+

交易前置事件

+
+
+QUERY_ACCOUNT = 'query_account'
+
+ +
+
+QUERY_ASSETS = 'query_assets'
+
+ +
+
+QUERY_CASH = 'query_cash'
+
+ +
+
+QUERY_DATA = 'query_data'
+
+ +
+
+QUERY_ORDER = 'query_order'
+
+ +
+ +
+
+class QUANTAXIS.QAUtil.QAParameter.MARKET_TYPE[source]
+

Bases: object

+

市场种类

+

日线 尾数01 +分钟线 尾数02 +tick 尾数03

+

市场: +股票 0 +指数/基金 1 +期货 2 +港股 3 +美股 4 +比特币/加密货币市场 5

+
+
+BOND_CN = 'bond_cn'
+
+ +
+
+CRYPTOCURRENCY = 'cryptocurrency'
+
+ +
+
+FUND_CN = 'fund_cn'
+
+ +
+
+FUTURE_CN = 'future_cn'
+
+ +
+
+INDEX_CN = 'index_cn'
+
+ +
+
+OPTION_CN = 'option_cn'
+
+ +
+
+STOCKOPTION_CN = 'stockoption_cn'
+
+ +
+
+STOCK_CN = 'stock_cn'
+
+ +
+
+STOCK_HK = 'stock_hk'
+
+ +
+
+STOCK_US = 'stock_us'
+
+ +
+ +
+
+class QUANTAXIS.QAUtil.QAParameter.ORDER_DIRECTION[source]
+

Bases: object

+

订单的买卖方向

+

BUY 股票 买入 +SELL 股票 卖出 +BUY_OPEN 期货 多开 +BUY_CLOSE 期货 空平(多头平旧仓) +SELL_OPEN 期货 空开 +SELL_CLOSE 期货 多平(空头平旧仓)

+
+
+BUY = 1
+
+ +
+
+BUY_CLOSE = 1
+
+ +
+
+BUY_OPEN = 1
+
+ +
+
+SELL = -1
+
+ +
+
+SELL_CLOSE = -1
+
+ +
+
+SELL_OPEN = -1
+
+ +
+ +
+
+class QUANTAXIS.QAUtil.QAParameter.ORDER_EVENT[source]
+

Bases: object

+

订单事件

+

创建订单 create +交易 trade +撤单 cancel

+
+
+CANCEL = 'cancel'
+
+ +
+
+CREATE = 'create'
+
+ +
+
+TRADE = 'trade'
+
+ +
+ +
+
+class QUANTAXIS.QAUtil.QAParameter.ORDER_MODEL[source]
+

Bases: object

+

订单的成交模式

+

LIMIT 限价模式 +MARKET 市价单 # 目前市价单在回测中是bar的开盘价 /实盘里面是五档剩余最优成交价 +CLOSE 收盘单 # 及在bar的收盘时的价格 +NEXT_OPEN 下一个bar的开盘价成交 +STRICT 严格订单 不推荐/仅限回测/是在当前bar的最高价买入/当前bar的最低价卖出

+

@yutiansut/2017-12-18

+
+
+CLOSE = 'close'
+
+ +
+
+LIMIT = 'limit'
+
+ +
+
+MARKET = 'market'
+
+ +
+
+NEXT_OPEN = 'next_open'
+
+ +
+
+STRICT = 'strict'
+
+ +
+ +
+
+class QUANTAXIS.QAUtil.QAParameter.ORDER_STATUS[source]
+

Bases: object

+

订单状态

+

status1xx 订单待生成 +status3xx 初始化订单 临时扣除资产(可用现金/可卖股份) +status3xx 订单存活(等待交易) +status2xx 订单完全交易/未完全交易 +status4xx 主动撤单 +status500 订单死亡(每日结算) 恢复临时资产

+

200 委托成功,完全交易 +203 委托成功,未完全成功 +300 刚创建订单的时候 +400 已撤单 +500 服务器撤单/每日结算

+

订单生成(100) -- 进入待成交队列(300) -- 完全成交(200) -- 每日结算(500)-- 死亡 +订单生成(100) -- 进入待成交队列(300) -- 部分成交(203) -- 未成交(300) -- 每日结算(500) -- 死亡 +订单生成(100) -- 进入待成交队列(300) -- 主动撤单(400) -- 每日结算(500) -- 死亡

+
+
+CANCEL_ALL = 400
+
+ +
+
+NEW = 100
+
+ +
+
+QUEUED = 300
+
+ +
+
+SETTLED = 500
+
+ +
+
+SUCCESS_ALL = 200
+
+ +
+
+SUCCESS_PART = 203
+
+ +
+ +
+
+class QUANTAXIS.QAUtil.QAParameter.OUTPUT_FORMAT[source]
+

Bases: object

+

输出格式

+
+
+DATAFRAME = 'dataframe'
+
+ +
+
+DATASTRUCT = 'datastruct'
+
+ +
+
+JSON = 'json'
+
+ +
+
+LIST = 'list'
+
+ +
+
+NDARRAY = 'ndarray'
+
+ +
+
+SERIES = 'series'
+
+ +
+ +
+
+class QUANTAXIS.QAUtil.QAParameter.RUNNING_ENVIRONMENT[source]
+

Bases: object

+

执行环境

+

回测 +模拟 +实盘 +随机(按算法/分布随机生成行情)/仅用于训练测试

+
+
+BACKETEST = 'backtest'
+
+ +
+
+RANODM = 'random'
+
+ +
+
+REAL = 'real'
+
+ +
+
+SIMULATION = 'simulation'
+
+ +
+ +
+
+class QUANTAXIS.QAUtil.QAParameter.TRADE_STATUS[source]
+

Bases: object

+

交易状态返回值

+

涨跌停限制: 202 +成功交易 : 200 +当天无交易数据: 500 +订单失败(比如买卖价格超过涨跌停价格范围,交易量过大等等):400

+
+
+FAILED = 400
+
+ +
+
+NO_MARKET_DATA = 500
+
+ +
+
+PRICE_LIMIT = 202
+
+ +
+
+SUCCESS = 200
+
+ +
+ +
+
+

QUANTAXIS.QAUtil.QAPlot module

+
+
+QUANTAXIS.QAUtil.QAPlot.QA_plot_save_html(pic_handle, path, if_open_web)[source]
+
+ +
+
+QUANTAXIS.QAUtil.QAPlot.plot_datastruct(_quotation_base, code=None)[source]
+
+ +
+
+

QUANTAXIS.QAUtil.QARandom module

+
+
+QUANTAXIS.QAUtil.QARandom.QA_util_random_with_topic(topic='Acc', lens=8)[source]
+

生成account随机值

+

Acc+4数字id+4位大小写随机

+
+ +
+
+

QUANTAXIS.QAUtil.QASetting module

+
+
+class QUANTAXIS.QAUtil.QASetting.QA_Setting(ip='127.0.0.1', port=27017)[source]
+

Bases: object

+
+
+change(ip, port)[source]
+
+ +
+
+client
+
+ +
+
+login(user_name, password)[source]
+
+ +
+ +
+
+QUANTAXIS.QAUtil.QASetting.future_ip_list = [{'ip': '112.74.214.43', 'port': 7727}, {'ip': '59.175.238.38', 'port': 7727}, {'ip': '124.74.236.94', 'port': 7721}, {'ip': '218.80.248.229', 'port': 7721}, {'ip': '124.74.236.94', 'port': 7721}, {'ip': '58.246.109.27', 'port': 7721}]
+

['121.14.110.210', '119.147.212.76', '113.105.73.86', '119.147.171.211', '119.147.164.57', '119.147.164.58', '61.49.50.180', '61.49.50.181', +'61.135.142.85', '61.135.149.181', '114.80.80.210', '222.73.49.15', '221.194.181.176']

+
+ +
+
+

QUANTAXIS.QAUtil.QASql module

+
+
+QUANTAXIS.QAUtil.QASql.QA_util_sql_async_mongo_setting(ip='127.0.0.1', port=27017)[source]
+
+ +
+
+QUANTAXIS.QAUtil.QASql.QA_util_sql_mongo_setting(ip='127.0.0.1', port=27017)[source]
+
+ +
+
+

QUANTAXIS.QAUtil.QAText module

+

这里主要是一些关于文本的代码

+

文本分词 +模糊查询 +正则匹配

+
+
+QUANTAXIS.QAUtil.QAText.split_word(input_text, cutall=False)[source]
+

使用jieba分词 将输入的语句分词

+
+ +
+
+

QUANTAXIS.QAUtil.QATransform module

+
+
+QUANTAXIS.QAUtil.QATransform.QA_util_to_json_from_list(data)[source]
+
+ +
+
+QUANTAXIS.QAUtil.QATransform.QA_util_to_json_from_numpy(data)[source]
+
+ +
+
+QUANTAXIS.QAUtil.QATransform.QA_util_to_json_from_pandas(data)[source]
+

需要对于datetime 和date 进行转换, 以免直接被变成了时间戳

+
+ +
+
+QUANTAXIS.QAUtil.QATransform.QA_util_to_list_from_numpy(data)[source]
+
+ +
+
+QUANTAXIS.QAUtil.QATransform.QA_util_to_list_from_pandas(data)[source]
+
+ +
+
+QUANTAXIS.QAUtil.QATransform.QA_util_to_pandas_from_json(data)[source]
+
+ +
+
+QUANTAXIS.QAUtil.QATransform.QA_util_to_pandas_from_list(data)[source]
+
+ +
+
+

QUANTAXIS.QAUtil.QAWeb module

+
+
+class QUANTAXIS.QAUtil.QAWeb.QA_Util_web_pool[source]
+

Bases: object

+
+
+dynamic_optimics()[source]
+
+ +
+
+hot_update()[source]
+
+ +
+
+task_queue()[source]
+
+ +
+ +
+
+QUANTAXIS.QAUtil.QAWeb.QA_util_web_ping(url)[source]
+
+ +
+
+

QUANTAXIS.QAUtil.host module

+
+
+

Module contents

+

" +yutiansut +util tool

+
+
+ + +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/source/QUANTAXIS.QAWeb.html b/_build/html/source/QUANTAXIS.QAWeb.html new file mode 100644 index 000000000..8b716a764 --- /dev/null +++ b/_build/html/source/QUANTAXIS.QAWeb.html @@ -0,0 +1,303 @@ + + + + + + + + QUANTAXIS.QAWeb package — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

QUANTAXIS.QAWeb package

+
+

Submodules

+
+
+

QUANTAXIS.QAWeb.QA_Web module

+
+
+QUANTAXIS.QAWeb.QA_Web.hello()[source]
+
+ +
+
+QUANTAXIS.QAWeb.QA_Web.main()[source]
+
+ +
+
+QUANTAXIS.QAWeb.QA_Web.query_backtest()[source]
+
+ +
+
+QUANTAXIS.QAWeb.QA_Web.query_backtest_by_()[source]
+
+ +
+
+QUANTAXIS.QAWeb.QA_Web.query_backtest_history()[source]
+
+ +
+
+QUANTAXIS.QAWeb.QA_Web.query_day_bfq(code)[source]
+
+ +
+
+QUANTAXIS.QAWeb.QA_Web.query_day_hfq(code)[source]
+
+ +
+
+QUANTAXIS.QAWeb.QA_Web.query_day_qfq(code)[source]
+
+ +
+
+QUANTAXIS.QAWeb.QA_Web.query_k(code)[source]
+
+ +
+
+QUANTAXIS.QAWeb.QA_Web.query_min_bfq(code)[source]
+
+ +
+
+QUANTAXIS.QAWeb.QA_Web.query_min_qfq(code)[source]
+
+ +
+
+QUANTAXIS.QAWeb.QA_Web.realtime()[source]
+
+ +
+
+QUANTAXIS.QAWeb.QA_Web.run_backtest()[source]
+
+ +
+
+QUANTAXIS.QAWeb.QA_Web.signin()[source]
+
+ +
+
+QUANTAXIS.QAWeb.QA_Web.signup()[source]
+
+ +
+
+QUANTAXIS.QAWeb.QA_Web.status()[source]
+
+ +
+
+QUANTAXIS.QAWeb.QA_Web.test_message(message)[source]
+
+ +
+
+

QUANTAXIS.QAWeb.chain module

+
+
+class QUANTAXIS.QAWeb.chain.Blockchain[source]
+

Bases: object

+
+
+static hash() → str[source]
+

生成块的 SHA-256 hash值 +:param block: Block

+
+ +
+
+last_block
+
+ +
+
+new_block(proof: int, previous_hash: Union[str, NoneType]) → Dict[str, Any][source]
+

生成新块 +:param proof: The proof given by the Proof of Work algorithm +:param previous_hash: Hash of previous Block +:return: New Block

+
+ +
+
+new_transaction(sender: str, recipient: str, amount: int) → int[source]
+

生成新交易信息,信息将加入到下一个待挖的区块中 +:param sender: Address of the Sender +:param recipient: Address of the Recipient +:param amount: Amount +:return: The index of the Block that will hold this transaction

+
+ +
+
+proof_of_work(last_proof: int) → int[source]
+
+
简单的工作量证明:
+
    +
  • 查找一个 p' 使得 hash(pp') 以4个0开头
  • +
  • p 是上一个块的证明, p' 是当前的证明
  • +
+
+
+
+ +
+
+register_node(address: str) → None[source]
+

Add a new node to the list of nodes +:param address: Address of node. Eg. 'http://192.168.0.5:5000'

+
+ +
+
+resolve_conflicts() → bool[source]
+

共识算法解决冲突 +使用网络中最长的链. +:return: 如果链被取代返回 True, 否则为False

+
+ +
+
+valid_chain(chain: List[Dict[str, Any]]) → bool[source]
+

Determine if a given blockchain is valid +:param chain: A blockchain +:return: True if valid, False if not

+
+ +
+
+static valid_proof(proof: int) → bool[source]
+

验证证明: 是否hash(last_proof, proof)以4个0开头 +:param last_proof: Previous Proof +:param proof: Current Proof +:return: True if correct, False if not.

+
+ +
+ +
+
+QUANTAXIS.QAWeb.chain.consensus()[source]
+
+ +
+
+QUANTAXIS.QAWeb.chain.full_chain()[source]
+
+ +
+
+QUANTAXIS.QAWeb.chain.mine()[source]
+
+ +
+
+QUANTAXIS.QAWeb.chain.new_transaction()[source]
+
+ +
+
+QUANTAXIS.QAWeb.chain.register_nodes()[source]
+
+ +
+
+

Module contents

+
+
+ + +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/source/QUANTAXIS.html b/_build/html/source/QUANTAXIS.html new file mode 100644 index 000000000..e4ce9248e --- /dev/null +++ b/_build/html/source/QUANTAXIS.html @@ -0,0 +1,272 @@ + + + + + + + + QUANTAXIS package — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

QUANTAXIS package

+
+

Subpackages

+
+ +
+
+
+

Module contents

+

QUANTAXIS

+

Quantitative Financial Strategy Framework

+

by yutiansut

+

2017/4/8

+
+
+ + +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/_build/html/source/modules.html b/_build/html/source/modules.html new file mode 100644 index 000000000..be4f6a3b1 --- /dev/null +++ b/_build/html/source/modules.html @@ -0,0 +1,250 @@ + + + + + + + + QUANTAXIS — QUANTAXIS 1.0 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

QUANTAXIS

+
+ +
+
+ + +
+
+
+ +
+
+ + + + + + + \ No newline at end of file diff --git a/conf.py b/conf.py new file mode 100644 index 000000000..0a03ec1f4 --- /dev/null +++ b/conf.py @@ -0,0 +1,196 @@ +# -*- coding: utf-8 -*- +# +# Configuration file for the Sphinx documentation builder. +# +# This file does only contain a selection of the most common options. For a +# full list see the documentation: +# http://www.sphinx-doc.org/en/stable/config + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +import os +import sys +# sys.path.insert(0, os.path.abspath('.')) + + +# -- Project information ----------------------------------------------------- +sys.path.insert(0, os.path.abspath('QUANTAXIS')) +project = 'QUANTAXIS' +copyright = '2018, yutiansut' +author = 'yutiansut' + +# The short X.Y version +version = '' +# The full version, including alpha/beta/rc tags +release = '1.0' + + +# -- General configuration --------------------------------------------------- + +# If your documentation needs a minimal Sphinx version, state it here. +# +# needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + 'sphinx.ext.autodoc', + 'sphinx.ext.intersphinx', + 'sphinx.ext.todo', + 'sphinx.ext.mathjax', + 'sphinx.ext.ifconfig', + 'sphinx.ext.viewcode', + 'sphinx.ext.githubpages', +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +# +# source_suffix = ['.rst', '.md'] +source_suffix = '.rst' + +# The master toctree document. +master_doc = 'index' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = 'python' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path . +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = 'alabaster' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +# +# html_theme_options = {} + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + +# Custom sidebar templates, must be a dictionary that maps document names +# to template names. +# +# The default sidebars (for documents that don't match any pattern) are +# defined by theme itself. Builtin themes are using these templates by +# default: ``['localtoc.html', 'relations.html', 'sourcelink.html', +# 'searchbox.html']``. +# +# html_sidebars = {} + + +# -- Options for HTMLHelp output --------------------------------------------- + +# Output file base name for HTML help builder. +htmlhelp_basename = 'QUANTAXISdoc' + + +# -- Options for LaTeX output ------------------------------------------------ + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # + # 'papersize': 'letterpaper', + + # The font size ('10pt', '11pt' or '12pt'). + # + # 'pointsize': '10pt', + + # Additional stuff for the LaTeX preamble. + # + # 'preamble': '', + + # Latex figure (float) alignment + # + # 'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + (master_doc, 'QUANTAXIS.tex', 'QUANTAXIS Documentation', + 'yutiansut', 'manual'), +] + + +# -- Options for manual page output ------------------------------------------ + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + (master_doc, 'quantaxis', 'QUANTAXIS Documentation', + [author], 1) +] + + +# -- Options for Texinfo output ---------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + (master_doc, 'QUANTAXIS', 'QUANTAXIS Documentation', + author, 'QUANTAXIS', 'One line description of project.', + 'Miscellaneous'), +] + + +# -- Options for Epub output ------------------------------------------------- + +# Bibliographic Dublin Core info. +epub_title = project +epub_author = author +epub_publisher = author +epub_copyright = copyright + +# The unique identifier of the text. This can be a ISBN number +# or the project homepage. +# +# epub_identifier = '' + +# A unique identification for the text. +# +# epub_uid = '' + +# A list of files that should not be packed into the epub file. +epub_exclude_files = ['search.html'] + + +# -- Extension configuration ------------------------------------------------- + +# -- Options for intersphinx extension --------------------------------------- + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = {'https://docs.python.org/': None} + +# -- Options for todo extension ---------------------------------------------- + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = True \ No newline at end of file diff --git a/index.rst b/index.rst new file mode 100644 index 000000000..d69aefa6d --- /dev/null +++ b/index.rst @@ -0,0 +1,20 @@ +.. QUANTAXIS documentation master file, created by + sphinx-quickstart on Mon May 7 21:02:19 2018. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to QUANTAXIS's documentation! +===================================== + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/make.bat b/make.bat new file mode 100644 index 000000000..c6c2fe859 --- /dev/null +++ b/make.bat @@ -0,0 +1,36 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=. +set BUILDDIR=_build +set SPHINXPROJ=QUANTAXIS + +if "%1" == "" goto help + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 +) + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% + +:end +popd diff --git a/source/QUANTAXIS.QAARP.rst b/source/QUANTAXIS.QAARP.rst new file mode 100644 index 000000000..58da99219 --- /dev/null +++ b/source/QUANTAXIS.QAARP.rst @@ -0,0 +1,54 @@ +QUANTAXIS.QAARP package +======================= + +Submodules +---------- + +QUANTAXIS.QAARP.QAAccount module +-------------------------------- + +.. automodule:: QUANTAXIS.QAARP.QAAccount + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAARP.QAPortfolio module +---------------------------------- + +.. automodule:: QUANTAXIS.QAARP.QAPortfolio + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAARP.QARisk module +----------------------------- + +.. automodule:: QUANTAXIS.QAARP.QARisk + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAARP.QAStrategy module +--------------------------------- + +.. automodule:: QUANTAXIS.QAARP.QAStrategy + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAARP.QAUser module +----------------------------- + +.. automodule:: QUANTAXIS.QAARP.QAUser + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: QUANTAXIS.QAARP + :members: + :undoc-members: + :show-inheritance: diff --git a/source/QUANTAXIS.QAAnalysis.rst b/source/QUANTAXIS.QAAnalysis.rst new file mode 100644 index 000000000..eede2424f --- /dev/null +++ b/source/QUANTAXIS.QAAnalysis.rst @@ -0,0 +1,62 @@ +QUANTAXIS.QAAnalysis package +============================ + +Submodules +---------- + +QUANTAXIS.QAAnalysis.QAAnalysis\_block module +--------------------------------------------- + +.. automodule:: QUANTAXIS.QAAnalysis.QAAnalysis_block + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAAnalysis.QAAnalysis\_dataframe module +------------------------------------------------- + +.. automodule:: QUANTAXIS.QAAnalysis.QAAnalysis_dataframe + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAAnalysis.QAAnalysis\_machinelearning module +------------------------------------------------------- + +.. automodule:: QUANTAXIS.QAAnalysis.QAAnalysis_machinelearning + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAAnalysis.QAAnalysis\_series module +---------------------------------------------- + +.. automodule:: QUANTAXIS.QAAnalysis.QAAnalysis_series + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAAnalysis.QAAnalysis\_tick module +-------------------------------------------- + +.. automodule:: QUANTAXIS.QAAnalysis.QAAnalysis_tick + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAAnalysis.QAAnalysis\_trade module +--------------------------------------------- + +.. automodule:: QUANTAXIS.QAAnalysis.QAAnalysis_trade + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: QUANTAXIS.QAAnalysis + :members: + :undoc-members: + :show-inheritance: diff --git a/source/QUANTAXIS.QABacktest.rst b/source/QUANTAXIS.QABacktest.rst new file mode 100644 index 000000000..adcc84e69 --- /dev/null +++ b/source/QUANTAXIS.QABacktest.rst @@ -0,0 +1,46 @@ +QUANTAXIS.QABacktest package +============================ + +Submodules +---------- + +QUANTAXIS.QABacktest.QAAnalysis module +-------------------------------------- + +.. automodule:: QUANTAXIS.QABacktest.QAAnalysis + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QABacktest.QABacktest module +-------------------------------------- + +.. automodule:: QUANTAXIS.QABacktest.QABacktest + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QABacktest.QAResult module +------------------------------------ + +.. automodule:: QUANTAXIS.QABacktest.QAResult + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QABacktest.backtest\_setting module +--------------------------------------------- + +.. automodule:: QUANTAXIS.QABacktest.backtest_setting + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: QUANTAXIS.QABacktest + :members: + :undoc-members: + :show-inheritance: diff --git a/source/QUANTAXIS.QACmd.rst b/source/QUANTAXIS.QACmd.rst new file mode 100644 index 000000000..fc5e3a217 --- /dev/null +++ b/source/QUANTAXIS.QACmd.rst @@ -0,0 +1,22 @@ +QUANTAXIS.QACmd package +======================= + +Submodules +---------- + +QUANTAXIS.QACmd.backtest module +------------------------------- + +.. automodule:: QUANTAXIS.QACmd.backtest + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: QUANTAXIS.QACmd + :members: + :undoc-members: + :show-inheritance: diff --git a/source/QUANTAXIS.QAData.proto.rst b/source/QUANTAXIS.QAData.proto.rst new file mode 100644 index 000000000..4c0e1151b --- /dev/null +++ b/source/QUANTAXIS.QAData.proto.rst @@ -0,0 +1,38 @@ +QUANTAXIS.QAData.proto package +============================== + +Submodules +---------- + +QUANTAXIS.QAData.proto.order\_pb2 module +---------------------------------------- + +.. automodule:: QUANTAXIS.QAData.proto.order_pb2 + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAData.proto.stock\_day\_pb2 module +--------------------------------------------- + +.. automodule:: QUANTAXIS.QAData.proto.stock_day_pb2 + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAData.proto.stock\_min\_pb2 module +--------------------------------------------- + +.. automodule:: QUANTAXIS.QAData.proto.stock_min_pb2 + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: QUANTAXIS.QAData.proto + :members: + :undoc-members: + :show-inheritance: diff --git a/source/QUANTAXIS.QAData.rst b/source/QUANTAXIS.QAData.rst new file mode 100644 index 000000000..7721ce6ba --- /dev/null +++ b/source/QUANTAXIS.QAData.rst @@ -0,0 +1,93 @@ +QUANTAXIS.QAData package +======================== + +Subpackages +----------- + +.. toctree:: + + QUANTAXIS.QAData.proto + +Submodules +---------- + +QUANTAXIS.QAData.QADataStruct module +------------------------------------ + +.. automodule:: QUANTAXIS.QAData.QADataStruct + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAData.base\_datastruct module +---------------------------------------- + +.. automodule:: QUANTAXIS.QAData.base_datastruct + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAData.data\_fq module +-------------------------------- + +.. automodule:: QUANTAXIS.QAData.data_fq + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAData.data\_resample module +-------------------------------------- + +.. automodule:: QUANTAXIS.QAData.data_resample + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAData.dsmethods module +--------------------------------- + +.. automodule:: QUANTAXIS.QAData.dsmethods + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAData.fundamental module +----------------------------------- + +.. automodule:: QUANTAXIS.QAData.fundamental + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAData.realtimedata module +------------------------------------ + +.. automodule:: QUANTAXIS.QAData.realtimedata + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAData.schema module +------------------------------ + +.. automodule:: QUANTAXIS.QAData.schema + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAData.serialize module +--------------------------------- + +.. automodule:: QUANTAXIS.QAData.serialize + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: QUANTAXIS.QAData + :members: + :undoc-members: + :show-inheritance: diff --git a/source/QUANTAXIS.QAEngine.rst b/source/QUANTAXIS.QAEngine.rst new file mode 100644 index 000000000..7f85c330b --- /dev/null +++ b/source/QUANTAXIS.QAEngine.rst @@ -0,0 +1,38 @@ +QUANTAXIS.QAEngine package +========================== + +Submodules +---------- + +QUANTAXIS.QAEngine.QAEvent module +--------------------------------- + +.. automodule:: QUANTAXIS.QAEngine.QAEvent + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAEngine.QATask module +-------------------------------- + +.. automodule:: QUANTAXIS.QAEngine.QATask + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAEngine.QAThreadEngine module +---------------------------------------- + +.. automodule:: QUANTAXIS.QAEngine.QAThreadEngine + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: QUANTAXIS.QAEngine + :members: + :undoc-members: + :show-inheritance: diff --git a/source/QUANTAXIS.QAFetch.rst b/source/QUANTAXIS.QAFetch.rst new file mode 100644 index 000000000..7c41e5293 --- /dev/null +++ b/source/QUANTAXIS.QAFetch.rst @@ -0,0 +1,126 @@ +QUANTAXIS.QAFetch package +========================= + +Submodules +---------- + +QUANTAXIS.QAFetch.Fetcher module +-------------------------------- + +.. automodule:: QUANTAXIS.QAFetch.Fetcher + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAFetch.QACrawler module +---------------------------------- + +.. automodule:: QUANTAXIS.QAFetch.QACrawler + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAFetch.QAEastMoney module +------------------------------------ + +.. automodule:: QUANTAXIS.QAFetch.QAEastMoney + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAFetch.QAQuery module +-------------------------------- + +.. automodule:: QUANTAXIS.QAFetch.QAQuery + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAFetch.QAQuery\_Advance module +----------------------------------------- + +.. automodule:: QUANTAXIS.QAFetch.QAQuery_Advance + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAFetch.QATdx module +------------------------------ + +.. automodule:: QUANTAXIS.QAFetch.QATdx + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAFetch.QATdx\_adv module +----------------------------------- + +.. automodule:: QUANTAXIS.QAFetch.QATdx_adv + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAFetch.QAThs module +------------------------------ + +.. automodule:: QUANTAXIS.QAFetch.QAThs + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAFetch.QATushare module +---------------------------------- + +.. automodule:: QUANTAXIS.QAFetch.QATushare + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAFetch.QAWind module +------------------------------- + +.. automodule:: QUANTAXIS.QAFetch.QAWind + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAFetch.QAfinancial module +------------------------------------ + +.. automodule:: QUANTAXIS.QAFetch.QAfinancial + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAFetch.base module +----------------------------- + +.. automodule:: QUANTAXIS.QAFetch.base + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAFetch.data\_list module +----------------------------------- + +.. automodule:: QUANTAXIS.QAFetch.data_list + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAFetch.realtime module +--------------------------------- + +.. automodule:: QUANTAXIS.QAFetch.realtime + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: QUANTAXIS.QAFetch + :members: + :undoc-members: + :show-inheritance: diff --git a/source/QUANTAXIS.QAIndicator.rst b/source/QUANTAXIS.QAIndicator.rst new file mode 100644 index 000000000..afb3be113 --- /dev/null +++ b/source/QUANTAXIS.QAIndicator.rst @@ -0,0 +1,30 @@ +QUANTAXIS.QAIndicator package +============================= + +Submodules +---------- + +QUANTAXIS.QAIndicator.base module +--------------------------------- + +.. automodule:: QUANTAXIS.QAIndicator.base + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAIndicator.indicators module +--------------------------------------- + +.. automodule:: QUANTAXIS.QAIndicator.indicators + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: QUANTAXIS.QAIndicator + :members: + :undoc-members: + :show-inheritance: diff --git a/source/QUANTAXIS.QAMarket.rst b/source/QUANTAXIS.QAMarket.rst new file mode 100644 index 000000000..5878c0e06 --- /dev/null +++ b/source/QUANTAXIS.QAMarket.rst @@ -0,0 +1,126 @@ +QUANTAXIS.QAMarket package +========================== + +Submodules +---------- + +QUANTAXIS.QAMarket.Broker\_Calender module +------------------------------------------ + +.. automodule:: QUANTAXIS.QAMarket.Broker_Calender + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAMarket.QABacktestBroker module +------------------------------------------ + +.. automodule:: QUANTAXIS.QAMarket.QABacktestBroker + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAMarket.QABroker module +---------------------------------- + +.. automodule:: QUANTAXIS.QAMarket.QABroker + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAMarket.QADealer module +---------------------------------- + +.. automodule:: QUANTAXIS.QAMarket.QADealer + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAMarket.QAMarket module +---------------------------------- + +.. automodule:: QUANTAXIS.QAMarket.QAMarket + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAMarket.QAOrder module +--------------------------------- + +.. automodule:: QUANTAXIS.QAMarket.QAOrder + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAMarket.QAOrderHandler module +---------------------------------------- + +.. automodule:: QUANTAXIS.QAMarket.QAOrderHandler + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAMarket.QARandomBroker module +---------------------------------------- + +.. automodule:: QUANTAXIS.QAMarket.QARandomBroker + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAMarket.QARealBroker module +-------------------------------------- + +.. automodule:: QUANTAXIS.QAMarket.QARealBroker + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAMarket.QASimulatedBroker module +------------------------------------------- + +.. automodule:: QUANTAXIS.QAMarket.QASimulatedBroker + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAMarket.QATrade module +--------------------------------- + +.. automodule:: QUANTAXIS.QAMarket.QATrade + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAMarket.shipaneBroker module +--------------------------------------- + +.. automodule:: QUANTAXIS.QAMarket.shipaneBroker + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAMarket.shipaneclient module +--------------------------------------- + +.. automodule:: QUANTAXIS.QAMarket.shipaneclient + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAMarket.tdxRealBroker module +--------------------------------------- + +.. automodule:: QUANTAXIS.QAMarket.tdxRealBroker + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: QUANTAXIS.QAMarket + :members: + :undoc-members: + :show-inheritance: diff --git a/source/QUANTAXIS.QASU.rst b/source/QUANTAXIS.QASU.rst new file mode 100644 index 000000000..5693f90fc --- /dev/null +++ b/source/QUANTAXIS.QASU.rst @@ -0,0 +1,78 @@ +QUANTAXIS.QASU package +====================== + +Submodules +---------- + +QUANTAXIS.QASU.main module +-------------------------- + +.. automodule:: QUANTAXIS.QASU.main + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QASU.save\_account module +----------------------------------- + +.. automodule:: QUANTAXIS.QASU.save_account + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QASU.save\_backtest module +------------------------------------ + +.. automodule:: QUANTAXIS.QASU.save_backtest + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QASU.save\_local module +--------------------------------- + +.. automodule:: QUANTAXIS.QASU.save_local + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QASU.save\_tdx module +------------------------------- + +.. automodule:: QUANTAXIS.QASU.save_tdx + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QASU.save\_tdx\_file module +------------------------------------- + +.. automodule:: QUANTAXIS.QASU.save_tdx_file + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QASU.save\_tushare module +----------------------------------- + +.. automodule:: QUANTAXIS.QASU.save_tushare + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QASU.user module +-------------------------- + +.. automodule:: QUANTAXIS.QASU.user + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: QUANTAXIS.QASU + :members: + :undoc-members: + :show-inheritance: diff --git a/source/QUANTAXIS.QAUtil.rst b/source/QUANTAXIS.QAUtil.rst new file mode 100644 index 000000000..0625c15d6 --- /dev/null +++ b/source/QUANTAXIS.QAUtil.rst @@ -0,0 +1,190 @@ +QUANTAXIS.QAUtil package +======================== + +Submodules +---------- + +QUANTAXIS.QAUtil.QAAuth module +------------------------------ + +.. automodule:: QUANTAXIS.QAUtil.QAAuth + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QABar module +----------------------------- + +.. automodule:: QUANTAXIS.QAUtil.QABar + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QACfg module +----------------------------- + +.. automodule:: QUANTAXIS.QAUtil.QACfg + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QACode module +------------------------------ + +.. automodule:: QUANTAXIS.QAUtil.QACode + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QACsv module +----------------------------- + +.. automodule:: QUANTAXIS.QAUtil.QACsv + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QADate module +------------------------------ + +.. automodule:: QUANTAXIS.QAUtil.QADate + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QADate\_trade module +------------------------------------- + +.. automodule:: QUANTAXIS.QAUtil.QADate_trade + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QADict module +------------------------------ + +.. automodule:: QUANTAXIS.QAUtil.QADict + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QAList module +------------------------------ + +.. automodule:: QUANTAXIS.QAUtil.QAList + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QALocalize module +---------------------------------- + +.. automodule:: QUANTAXIS.QAUtil.QALocalize + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QALogs module +------------------------------ + +.. automodule:: QUANTAXIS.QAUtil.QALogs + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QAMail module +------------------------------ + +.. automodule:: QUANTAXIS.QAUtil.QAMail + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QAMongo module +------------------------------- + +.. automodule:: QUANTAXIS.QAUtil.QAMongo + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QAParameter module +----------------------------------- + +.. automodule:: QUANTAXIS.QAUtil.QAParameter + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QAPlot module +------------------------------ + +.. automodule:: QUANTAXIS.QAUtil.QAPlot + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QARandom module +-------------------------------- + +.. automodule:: QUANTAXIS.QAUtil.QARandom + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QASetting module +--------------------------------- + +.. automodule:: QUANTAXIS.QAUtil.QASetting + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QASql module +----------------------------- + +.. automodule:: QUANTAXIS.QAUtil.QASql + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QAText module +------------------------------ + +.. automodule:: QUANTAXIS.QAUtil.QAText + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QATransform module +----------------------------------- + +.. automodule:: QUANTAXIS.QAUtil.QATransform + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.QAWeb module +----------------------------- + +.. automodule:: QUANTAXIS.QAUtil.QAWeb + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAUtil.host module +---------------------------- + +.. automodule:: QUANTAXIS.QAUtil.host + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: QUANTAXIS.QAUtil + :members: + :undoc-members: + :show-inheritance: diff --git a/source/QUANTAXIS.QAWeb.rst b/source/QUANTAXIS.QAWeb.rst new file mode 100644 index 000000000..7af3d790f --- /dev/null +++ b/source/QUANTAXIS.QAWeb.rst @@ -0,0 +1,30 @@ +QUANTAXIS.QAWeb package +======================= + +Submodules +---------- + +QUANTAXIS.QAWeb.QA\_Web module +------------------------------ + +.. automodule:: QUANTAXIS.QAWeb.QA_Web + :members: + :undoc-members: + :show-inheritance: + +QUANTAXIS.QAWeb.chain module +---------------------------- + +.. automodule:: QUANTAXIS.QAWeb.chain + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: QUANTAXIS.QAWeb + :members: + :undoc-members: + :show-inheritance: diff --git a/source/QUANTAXIS.rst b/source/QUANTAXIS.rst new file mode 100644 index 000000000..e5a40b09e --- /dev/null +++ b/source/QUANTAXIS.rst @@ -0,0 +1,28 @@ +QUANTAXIS package +================= + +Subpackages +----------- + +.. toctree:: + + QUANTAXIS.QAARP + QUANTAXIS.QAAnalysis + QUANTAXIS.QABacktest + QUANTAXIS.QACmd + QUANTAXIS.QAData + QUANTAXIS.QAEngine + QUANTAXIS.QAFetch + QUANTAXIS.QAIndicator + QUANTAXIS.QAMarket + QUANTAXIS.QASU + QUANTAXIS.QAUtil + QUANTAXIS.QAWeb + +Module contents +--------------- + +.. automodule:: QUANTAXIS + :members: + :undoc-members: + :show-inheritance: diff --git a/source/modules.rst b/source/modules.rst new file mode 100644 index 000000000..b09928062 --- /dev/null +++ b/source/modules.rst @@ -0,0 +1,7 @@ +QUANTAXIS +========= + +.. toctree:: + :maxdepth: 4 + + QUANTAXIS