mirror of
https://github.com/Drakkar-Software/OctoBot.git
synced 2022-03-03 23:52:26 +03:00
Update requirements
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
# Setup requirements
|
||||
cython==0.29.24
|
||||
cython==0.29.26
|
||||
|
||||
# Drakkar-Software requirements
|
||||
OctoBot-Commons==1.6.18
|
||||
OctoBot-Trading==1.14.2
|
||||
OctoBot-Evaluators==1.6.22
|
||||
OctoBot-Tentacles-Manager==2.6.3
|
||||
OctoBot-Services==1.2.28
|
||||
OctoBot-Backtesting==1.6.27
|
||||
Async-Channel==2.0.12
|
||||
OctoBot-Commons==1.6.20
|
||||
OctoBot-Trading==2.1.2
|
||||
OctoBot-Evaluators==1.6.24
|
||||
OctoBot-Tentacles-Manager==2.6.4
|
||||
OctoBot-Services==1.2.31
|
||||
OctoBot-Backtesting==1.6.29
|
||||
Async-Channel==2.0.13
|
||||
trading-backend==1.0.12
|
||||
|
||||
## Others
|
||||
colorlog==4.7.2
|
||||
yarl==1.6.3
|
||||
yarl==1.7.2
|
||||
idna<2.9,>=2.5
|
||||
requests==2.25.1
|
||||
|
||||
2
setup.py
2
setup.py
@@ -16,7 +16,7 @@
|
||||
import os
|
||||
from setuptools import dist
|
||||
|
||||
dist.Distribution().fetch_build_eggs(['Cython==0.29.24'])
|
||||
dist.Distribution().fetch_build_eggs(['Cython==0.29.26'])
|
||||
|
||||
try:
|
||||
from Cython.Distutils import build_ext
|
||||
|
||||
@@ -131,31 +131,31 @@ def check_portfolio(portfolio, initial_portfolio, orders, only_positivity=False)
|
||||
orders_market_amount += order.origin_quantity * order.origin_price
|
||||
else:
|
||||
orders_currency_amount += order.origin_quantity
|
||||
for symbol in portfolio:
|
||||
assert portfolio[symbol][commons_constants.PORTFOLIO_TOTAL] >= trading_constants.ZERO
|
||||
assert portfolio[symbol][commons_constants.PORTFOLIO_AVAILABLE] >= trading_constants.ZERO
|
||||
for symbol in portfolio.portfolio.keys():
|
||||
assert portfolio.get_currency_portfolio(symbol).total >= trading_constants.ZERO
|
||||
assert portfolio.get_currency_portfolio(symbol).available >= trading_constants.ZERO
|
||||
if not only_positivity:
|
||||
if order.order_type in (
|
||||
trading_enum.TraderOrderType.SELL_MARKET, trading_enum.TraderOrderType.BUY_MARKET):
|
||||
trading_enum.TraderOrderType.SELL_MARKET, trading_enum.TraderOrderType.BUY_MARKET) and \
|
||||
symbol in [order.market, order.currency]:
|
||||
# order is filled
|
||||
assert initial_portfolio[symbol][commons_constants.PORTFOLIO_TOTAL] != portfolio[symbol][
|
||||
commons_constants.PORTFOLIO_TOTAL]
|
||||
assert initial_portfolio[symbol][commons_constants.PORTFOLIO_AVAILABLE] != portfolio[symbol][
|
||||
commons_constants.PORTFOLIO_AVAILABLE]
|
||||
assert initial_portfolio.get_currency_portfolio(symbol).total != \
|
||||
portfolio.get_currency_portfolio(symbol).total
|
||||
assert initial_portfolio.get_currency_portfolio(symbol).available != \
|
||||
portfolio.get_currency_portfolio(symbol).available
|
||||
else:
|
||||
if order_symbol == symbol:
|
||||
assert initial_portfolio[symbol][commons_constants.PORTFOLIO_TOTAL] == portfolio[symbol][
|
||||
commons_constants.PORTFOLIO_TOTAL]
|
||||
assert initial_portfolio.get_currency_portfolio(symbol).total == \
|
||||
portfolio.get_currency_portfolio(symbol).total
|
||||
assert "{:f}".format(
|
||||
initial_portfolio[symbol][
|
||||
commons_constants.PORTFOLIO_AVAILABLE] - orders_currency_amount) == \
|
||||
"{:f}".format(portfolio[symbol][commons_constants.PORTFOLIO_AVAILABLE])
|
||||
initial_portfolio.get_currency_portfolio(symbol).available - orders_currency_amount) == \
|
||||
"{:f}".format(portfolio.get_currency_portfolio(symbol).available)
|
||||
elif market == symbol:
|
||||
assert initial_portfolio[market][commons_constants.PORTFOLIO_TOTAL] == portfolio[market][
|
||||
commons_constants.PORTFOLIO_TOTAL]
|
||||
assert initial_portfolio.get_currency_portfolio(market).total == \
|
||||
portfolio.get_currency_portfolio(market).total
|
||||
assert "{:f}".format(
|
||||
initial_portfolio[market][commons_constants.PORTFOLIO_AVAILABLE] - orders_market_amount) \
|
||||
== "{:f}".format(portfolio[market][commons_constants.PORTFOLIO_AVAILABLE])
|
||||
initial_portfolio.get_currency_portfolio(market).available - orders_market_amount) \
|
||||
== "{:f}".format(portfolio.get_currency_portfolio(market).available)
|
||||
|
||||
|
||||
async def fill_orders(orders, trader):
|
||||
@@ -165,6 +165,6 @@ async def fill_orders(orders, trader):
|
||||
order.filled_price = order.origin_price
|
||||
order.filled_quantity = order.origin_quantity
|
||||
await order.on_fill(force_fill=True)
|
||||
check_portfolio(trader.exchange_manager.exchange_personal_data.portfolio_manager.portfolio.portfolio,
|
||||
check_portfolio(trader.exchange_manager.exchange_personal_data.portfolio_manager.portfolio,
|
||||
None, orders, True)
|
||||
assert len(trading_api.get_open_orders(trader.exchange_manager)) == 0
|
||||
|
||||
Reference in New Issue
Block a user