Git Product home page Git Product logo

systemtrading's Introduction

Python_project_SystemTrading with Bank API

About

1. Strategy

  • Counter-trend Strategy Based On RSI
    RSI = 100 * AU / (AU+AD)
    RS = AU / AD
    RSI Signal = moving average line of RSI
    
    # Assuming mean reversion effect
    # Used RSI(2), judged based on the closing prices of the last two days for short term
    # USed RSI Signal (20 or 60) for mid-term trend
    
  • Conditions
    if RSI_Signal(20) > RSI_Signal(60) and
       RSI(2) < 5 and
       Current stock price change rate compared to two days ago < -2%:
       
       Result = Buy at the current highest bid price
    
    if RSI(2) > 80 and
       Current price > Buying Price:
    
       Result = Sell at the current best ask price
  • Universe Composition
    1. Excluding ETF, preferred stock 
    2. Excluding holding companies
    3. Selecting companies with a sales growth rate greater than 0
    4. Selecting companies with an ROE greater than 0
    5. Sorting ROE and 1/PER in descending order, 
        extracting 200 companies by calculating the average of the two ranks
    
  • Backtesting

How To Run

Development Tools:    # PyCharm 2023.2.3  # Anaconda3
Programming Language: # Python
API:                  # Kiwoom Open API+
Database:             # Mysql
Crawling:             # bs4, lxml, openpyxl, numpy

Logical Structure (initialization phase)

Logical Structure

Logical Structure (post)

Logical Structure

Continous Development

This project continues to progress and further implements the strategy.

Commit Rule

  • Do not commit from/to the main branch
  • After committing the new branch, make a pull request to the main branch
  • Branch name rule:
    • Development Dir/content (e.g. api/Kiwoom, Util/const)
  • Pull request writing rules
    • Title: What was developed
    • Content: Brief description of the developed content

Used MySQL with Python

1. 'Connecter' = pymysql.connect('connect options')
2. 'Cursor name' = 'Connecter'.cursor()
3. 'Cursor name'.execute("CREATE TABLE 'sentence'")
4. 'Cursor name'.execute("INSERT 'sentence'")
5. 'Connecter'.commit()
6. 'Connecter'.close()

systemtrading's People

Contributors

edi9root avatar shin-hh avatar

Stargazers

 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.