Git Product home page Git Product logo

smtm's Introduction

smtm

build status license language codecov

It's a game to get money.

파이썬 알고리즘기반 암호화폐 자동매매 프로그램. https://smtm.msalt.net

English 👈

icon_wide_gold

"데이터 수집🔍 ➡️ 알고리즘 분석🖥️ ➡️ 실시간 거래💸" 프로세스를 정해진 간격으로 반복 수행

  1. Data Provider 모듈이 데이터 취합
  2. Strategy 모듈을 통한 알고리즘 매매 판단
  3. Trader 모듈을 통한 거래 처리
    --- 반복 ---
  4. Analyzer 모듈을 통한 분석

❗ 초 단위의 짧은 시간에 많은 거래를 처리해야하는 고성능 트레이딩 머신으로는 적합하지 않으며 충분한 검토가 필요합니다.

smtm-procedure

주요기능

  • 멀티프로세스 대량시뮬레이션
  • Jupyter Notebook을 활용 원격컨트롤
  • 텔레그램 챗봇 자동거래 프로그램

텔레그램 메신저를 사용해서 자동매매 프로그램 컨트롤

smtm_bot

smtm-telegram-mode

Architecture

확장성과 유지보수성을 갖춘 Layered Architecture

더 자세한 내용은 👉smtm wiki

smtm component

CodeLabs for smtm

관련 도서

"암호화폐 자동매매 시스템 만들기 with 파이썬" 도서 - 교보문고 예스24 알라딘

smtm-book

더 많은 정보는 👉smtm wiki

smtm's People

Contributors

johnverkim avatar msaltnet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

smtm's Issues

utils

for you

from datetime import datetime
def convert(from_dash_to):
    count = -1
    ft = from_dash_to.split('-')
    from_dt = convert_number_to_datetime(ft[0])
    to_dt = convert_number_to_datetime(ft[1])
    print(from_dt)
    print(to_dt)
    if to_dt <= from_dt:
        return
    delta = to_dt - from_dt
    count = round(delta.total_seconds() / 60.0)
    return (convert_datetime_to_iso_format_string(to_dt), count)

convert('200220-200320')

from datetime import datetime
def convert_number_to_datetime(number_string):
    """conver number to datetime
    two number string types are supported, yymmdd and yymmdd.HHMMSS"""
    number_string = str(number_string)
    if len(number_string) == 6:
        return datetime.strptime(number_string, '%y%m%d')
    elif len(number_string) == 13:
        datetime.strptime(number_string, '%y%m%d.%H%M%S')
    else:
        raise ValueError("unsupported number string")

def convert_datetime_to_iso_format_string(datetime):
    """conver datetime iso date format string"""
    ISO_DATEFORMAT = "%Y-%m-%dT%H:%M:%S"
    return datetime.strftime(ISO_DATEFORMAT)

convert_number_to_datetime(201101)
convert_number_to_datetime(122121)
datetime.strptime("20201101", '%y%m%d')

Integrate Tester

like below

class Tester:
    MAIN_STATEMENT = "아무키나 누르면 다음으로 진행됩니다"

    def __init__(self):
        self.test_list = [
            {
                "preparation": "테스트를 준비하세요.",
                "action": self.print_help,
                "verification": "테스트 결과를 확인하세요.",
            },
            {
                "preparation": "테스트를 준비하세요.",
                "action": self.print_help,
                "verification": "테스트 결과를 확인하세요.",
            },
        ]

    def main(self):
        """main 함수"""

        for test in self.test_list:
            print(test["preparation"])
            input(self.MAIN_STATEMENT)
            test["action"]()
            print(test["verification"])

        print("tests all done")

    def print_help(self):
        print("test print help========================")

if __name__ == "__main__":
    Tester().main()
