Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Min funds #421

Merged
merged 2 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.9.41] - 2023-02-20
### Added
- usd_like_value to MinimalFund

## [1.9.40] - 2023-02-15
### Fixed
- ProfileData to profile dict portfolio
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# OctoBot-Commons [1.9.40](https://github.com/Drakkar-Software/OctoBot-Commons/blob/master/CHANGELOG.md)
# OctoBot-Commons [1.9.41](https://github.com/Drakkar-Software/OctoBot-Commons/blob/master/CHANGELOG.md)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/b31f3ab3511744a5a5ca6b9bb48e77bb)](https://app.codacy.com/gh/Drakkar-Software/OctoBot-Commons?utm_source=github.com&utm_medium=referral&utm_content=Drakkar-Software/OctoBot-Commons&utm_campaign=Badge_Grade_Dashboard)
[![PyPI](https://img.shields.io/pypi/v/OctoBot-Commons.svg)](https://pypi.python.org/pypi/OctoBot-Commons/)
[![Coverage Status](https://coveralls.io/repos/github/Drakkar-Software/OctoBot-Commons/badge.svg?branch=master)](https://coveralls.io/github/Drakkar-Software/OctoBot-Commons?branch=master)
Expand Down
2 changes: 1 addition & 1 deletion octobot_commons/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# License along with this library.

PROJECT_NAME = "OctoBot-Commons"
VERSION = "1.9.40" # major.minor.revision
VERSION = "1.9.41" # major.minor.revision

MARKET_SEPARATOR = "/"
SETTLEMENT_ASSET_SEPARATOR = ":"
Expand Down
1 change: 1 addition & 0 deletions octobot_commons/profiles/profile_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class MinimalFund(octobot_commons.dataclasses.FlexibleDataclass):
asset: str
available: float
total: float
usd_like_value: float = 0

@classmethod
def from_dict(cls, dict_value: dict):
Expand Down
6 changes: 4 additions & 2 deletions tests/profiles/test_profile_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,13 @@ def profile_data_dict():
"asset": "BTC",
"available": 12,
"total": 12,
"usd_like_value": 1,
},
{
"asset": "PLOP",
"available": 0.1111,
"total": 0.2222,
"usd_like_value": 0,
}
],
'risk': 0.5
Expand Down Expand Up @@ -190,8 +192,8 @@ def test_from_dict(profile_data_dict):
assert profile_data.trader_simulator.starting_portfolio == {'BTC': 10, 'USDT': 1000}
assert profile_data.trading.risk == 0.5
assert profile_data.trading.minimal_funds == [
profiles.MinimalFund("BTC", 12, 12),
profiles.MinimalFund("PLOP", 0.1111, 0.2222),
profiles.MinimalFund("BTC", 12, 12, usd_like_value=1),
profiles.MinimalFund("PLOP", 0.1111, 0.2222, usd_like_value=0),
profiles.MinimalFund("ETH", 111.2, 111.2),
]
assert profile_data.tentacles[0].name == "plopEvaluator"
Expand Down
Loading