Python Mining automation trading

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.