class Tester:
    MAIN_STATEMENT = "아무키나 누르면 다음으로 진행됩니다"

    def __init__(self):
        self.test_list = [
            {
                "preparation": "테스트를 준비하세요.",
                "action": self.print_help,
                "verification": "테스트 결과를 확인하세요.",
            },
            {
                "preparation": "테스트를 준비하세요.",
                "action": self.print_help,
                "verification": "테스트 결과를 확인하세요.",
            },
        ]

    def main(self):
        """main 함수"""

        for test in self.test_list:
            print(test["preparation"])
            input(self.MAIN_STATEMENT)
            test["action"]()
            print(test["verification"])

        print("tests all done")

    def print_help(self):
        print("test print help========================")

if __name__ == "__main__":
    Tester().main()

mpl plot error

UserWarning: Starting a Matplotlib GUI outside of the main thread will likely fail.

통합 테스트

통합 테스트

항상 설레는 순간

통합 테스트 방법

통합 테스트 케이스

Requirements

Functional

  1. 과거 특정시점, 특정 화폐 데이터로 시뮬레이션 할 수 있어야 한다
  2. 자동 거래 기능을 제공해야 한다
  3. 자동 거래 및 주요 설정 값을 변경 가능해야 한다
  4. 거래 내역을 실시간 확인 가능해야 한다
  5. 거래 알고리즘을 교체 할 수 있어야 한다
  6. 거래 수익 내역을 조회 할 수 있어야 한다

Non-functional

  1. 자동 거래 및 주요 설정 값을 쉽게 변경 가능해야 한다

[Feature Request] Interface of drawing points to graphs of Analyzer.

Requirements

  1. Strategy can have a interface to draw specific points to graphs for the analysis.
  2. Analyzer provide a interface to add points will be drawed in graphs.
  3. Operator provide a interface to Strategy to connect with the Analyzer interface.

Scenario

When Strategy call the interface to draw some points, Operator deliver information to Analyzer via the interface of Analyzer. When Analyzer draw a graph to make reports, some points added from Strategy will be drawed to the graph too.

단위테스트에 대해서

단위 테스트

간단하고 쉽게 프로그래밍하기 위한 첫걸음
V테스팅 모델

단위 테스트란?

신발끈을 대충 쑤셔넣고 달리는 격
코드를 테스트하는것

단위 테스트의 중요성

테스트가 요구 사항이 된다. 요구사항에 맞는 개발 습관
자연스럽게 간결한 코드가 구성된다.
모듈간의 연결 관계가 명확하고 분리가 쉽다.
수정, 확장이 용이하다.
개발자의 마음이 편하다.

단위 테스트하는 방법

예제

TODO

  • excute -> execute typo
  • request를 배열로 전달 st, tr
  • request를 순차적으로 post tr
  • request type이 cancel인 경우, cancel 호출
  • 주문 상태 추가, requested, done, callback으로 상태 리턴
  • requested result에 대해서 무시하도록 처리 az
  • requested result에 대해서 pending_requests map에 관리하도록 처리 st
  • pending_requests 가 있는 경우 취소 request 추가하기 st

헬로 파이썬

변수

조건문

반복문

리스트

딕셔너리

함수와 클래스

bug report!

dead lock issue

  • register_simulation_state_change_callback
  • call callback that stop operator in its own thread
  • controller have to have a worker

initialize bug

  • initialize all resource

simulation tag

  • report file name, graph file name
  • when initialization create simulation-tag "period-market-datetime"

PR: (feat: set poetry for managing dependencies)에 대해 양해 구합니다.

안녕하세요.
포크해온 레포에서 개인작업 중에 브랜치 Push & PR를 했는데 여기 원본 레포로 연결이되었네요.
origin이 포크해온 레포로 되어있어 문제없을 줄 알았는데 제가 깃헙작동에 이해가 부족했던것 같습니다.

제가 실수로 날리고 Close 한 PR은 무시해주셔도 될것 같습니다.

(issues에 안맞는 내용인것 같아 따로 말씀드리려했으나 다른 채널을 찾기어려워 여기남깁니다...!)

[Feature] BinanceUpbitDataProvider 구현

  • DataProvider 인터페이스 변경, 데이터에 구분자를 추가, 리스트로 전달
  • Binance, Upbit 두 데이터를 동시에 제공하는 BinanceUpbitDataProvider 구현
  • BinanceUpbitDataProvider를 사용하는 간단한 전략 추가

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.