https://github.com/iteralabs/traderman
Python SDK to build, train, stress-test, deploy and monitor trading strategies with an agentic approach
https://github.com/iteralabs/traderman
cryptocurrency pytorch trading
Last synced: 11 months ago
JSON representation
Python SDK to build, train, stress-test, deploy and monitor trading strategies with an agentic approach
- Host: GitHub
- URL: https://github.com/iteralabs/traderman
- Owner: IteraLabs
- License: mit
- Created: 2024-06-18T18:51:40.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-04T03:59:22.000Z (over 1 year ago)
- Last Synced: 2025-03-30T02:16:18.965Z (12 months ago)
- Topics: cryptocurrency, pytorch, trading
- Language: Python
- Homepage:
- Size: 107 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Roadmap: ROADMAP.md
Awesome Lists containing this project
README
# Traderman
Python SDK to build, train, stress-test, deploy and monitor trading strategies
[](https://pypi.org/project/traderman)
[](https://github.com/iteralabs/traderman/stargazers)
[](https://github.com/iteralabs/traderman/issues)
[](https://github.com/iteralabs/traderman/network/members)
[](https://www.python.org/downloads/release/python-3110/)
[](https://github.com/psf/black)
[](https://github.com/iteralabs/tradernab/blob/master/.pre-commit-config.yaml)
[](https://github.com/iteralabs/traderman/blob/master/LICENSE)
## Install
Using `pip`
```
pip install traderman
```
Cloning the repository
```
git clone https://github.com/iteralabs/traderman.git
```
## Use
### Credentials
One alternative way of storing the Tokens is to place them in a .py inside a local virtual environment folder that is ignored (indicated in .gitignore) and run such
file once every working session that you are developing locally.
```python
import os
import toml
import numpy as np
from traderman.forecasters.benchmarks import Randomizer
from traderman.connectors import binance as BinanceSpot
BINANCE_API_KEY = os.environ["BINANCE_API_KEY"]
BINANCE_SECRET_KEY = os.environ["BINANCE_SECRET_KEY"]
# --- Get params from Config.toml
with open(cwd_path + "/examples/basic_config.toml", "r") as file:
config_data = toml.load(file)
SET_SEED = config_data["model"]["signal"]["model_params"]["seed"]
SET_CLASSES = config_data["model"]["signal"]["model_params"]["classes"]
# --- Use the randomizer as model benchmark
ModelSignal = Randomizer(seed=SET_SEED, model_type="classifier")
forecasted_signal = ModelSignal.predict(classes=SET_CLASSES)
ModelRisk = Randomizer(seed=SET_SEED, model_type="regressor")
forecasted_volume = np.round(ModelRisk.predict(lower=0.0001, upper=0.0009), 4)
# --- Specify parameters for trades
trade_params = {
"symbol": "BTCUSDT",
"type": "MARKET",
"side": forecasted_signal,
"quantity": forecasted_volume[0],
}
# --- Place an Order
n_order = BinanceSpot.new_order(
in_params=trade_params,
api_key=BINANCE_API_KEY,
secret_key=BINANCE_SECRET_KEY
)
```
## Contributors
Thanks to everyone that have contributed and made a difference.
Check out the following ways to contribute:
- Check the [Contributing guide](https://github.com/IteraLabs/traderman/blob/main/CONTRIBUTING.md) and the [Open Projects](https://github.com/IteraLabs/traderman/projects?query=is%3Aopen)
## Maintainers
- [IFFranciscoME](https://github.com/IFFranciscoME)
## References
- [binance-docs/spot](https://binance-docs.github.io/apidocs/spot/en/#introduction)
## License
```
MIT License
Copyright (c) 2024 IteraLabs
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```