Skip to content

Commit

Permalink
edit a description and a guide
Browse files Browse the repository at this point in the history
  • Loading branch information
msaltnet committed Aug 6, 2023
1 parent b893009 commit c3728b4
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 33 deletions.
45 changes: 26 additions & 19 deletions README-en_us.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,42 @@

> It's a game to get money.
An algorithm-based cryptocurrency automatic trading system made in Python. https://smtm.msalt.net
An algorithm-based automated cryptocurrency trading system made in Python. https://smtm.msalt.net

[한국어](https://github.com/msaltnet/smtm/blob/master/README.md) 👈

[![icon_wide_gold](https://user-images.githubusercontent.com/9311990/161744914-05e3d116-0e9b-447f-a015-136e0b9ec22b.png)](https://smtm.msalt.net/)

It has a very simple routine and repeat periodically.
Performance critical approach is NOT suitable. e.g. multiple tradings in seconds. If you want, find another solution.
The basic idea is to repeat a simple process of data collection -> algorithmic analysis -> transaction at set intervals, and it's been proven to basically handle one process per minute.

1. Get data from Data Provider
2. Make a decision using Strategy
3. Execute a trading via Trader
1. The Data Provider module aggregates data
2. Make a decision using the Strategy module
3. Execute a trading via the Trader module
--- repeat ---
4. Create analyzing result by Analyzer
4. Create analyzing result by the Analyzer module

![intro](https://user-images.githubusercontent.com/9311990/140635409-93e4b678-5a6b-40b8-8e28-5c8f819aa88c.jpg)

❗ It is not suitable for high-performance trading machines that need to process many trades in a short timeframe of seconds, and should be given due consideration if processing time is a critical performance requirement.

## Features
- Simulation
- Parameterizable Simulations
- Mass-Simulation with Multi-process
- CLI mode Auto Trading
- CLI Mode Automated Trading Program
- Remote Control with Jupyter Notebook
- Telegram Message App Trading Control
- Automated trading programs controlled by Telegram

### Telegram Chat-bot Mode
User can launch the program with Telegram chat-bot mode which provide user interface via Telegram chat-bot.
The Telegram Chatbot mode allows you to control your automated trading program using the Telegram messenger.

For Telegram Chatbot mode, you need to create a chatbot, enter the API token and chat room information, and run it.

![smtm_bot](https://user-images.githubusercontent.com/9311990/150667094-95139bfb-03e0-41d5-bad9-6be05ec6c9df.png)

![telegram_chatbot](https://user-images.githubusercontent.com/9311990/150663864-c5a7ed27-f1c6-4b87-8220-e31b8ccce368.PNG)

### Simulation Mode
User can execute simulation with Simulator or MassSimulator, which run simulations using past trading records.
The simulation mode also allows you to run simulations based on historical trade data to see the results. You can run simple simulations or mass simulations.

## How to install
Install all packages using requirements.txt
Expand All @@ -58,25 +60,28 @@ pip install -r requirements-dev.txt
There are 6 mode for each features.
- 0: simulator with interative mode
- 1: execute single simulation
- 2: controller for real trading
- 2: interactive mode controller for real trading
- 3: telegram chatbot controller
- 4: mass simulation with config file
- 5: make config file for mass simulation

### Interactive mode simulator
run with only mode
Run the interactive mode simulator with the command below.

```
python -m smtm --mode 0
```

### Execute single simulation
run with mode and simulation setting parameters
Running a single simulation with the command below with the simulation parameters will return the results.

```
python -m smtm --mode 1 --budget 50000 --from_dash_to 201220.170000-201221 --term 0.1 --strategy 0 --currency BTC
```

### Run controller for trading
run with mode and initial setting parameters
Use the command below to run the default demo trading program with initial values. The demo runs in interactive mode, allowing you to start, stop, and view results based on your inputs.

```
python -m smtm --mode 2 --budget 50000 --term 60 --strategy 0 --currency ETH
```
Expand All @@ -90,7 +95,8 @@ UPBIT_OPEN_API_SERVER_URL=https://api.upbit.com
```

### Run telegram chatbot controller for trading
run with only mode
Execute the command below to run the Telegram Chatbot mode live trading program. The Telegram Chatbot mode live trading program uses the Telegram Chatbot API token and chat room information to start, stop, and view results via Telegram Chatbot messages.

```
python -m smtm --mode 3
```
Expand All @@ -109,12 +115,13 @@ python -m smtm --mode 4 --config /data/sma0_simulation.json
```

### Make config file for mass simulation
run with mode and simulation setting parameters
Run with a mass simulation configuration file. The configuration file is in JSON format and can be generated directly through a text editor or via a command.

```
python -m smtm --mode 5 --budget 50000 --title SMA_6H_week --strategy 1 --currency ETH --from_dash_to 210804.000000-210811.000000 --offset 360 --file generated_config.json
```

## Architecture
## Software Architecture
Layered architecture

| Layer | Module | Role |
Expand Down
26 changes: 12 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,17 @@
![intro](https://user-images.githubusercontent.com/9311990/140635409-93e4b678-5a6b-40b8-8e28-5c8f819aa88c.jpg)

## 주요기능
- 시뮬레이션
- 파라미터를 설정 가능한 시뮬레이션
- 멀티프로세스 대량시뮬레이션
- CLI 모드 자동 거래
- CLI 모드 자동 거래 프로그램
- JupyterNotebook을 활용한 원격컨트롤
- 텔레그램으로 컨트롤 하는 자동거래
- 텔레그램으로 컨트롤 하는 자동거래 프로그램

### 텔레그램 챗봇 모드
텔레그램 챗봇 모드를 사용하면 자동매매 프로그램을 텔레그램 메신저를 사용해서 컨트롤 할 수 있습니다.

텔레그램 챗봇 모드를 위해서는 챗봇을 만들고 API 토큰과 대화방 정보를 입력해서 구동해야 합니다.

Telegram Controller 모듈은 제공된 정보를 바탕으로 사용자와 텔레그램 메신저를 통해 입력을 받아 Operator를 컨트롤합니다.

![smtm_bot](https://user-images.githubusercontent.com/9311990/150667094-95139bfb-03e0-41d5-bad9-6be05ec6c9df.png)

![telegram_chatbot](https://user-images.githubusercontent.com/9311990/150663864-c5a7ed27-f1c6-4b87-8220-e31b8ccce368.PNG)
Expand All @@ -68,11 +66,11 @@ pip install -r requirements-dev.txt
## 사용방법
시뮬레이션, 대량 시뮬레이션, 챗봇 모드를 포함하여 아래 6개의 기능을 제공합니다.

- 0: 인터렉티브 모드로 시뮬레이터
- 1: 입려받은 설정값으로 싱글 시뮬레이션
- 2: 기본 실전 매매 프로그램
- 0: 인터렉티브 모드 시뮬레이터
- 1: 입력받은 설정값으로 싱글 시뮬레이션 실행
- 2: 인터렉티브 모드 기본 실전 매매 프로그램
- 3: 텔레그램 챗봇 모드로 실전 매매 프로그램
- 4: 컨피그 파일을 사용한 대량 시뮬레이션
- 4: 컨피그 파일을 사용한 대량 시뮬레이션 실행
- 5: 대량 시뮬레이션을 위한 컨피그 파일 생성

### 인터렉티브 모드 시뮬레이터
Expand All @@ -83,14 +81,14 @@ python -m smtm --mode 0
```

### 싱글 시뮬레이션
시뮬레이션 파라미터와 아래 명령어로 단일 시뮬레이션을 바로 실행 후 결과 반환.
시뮬레이션 파라미터와 함께 아래 명령어로 단일 시뮬레이션을 실행하면 결과를 반환합니다.

```
python -m smtm --mode 1 --budget 500000 --from_dash_to 201220.080000-201221 --term 0.001 --strategy 1 --currency BTC
```

### 기본 실전 매매 프로그램
초기값과 함께 기본 실전 매매 프로그램을 실행. 기본 실전 매매 프로그램은 인터렉티브 모드로 실행되어 입력에 따라 거래 시작, 중지, 결과 조회가 가능합니다.
아래 명령어로 초기값과 함께 기본 실전 매매 프로그램을 실행합니다. 기본 실전 매매 프로그램은 인터렉티브 모드로 실행되어 입력에 따라 거래 시작, 중지, 결과 조회가 가능합니다.

```
python -m smtm --mode 2 --budget 100000 --term 60 --strategy 0 --currency ETH
Expand All @@ -105,7 +103,7 @@ UPBIT_OPEN_API_SERVER_URL=https://api.upbit.com
```

### 텔레그램 챗봇 모드 실전 매매 프로그램
아래 명령어로 텔레그램 챗봇 모드 실전 매매 프로그램을 실행. 텔레그램 챗봇 모드 실전 매매 프로그램은 입력받은 텔레그램 챗봇 API 토큰과 대화방 정보를 사용하여 텔레그램 챗봇 메세지를 통해서 거래 시작, 중지, 결과 조회가 가능합니다.
아래 명령어로 텔레그램 챗봇 모드 실전 매매 프로그램을 실행합니다. 텔레그램 챗봇 모드 실전 매매 프로그램은 입력받은 텔레그램 챗봇 API 토큰과 대화방 정보를 사용하여 텔레그램 챗봇 메세지를 통해서 거래 시작, 중지, 결과 조회가 가능합니다.

```
python -m smtm --mode 3
Expand All @@ -119,7 +117,7 @@ TELEGRAM_CHAT_ID=123456789
```

### 대량 시뮬레이션
대량 시뮬레이션 설정 파일과 함께 실행. 설정 파일을 json 형식이며 텍스트 편집기를 통해서 직접 생성해도 되고, 명령어를 통해 생성도 가능합니다.
대량 시뮬레이션 설정 파일과 함께 실행합니다. 설정 파일을 json 형식이며 텍스트 편집기를 통해서 직접 생성해도 되고, 명령어를 통해 생성도 가능합니다.

```
python -m smtm --mode 4 --config /data/sma0_simulation.json
Expand All @@ -132,7 +130,7 @@ python -m smtm --mode 4 --config /data/sma0_simulation.json
python -m smtm --mode 5 --budget 50000 --title SMA_6H_week --strategy 1 --currency ETH --from_dash_to 210804.000000-210811.000000 --offset 360 --file generated_config.json
```

## 설계구조
## 소프트웨어 설계구조
계층화된 아키텍쳐 Layered architecture

| Layer | Module | Role |
Expand Down

0 comments on commit c3728b4

Please sign in to comment.