Git Product home page Git Product logo

jpxtime3's Introduction

jpxtime3

JPX指数先物オプションの取引日や取引時間, 満期日などを管理

Installation

pip install jpxtime3

Examples

from datetime import datetime
import jpxtime3

# 取引時間中の場合は1が返る
jpxtime3.is_open(datetime(2016, 1, 5, 10, 0))
1
# 取引時間外の場合は0が返る
jpxtime3.is_open(datetime(2016, 1, 5, 8, 0))
0
# 引数を指定しない場合はデフォルトで現在時刻が入る
jpxtime3.is_open()
1
# クロージングオークションの場合は2が返る
jpxtime3.is_open(datetime(2016, 1, 5, 15, 10))
2
# 年月をタプルで指定してSQ日を取得
jpxtime3.get_sq((2016, 1))
datetime.date(2016, 1, 8)
# 年月をintで指定してSQ日を取得
jpxtime3.get_sq((201601))
datetime.date(2016, 1, 8)
# 年月をstrで指定してSQ日を取得
jpxtime3.get_sq('201601')
datetime.date(2016, 1, 8)
# 2015/12/30 9:00から2016年1月限のSQ日までの期間を取得(年換算(365日))
jpxtime3.get_t(datetime(2015, 12, 30, 9), jpxtime3.get_sq((2016, 1)))
0.024657534246575342
# 2015/12/30 9:00から2016年1月限のSQ日までの期間を営業日で取得(年換算(245日))
jpxtime3.get_t(datetime(2015, 12, 30, 9), jpxtime3.get_sq((2016, 1)), 245)
0.02040816326530612
# 取引日を取得(ナイトセッションの場合は翌営業日)
jpxtime3.get_nominal_trading_day(datetime.datetime(2019, 1, 4, 17, 0))
datetime.date(2019, 1, 7)
# 翌取引日の寄付の日時を取得
jpxtime3.get_next_opening(datetime.datetime(2019, 1, 4, 9))
datetime.datetime(2019, 1, 4, 16, 30)
# 翌取引日の大引けの日時を取得
jpxtime3.get_next_closing(datetime.datetime(2019, 1, 7, 23))
datetime.datetime(2019, 1, 9, 15, 15)
# 前取引日の寄付の日時を取得
jpxtime3.get_prev_opening(datetime.datetime(2019, 1, 7, 10))
datetime.datetime(2018, 12, 28, 16, 30)
# 前取引日の大引けの日時を取得
jpxtime3.get_prev_closing(datetime.datetime(2019, 1, 4, 10))
datetime.datetime(2018, 12, 28, 15, 15)

Command

現在時刻のjpxtime3.is_openの戻り値が返る

python -m jpxtime3
echo $?

jpxtime3's People

Contributors

drillan avatar

Stargazers

 avatar  avatar kozzy0919 avatar saru999 avatar

Watchers

James Cloos avatar kozzy0919 avatar  avatar  avatar  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.