GithubHelp home page GithubHelp logo

stock-database's Introduction

Stock-Database

💰💰💰💰💰💰💰💰💰💰💰
202005新增台指期k線歷史資料, 含1998~20200430的分k與日k資料
💰💰💰💰💰💰💰💰💰💰💰

功能提供

報價, 下單, 回測所用的資料庫. 大部分程式run的query都已SP的方式儲存在資料庫

回測
dbo.sp_GetMDD 回傳策略最大DD
sp sp_GetActualOrderPerformance 回測用, 將order table內的order轉換成損益分析表
sp sp_FindPossibleDD 找出盤中最大未平倉dd
sp_GetMDD 返回最大MDD

報價
驗證資料須用群益超級贏家裡的技術分析資料, 元大K線使用的是後歸法, OHLC與volume都不會一致. 可自行改寫 dbo.GetTodayTick(使用前歸法)
dbo.sp_GetTicksDaily 回傳日K OHLC
dbo.sp_GetTicksIn5Min 回傳5分K OHLC
dbo.sp_GetTicksIn15Min 回傳15分K OHLC
dbo.sp_GetTicksIn30Min 回傳30分K OHLC
dbo.sp_GetTicksIn60Min 回傳60分K OHLC

其他
dbo.sp_GetNotifyOrders Line reply下單通知
dbo.sp_ChkLatest_KLine 每日開盤檢查是否日K, 分K都是最新的
dbo.ChkTick 確保Tick都是最新的
dbo.sp_GetTXSettlementDay 取得結算日
sp_ChkQuoteSourceConsistency 用於盤後比較kline的資料與tick轉換後的差異
sp_TicksConversion 盤後tick轉分k, 日k

設定步驟

將agentjob排程還原, 此script會定時將當日tick轉為分K

提供兩種模式還原

  1. bak檔還原\ 必須是SQL Server 2016版本, 目前使用版本13.0.4001.0. Bak檔已包含分K, 日K從2000年的歷史資料. 可直接執行

  2. Script檔還原
    這不包含任何台指期歷史資料, 需用報價程式導入, 或手動導入歷史資料. 群益報價僅提供約1~2個月的日K

stock-database's People

Contributors

hanyang0721 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.