Code Monkey home page Code Monkey logo

master-vnpy's Introduction

master-vnpy

此Github是根據課程Python 量化交易 VNPY 大師班所建立,提供學生能夠有順序的安裝並上手 VN.PY 這個完整的交易系統,建立自己的交易環境。

VNPY platform with Shioaji

Reference

PreRequirement

Python 3.7+ or (Anaconda with Python 3.7+)

MongoDB (可依作業系統自行更換版本) : Community Cloud

Git Bash or Github Desktop

Python環境建立

VNPY 僅支援python 64bits 3.7+,先安裝好 Python(Anaconda) 虛擬環境

  1. Anaconda

    1. 安裝Anaconda

    2. 執行 Anaconda Prompt (若在安裝時有將anaconda加入環境變數,則可以直接使用cmd/terminal),建立Python 3.7 環境

      (base) C:\Users\xiqi\vnpy_demo>conda create -n vnpy_env python=3.7
    3. 切換至剛才建立好的虛擬環境

      (base) C:\Users\xiqi\vnpy_demo>conda activate vnpy_env
      (vnpy_env) C:\Users\xiqi\vnpy_demo>
  2. Native Python (會建立跟安裝版本相同的模擬環境

    1. 安裝 Python

    2. 執行 cmd/terminal (建議在安裝時勾選加入環境變數,則可以直接使用),建立Python 3.7 環境

      (base) C:\Users\xiqi\vnpy_demo>python -m venv vnpy_env
    3. 切換至剛才建立好的虛擬環境

      (base) C:\Users\xiqi\vnpy_demo>vnpy_env\Scripts\activate

安裝TA-Lib

  1. Windows

    1. 安裝 C++可轉散發套件
    2. C++安裝完成後,可直接進入VNPY安裝
    3. Python 非官方套件 (.whl)

VNPY安裝

使用此github,可以直接進行Install

  1. Install VNPY

    1. Window

       (vnpy_env) C:\Users\xiqi\vnpy_demo\vnpy>install.bat

VNPY執行

  1. For all Platform

    (vnpy_env) C:\Users\xiqi\vnpy_demo\vnpy>python examples\vn_trader\run.py
  2. Fast execution

    1. Windows

      (vnpy_env) C:\Users\xiqi\vnpy_demo\vnpy>run.bat
  3. 備註

    1. 如果遇到 numpy的 ValueError,請執行如下指令:

      pip install -U numpy
    2. 如果遇到成功執行沒有報錯,但是GUI並沒有出現的話,請執行如下指令 : Ref

      pip install -U PyQt5==5.15.2
  • 選擇Sinopac Gateway

    Gateway Selection

  • 登入

    GateWay Select

    • 模擬帳號 : PAPIUSER01~10 (已撤除,無法使用)

    • 密碼共用 : 2222

  • 選擇報價交易所

    GateWay Select

  • 訂閱即時報價 (Key完商品代碼後按Enter)

    • TSE

      GateWay Select

    • TFE

      GateWay Select

  • 查詢合約代碼 (需登入, 模擬/即時接可)

    GateWay Select

    GateWay Select

修改後的更新

  1. Windows

    (vnpy_env) C:\Users\xiqi\vnpy_demo\vnpy>update.bat

master-vnpy's People

Contributors

kevin83321 avatar xiqicpt avatar

Stargazers

 avatar  avatar David S Chase avatar  avatar Huai An Chen avatar Michael avatar Mark Song avatar Kevin Chen avatar Dean Fan avatar  avatar  avatar 首席安全官 avatar 彬 avatar nono avatar

Watchers

 avatar AlexLee avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.