시스템자가 보고크립토Pythonccxtcryptopinetrading-bottradingview

pine-bot-client

Trading bot using Pine script

시스템 구조

활용 데이터
ccxt 지원 거래소OHLCV/호가/체결 데이터
규칙 / 전략

저장소별 전략/실행 조건 확인 필요

실행

거래소 API 기반 자동 주문 실행

에디터 요약

저장소 설명과 공개 메타데이터 기준으로 Python 기반 구현, 암호화폐 거래 봇, 거래소 API/프레임워크, TradingView 웹훅 성격의 프로젝트로 파악했습니다. 확인 근거는 README, 저장소 토픽, 저장소 설명, GitHub 지표, 파이프라인 필드이며, 주요 데이터는 ccxt 지원 거래소, OHLCV/호가/체결 데이터입니다. 전략/실행 조건은 저장소별 문서와 코드 확인이 필요하며, 실행 방식은 "거래소 API 기반 자동 주문 실행"라고 보수적으로 기록했습니다. GitHub 지표는 별 201개, 포크 49개입니다.

저장소kzh-dev/pine-bot-client
제작자kzh-dev
스타 / 포크★ 201 / 49
최근 업데이트2019-03-05
스냅샷 시점2026-07-08 (아래 README는 이 시점의 사본입니다)

아래는 제3자가 작성·공개한 오픈소스 코드입니다. QuantField는 해당 코드의 동작과 안전성을 보증하지 않으며, 설치·실행 전 코드를 직접 검토하시기 바랍니다.

README

Pine Bot Client

日本語

What's this?

This is a client implementation of trading program(bot) which can use Pine script langauge used in TradingView to define a strategy.

  • (Currently) Only support crypto trading using ccxt and cryptowatch API.
  • Work with server module (which is not public)
  • Pine script is processed on server-side.
  • Client module collects price information (OHLCV) adn make an order. (API key and secret information won't be sent to server.)

Exchange/Market support

This program uses ccxt to make an order and use cryptowatch API to acquire price information to reduce the number API calls of exchange. It means you can trade any pairs at any exchanges which are supported by both modules theortically.

However the above two system often diffrent symbol name for identical market, so we need to translate it (by implementing). Your feedback and request are appreciated.

Restrictions in Pine language

(In server-side,) an original Pine runtime is implemented and used. So far it has supported subset of Pine language and here are notable restrictions.

  • Version 3 is supported
  • Not implemented builtin functions
    • security()
    • strategy.order()
    • Many others...(Your request is appreciated)
  • Syntax
    • Multiple assignment statement
  • Order
    • Limit order
    • Stop/Stop-limit order
    • Pyramiding
  • starategy.risk builtin variables

Installation

Just extract released tarball/zip file.

Here are prerequistics:

  • Python >= 3.6 (Mandaotry)
  • ccxt >= 1.17.376 (Recommendation)

How to use

1. Move to the directory made by tarball extractio.

$ cd pine-bot-client-xxxx

2. Prepare global parameter file from template.

$ mv global-parameters.json.tmpl global-parameters.json

Supported parameters are explained in different section. You set API key in this file usually.

3. Generate Pine local paramter file.

$ python pine-bot-client.py init <your Pine script>

If finished successfully, it generates <Pine script>.json file. You usually set exchange, market, time resolution and order lot with the parameters you defined by input() function in the Pine script.

4. Run

$ python pine-bot-client.py run <your Pine script>

It outputs log files under log/ directory with console output.

Other commands

In the above section, init and run commands are introduced. There are other commands, help to show usage and support command to output exchange/market support information.

Show usage

$ python pine-bot-client.py help

Show list of supported exchange

$ python pine-bot-client.py support

Supported symbols in an exchange.

$ python pine-bot-client.py support <exchange>

You can specify an identifier of supported exchange.

This is a simple output.

$ python pine-bot-client.py support bitflyer
BTC/JPY: ['BTC/JPY', 'BTCJPY', 'BTC_JPY']: True: ['1m', '3m', '5m', '15m', '30m', '1h', '2h', '4h', '6h', '12h', '1d', '3d', '1w']
FX_BTC_JPY: ['FX_BTC_JPY', 'FXBTCJPY']: True: ['1m', '3m', '5m', '15m', '30m', '1h', '2h', '4h', '6h', '12h', '1d', '3d', '1w']
ETH/BTC: ['ETH/BTC', 'ETHBTC', 'ETH_BTC']: True: ['1m', '3m', '5m', '15m', '30m', '1h', '2h', '4h', '6h', '12h', '1d', '3d', '1w']
BCH/BTC: ['BCH/BTC', 'BCHBTC', 'BCH_BTC']: True: ['1m', '3m', '5m', '15m', '30m', '1h', '2h', '4h', '6h', '12h', '1d