Skip to main content

Funhandler

This is the general data handler for the funguana main trading bot.

TODO: Transition to a Gym-like environment.

    bars, done = env.step(action=action, selector=selection)

    process_bars(bars, dispatcher=dispatcher)

Requirements

  • pandas
  • funtime
  • funpicker
  • dask[complete]

How to install

pip install funhandler

This is the general data handler for the funguana main trading bot

Use to run through various events inside of the DB.

or use this:

fh.set_host('localhost')
fh.set_store_name('test_store_name')
fh.set_storage_model('local')
fh.set_local_storage_info(base_path='/tmp', storage_folder='parquet_data')
fh.initialize_database()
unique_data = {
    "type": "price",
    "base": "ETC",
    "trade": "BTC",
    "exchange": "binance",
    "period": "minute"
}
fh.add_bars([unique_data])
fh.load_data(**unique_data)

while fh.is_still_bars(**unique_data):
    unique_data.update({'limit': 5})
    bars = fh.get_latest_bar_v2(**unique_data)
    print(bars)

result:

➜ python manual_run.py
Register Library Type
   base     close exchange      high    ...     trade   type volumefrom  volumeto
25  ETC  0.001188  binance  0.001189    ...       BTC  price      93.40    0.1110
26  ETC  0.001187  binance  0.001188    ...       BTC  price     131.26    0.1559
27  ETC  0.001187  binance  0.001188    ...       BTC  price     192.74    0.2288
28  ETC  0.001186  binance  0.001187    ...       BTC  price     216.64    0.2570
29  ETC  0.001187  binance  0.001187    ...       BTC  price       0.00    0.0000

[5 rows x 13 columns]
   base     close exchange      high    ...     trade   type volumefrom  volumeto
20  ETC  0.001187  binance  0.001188    ...       BTC  price     366.37   0.43520
21  ETC  0.001188  binance  0.001189    ...       BTC  price     637.63   0.75680
22  ETC  0.001189  binance  0.001191    ...       BTC  price    1091.03   1.30000
23  ETC  0.001189  binance  0.001189    ...       BTC  price     137.56   0.16340
24  ETC  0.001189  binance  0.001189    ...       BTC  price      12.71   0.01511

[5 rows x 13 columns]
   base     close exchange      high    ...     trade   type volumefrom  volumeto
15  ETC  0.001187  binance  0.001188    ...       BTC  price      84.32   0.10010
16  ETC  0.001188  binance  0.001188    ...       BTC  price     137.08   0.16280
17  ETC  0.001185  binance  0.001189    ...       BTC  price      80.58   0.09568
18  ETC  0.001187  binance  0.001187    ...       BTC  price     118.99   0.14120
19  ETC  0.001187  binance  0.001188    ...       BTC  price      77.80   0.09236

[5 rows x 13 columns]
   base     close exchange      high    ...     trade   type volumefrom  volumeto
10  ETC  0.001187  binance  0.001188    ...       BTC  price     719.54    0.8544
11  ETC  0.001186  binance  0.001188    ...       BTC  price     154.78    0.1839
12  ETC  0.001188  binance  0.001188    ...       BTC  price     232.66    0.2763
13  ETC  0.001186  binance  0.001188    ...       BTC  price     100.48    0.1192
14  ETC  0.001188  binance  0.001188    ...       BTC  price     183.76    0.2181

[5 rows x 13 columns]
  base     close exchange      high    ...     trade   type volumefrom  volumeto
5  ETC  0.001186  binance  0.001187    ...       BTC  price     274.22    0.3253
6  ETC  0.001186  binance  0.001187    ...       BTC  price     636.99    0.7560
7  ETC  0.001186  binance  0.001186    ...       BTC  price      89.31    0.1059
8  ETC  0.001187  binance  0.001188    ...       BTC  price     193.95    0.2300
9  ETC  0.001188  binance  0.001188    ...       BTC  price     159.30    0.1892

[5 rows x 13 columns]
  base     close exchange      high    ...     trade   type volumefrom  volumeto
0  ETC  0.001185  binance  0.001186    ...       BTC  price     150.20   0.17800
1  ETC  0.001186  binance  0.001187    ...       BTC  price     161.09   0.19100
2  ETC  0.001186  binance  0.001187    ...       BTC  price     601.29   0.71350
3  ETC  0.001186  binance  0.001186    ...       BTC  price      38.33   0.04546
4  ETC  0.001186  binance  0.001186    ...       BTC  price     246.29   0.29210

[5 rows x 13 columns]

Session Object

Upon reading the code for funhandler. We decided that the foundation of the code was perfect for our session store. The session store is the piece of code we use with strategies to handle outside information. This includes online learning/estimation algorithms, and constant data that needs to be called upon. It has many of the same calls the normal funhandler library has.

sess = Session()
sess.set_host('localhost')
sess.set_store_name('test_store_name')
sess.set_storage_model('local')
sess.set_local_storage_info(base_path='/tmp', storage_folder='parquet_data')
sess.initialize_database()



# sess.load_bars({...})

# while fh.is_still_bars(**unique_data):
#     unique_data.update({'limit': 5})
#     bars = fh.get_latest_bar_v2(**unique_data)
#     print(bars)


# Adding state information as well

sess.add(CustomReinforcementAlgorithm())
sess.add(CustomDispatcher())
sess.add(CustomEstimatorCode())

Metadata

Release files for funhandler 0.7.3

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

Source distribution (sdist)

Source distribution for funhandler 0.7.3
File Size Uploaded Provenance
funhandler-0.7.3.tar.gz 30.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for funhandler 0.7.3
File Interpreter ABI Platform
funhandler-0.7.3-py3-none-any.whl Python 3 none any Details

Total release size: 69.6 kB

Release files / funhandler-0.7.3.tar.gz

Download URL funhandler-0.7.3.tar.gz
Size 30.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9bbaf8b78dd73f505d2e9d88a79a7fce338a08d7dd5e0e56aa7239f18537aade
BLAKE2b-256 checksum
How to use checksums
d4ccb9ef9ba14e30297d60fd0cfba992e5a7c9abca8f32cbfe9029707f55d230
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.20.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.8

Release files / funhandler-0.7.3-py3-none-any.whl

Download URL funhandler-0.7.3-py3-none-any.whl
Size 39.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a753c2cfa927a941ed9d87b9800523dba538ada505eb49227acfcf76555a8fb2
BLAKE2b-256 checksum
How to use checksums
c3b15167ba6a9b6c5de9d8cea37e4037f6f47a668e6bcc7c48f7bf1cd8acf7db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.20.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.8

Security for funhandler 0.7.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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