first, Enter the official website, open Notebook
Create your own notebook
second, Write your own trading strategy in the Code.
Https://uqer.io/help/faqApi/#account相关属性 find out how to order, get the closing price, volume, etc. in the Help document
I use the conditions to filter the time, with order () and other functions can be the Order.
note: function Handle_data () is a cyclic call made according to the daily market data system
such as the simple policy in the Help document:
Simple trading strategy: Buy all the stocks in the pool every day. Start='2014-01-01' #back Test start timeEnd ='2015-01-01' #backtesting End TimeBenchmark ='HS300' #Policy Reference StandardUniverse = ['000001.XSHE','600000.XSHG']#Securities pools, supporting stocks and fundsCapital_base = 100000#Starting CapitalFreq ='D' #policy type, ' d ' means using daily backtestingRefresh_rate = 1#The frequency of the position, indicating the time interval of the execution of the handle_data, due to Freq = ' d ', the unit of the time interval is the trading daydefInitialize (account):#initializing virtual account status PassdefHandle_data (account):#buy and sell orders per trading day forStockinchAccount.universe:order (stock,100)
third, The operation strategy can be in the Web page interactive interface to see the Results.
Python Mining automation trading