Skip to main content

CandleBoy

Crypto exchange indicator application

Notes

  • Only exchange is Phemex so far, they require specific symbols for SPOT and FUTURE
  • SPOT Symbols start with s and are handled in USDT ex. sBTCUSDT
  • FUTURE Symbols are all formatted as so BTC/USD:USD
  • Can create symbols with symbol method

Installation

pip install candleboy

Usage

Instantiation

from candleboy.core import CandleBoy

# Only exchange at the moment is phemex
# Verbose shows logging
client = CandleBoy(exchange='phemex', verbose=True)

# Turn logging on/off
client.verbose()
client.silent()

# Access current exchange property
print(client.exchange)

Get a list of all available timeframes for an exchange

client.timeframes()

Retrieve Open, High, Low, Close, Volume data from exchange

  • Some exchanges may return different values
  • Retrieves 1000 candles for phemex
# Create symbol first
symbol = client.symbol(base='BTC', quote='USD', code='future') # BTC/USD:USD

timestamps, open, high, low, close, volume = client.ohlcv(symbol=symbol, tf='1m')

# Use a start at date
date = '2021-12-29' # YEAR-MONTH-DATE
timestamps, open, high, low, close, volume = client.ohlcv(symbol=symbol, tf='1m', since=date)

Get Moving Average Convergence/Divergence Indicator Values

symbol = client.symbol(base='BTC', quote='USD', code='future')
_, _, _, _, close, _ = client.ohlcv(symbol, '1m')
macd, signal, histogram = client.macd(close)

# May optionally change parameters (default is 12, 26, 9)
fastperiod = 9
slowperiod = 12
signalperiod = 3

macd, signal, histogram = client.macd(close, fastperiod, slowperiod, signalperiod)

Get Exponential Moving Average Indicator Values

symbol = client.symbol(base='BTC', quote='USD', code='future')
_, _, _, _, close, _ = client.ohlcv(symbol, '1m')
ema = client.ema(close)

# May optionally change parameters (default is 200)
timeperiod = 20

ema = client.ema(close, timeperiod)

Get Stochastic Indicator Values

symbol = client.symbol(base='BTC', quote='USD', code='future')
_, _, high, low, close, _ = client.ohlcv(symbol, '1m')
slowk, slowd = client.stoch(high, low, close)

# May optionally change parameters (default is 5, 3, 0, 3, 0)
fastk_period = 5
slowk_period = 3
slowk_matype = 0
slowd_period = 3
slowd_matype = 0

slowk, slowd = client.stoch(high, low, close, fastk_period, slowk_period, slowk_matype, slowd_period, slowd_matype)

Get ADX Indicator Values

symbol = client.symbol(base='BTC', quote='USD', code='future')
_, _, high, low, close, _ = client.ohlcv(symbol, '1m')
adx = client.adx(high, low, close)

# May optionally change parameters (default is 14)
timeperiod = 14

adx = client.stoch(high, low, close, timeperiod)

Get MESA Indicator Values

symbol = client.symbol(base='BTC', quote='USD', code='future')
_, _, _, _, close, _ = client.ohlcv(symbol, '1m')
mama, fama = client.mesa(close)

# May optionally change parameters (default is 0.5, 0.05)
fastlimit = 0.5
slowlimit = 0.05

mama, fama = client.mesa(close, fastlimit, slowlimit)

Test

  • Runs the tests on the CandleBoy module
make test

Metadata

Release files for candleboy 2.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for candleboy 2.2.2
File Size Uploaded
candleboy-2.2.2.tar.gz 6.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for candleboy 2.2.2
File Interpreter ABI Platform
candleboy-2.2.2-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 12.6 kB

Release files / candleboy-2.2.2.tar.gz

Download URL candleboy-2.2.2.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
8e2c21e19916e5b35bb3f73f46cf5a693927b4877cacb3e0c74d110a3bff00d5
BLAKE2b-256 checksum
How to use checksums
6cfd61f83f305f113d2b2f158b0fffdf530615376814b57f476165a3e4b99060
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0

Release files / candleboy-2.2.2-py2.py3-none-any.whl

Download URL candleboy-2.2.2-py2.py3-none-any.whl
Size 6.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
ed9f9ce1fa230f41e8118bde31724d42ce4fd4e75145be17b868f57f0d238b2d
BLAKE2b-256 checksum
How to use checksums
af391bc80d09faf2d9b124d708495a9273a889f1846ff0c9ad6b1f87eb3b59cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0

Release history Release notifications | RSS feed

This release

2.2.2 This release

2 release files

2.2.1

2 release files

2.1.1

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page