Comments (3)
Так же никогда не переходит на данные строки, хотя прайсы никогда не равны, но он почему то строку пропускает
if round(price, 2) != round(i.sellPrice, 2):
i.sellPrice = price
items_to_update.append(EditOffer(OfferID=i.OfferID, AssetID=i.AssetID,
Price=LastPrice(Currency='USD', Amount=round(i.sellPrice, 2))))
from dmarket_bot.
async def update_offers_loop():
Не проходит дальше данного цикла
Строка из Debug
2021-09-09 01:06:56.023 | INFO | main:main:104 - Запуск бота
2021-09-09 01:06:56.054 | DEBUG | main:history_loop:51 - History loop
2021-09-09 01:07:02.868 | INFO | main:create_pre_base:20 - Обработка базы скинов
2021-09-09 01:07:02.868 | DEBUG | modules.skinbase:update_base:77 - Games.CS
2021-09-09 01:07:02.875 | DEBUG | main:orders_loop:32 - orders loop
2021-09-09 01:07:02.876 | DEBUG | main:orders_loop:34 - 0
2021-09-09 01:07:13.927 | DEBUG | modules.offers:update_offers:128 - UPDATE OFFERS: Result=[]
2021-09-09 01:07:13.941 | DEBUG | api.dmarketapi:get_balance:123 - BALANCE: 193
2021-09-09 01:07:14.136 | DEBUG | main:orders_loop:42 - Не хватает денег для выставления ордеров, откладываем аналитику
2021-09-09 01:07:14.177 | DEBUG | modules.offers:add_to_sell:89 - Add to sell: Result=[]
2021-09-09 01:07:31.763 | DEBUG | modules.offers:add_to_sell:89 - Add to sell: Result=[]
2021-09-09 01:07:31.792 | DEBUG | modules.offers:update_offers:128 - UPDATE OFFERS: Result=[]И так бесконечно
Если смотреть по стопам дебага, то он создает базу и постоянно смотрит на инвентарь на сайте, но не переходит на выставление ордеров и анализу
Конфиг выставлен весь правильно
Это просиходило из-за того, что в файле main.py
я поставил ограничение в петле выставления ордеров на баланс. Если баланс на 10 долларов меньше, чем цена минимально возможного ордера, то они не выставляются.
В коммите добавил параметр STOP_ORDERS_BALANCE = 1000
- означающий остановку выставления ордеров при балансе на 10 долларов (1000 центов) меньше, чем минимальная цена ордера.
from dmarket_bot.
Так же никогда не переходит на данные строки, хотя прайсы никогда не равны, но он почему то строку пропускает
if round(price, 2) != round(i.sellPrice, 2):
i.sellPrice = price
items_to_update.append(EditOffer(OfferID=i.OfferID, AssetID=i.AssetID,
Price=LastPrice(Currency='USD', Amount=round(i.sellPrice, 2))))
Эту ошибку исправил в коммите 65a7d1b64d39722111f7df957205f1b3477cb4b3. Она возникала из-за разной длины массивов в
on_sell и agr
в данном месте:
on_sell = sorted([i for i in SelectSkinOffer.select_not_sell() if i.OfferID is not None],
key=lambda x: x.title)
names = [i.title for i in on_sell]
agr = await self.bot.agregated_prices(names=names, limit=len(names))
items_to_update = list()
for i, j in zip(on_sell, agr):
best_price = j.Offers.BestPrice
if i.sellPrice != best_price:
max_sell_price = i.buyPrice * (1 + self.max_percent / 100 + i.fee / 100)
min_sell_price = i.buyPrice * (1 + self.min_percent / 100 + i.fee / 100)
price = self.offer_price(max_sell_price, min_sell_price, best_price)
if round(price, 2) != round(i.sellPrice, 2):
# logger.info(f'{i.sellPrice} {best_price} {price} {i.fee}')
i.sellPrice = price
items_to_update.append(EditOffer(OfferID=i.OfferID, AssetID=i.AssetID,
Price=LastPrice(Currency='USD', Amount=i.sellPrice)))
from dmarket_bot.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dmarket_bot.