pine-bot-client
Trading bot using Pine script
System Structure
저장소별 전략/실행 조건 확인 필요
거래소 API 기반 자동 주문 실행
Editor Summary저장소 설명과 공개 메타데이터 기준으로 Python 기반 구현, 암호화폐 거래 봇, 거래소 API/프레임워크, TradingView 웹훅 성격의 프로젝트로 파악했습니다. 확인 근거는 README, 저장소 토픽, 저장소 설명, GitHub 지표, 파이프라인 필드이며, 주요 데이터는 ccxt 지원 거래소, OHLCV/호가/체결 데이터입니다. 전략/실행 조건은 저장소별 문서와 코드 확인이 필요하며, 실행 방식은 "거래소 API 기반 자동 주문 실행"라고 보수적으로 기록했습니다. GitHub 지표는 별 201개, 포크 49개입니다.
| Repository | kzh-dev/pine-bot-client |
|---|---|
| Creator | kzh-dev |
| Stars / Forks | ★ 201 / 49 |
| Last Updated | 2019-03-05 |
| Snapshot Date | 2026-07-08 (README below is a copy from this date) |
This is third-party open-source code. QuantField does not guarantee its behavior or safety. Review the code before installing or running it.
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.riskbuiltin 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