diff --git a/v2realbot/__pycache__/config.cpython-310.pyc b/v2realbot/__pycache__/config.cpython-310.pyc index 29d633f..8264042 100644 Binary files a/v2realbot/__pycache__/config.cpython-310.pyc and b/v2realbot/__pycache__/config.cpython-310.pyc differ diff --git a/v2realbot/interfaces/live_interface.py b/v2realbot/interfaces/live_interface.py index 62f809b..42af49f 100644 --- a/v2realbot/interfaces/live_interface.py +++ b/v2realbot/interfaces/live_interface.py @@ -39,7 +39,7 @@ class LiveInterface(GeneralInterface): return market_order.id except Exception as e: - print("Nepodarilo se odeslat ", str(e)) + print("Nepodarilo se odeslat buy", str(e)) return -1 """buy limit""" @@ -86,7 +86,7 @@ class LiveInterface(GeneralInterface): return market_order.id except Exception as e: - print("Nepodarilo se odeslat ", str(e)) + print("Nepodarilo se odeslat sell", str(e)) return -1 """sell limit""" @@ -111,7 +111,7 @@ class LiveInterface(GeneralInterface): return limit_order.id except Exception as e: - print("Nepodarilo se odeslat ", str(e)) + print("Nepodarilo se odeslat sell_l", str(e)) #raise Exception(e) return -1 diff --git a/v2realbot/static/main.css b/v2realbot/static/main.css index 68843f6..3ef09c1 100644 --- a/v2realbot/static/main.css +++ b/v2realbot/static/main.css @@ -34,18 +34,33 @@ } #msgContainer { - display: grid; + display: inline-block; overflow: auto; height: 568px; } -.msgContainerInner { - display: flex; - overflow: auto; - height: 568px; - flex-direction: column-reverse; +/* na male obrazovce je log pod grafem, zobrazujeme tedy prvni logy nahore */ +@media (max-width : 1680px) { + .msgContainerInner { + display: flex; + overflow: auto; + height: 568px; + flex-direction: column-reverse; + } } +@media (min-width : 1681px) { + .msgContainerInner { + display: flex; + overflow: auto; + height: 568px; + flex-direction: column-reverse; + } +} + + + + pre { display: block; /* padding: 9.5px; */ diff --git a/v2realbot/strategy/StrategyOrderLimitVykladaci.py b/v2realbot/strategy/StrategyOrderLimitVykladaci.py index 1b23059..ca2eb58 100644 --- a/v2realbot/strategy/StrategyOrderLimitVykladaci.py +++ b/v2realbot/strategy/StrategyOrderLimitVykladaci.py @@ -36,6 +36,9 @@ class StrategyOrderLimitVykladaci(Strategy): self.state.avgp = float(data.price) price=price2dec(float(o.filled_avg_price)+self.state.vars.profit) self.state.vars.limitka = await self.interface.sell_l(price=price, size=o.filled_qty) + #obcas live vrati "held for orders", odchytime chybu a limitku nevytvarime - spravi to dalsi notifikace nebo konzolidace + if self.state.vars.limitka == -1: + self.state.vars.limitka = None self.state.vars.limitka_price = price self.state.ilog(e="Příchozí BUY notif - vytvarime limitku", msg="order status:"+o.status, orderid=str(o.id), limitka=str(self.state.vars.limitka), limtka_price=self.state.vars.limitka_price) else: @@ -45,6 +48,9 @@ class StrategyOrderLimitVykladaci(Strategy): try: puvodni = self.state.vars.limitka self.state.vars.limitka = await self.interface.repl(price=cena,orderid=self.state.vars.limitka,size=int(self.state.positions)) + #odchyceni pripadne chyby na live + if self.state.vars.limitka == -1: + self.state.vars.limitka = puvodni self.state.vars.limitka_price = cena self.state.ilog(e="Příchozí BUY notif - menime limitku", msg="order status:"+o.status, orderid=str(o.id), limitka=str(self.state.vars.limitka), limtka_price=self.state.vars.limitka_price, puvodni_limitka=str(puvodni)) except APIError as e: @@ -60,11 +66,19 @@ class StrategyOrderLimitVykladaci(Strategy): if data.event == TradeEvent.PARTIAL_FILL: self.state.ilog(e="SELL notifikace - Partial fill", msg="pouze update pozic", orderid=str(data.order.id)) ic("partial fill jen udpatujeme pozice") + #TODO tento update mozna vyhodit a pockat vzdy na plny fill - otestovat az bude cas self.state.avgp, self.state.positions = self.interface.pos() elif data.event == TradeEvent.FILL or data.event == TradeEvent.CANCELED: print("Příchozí SELL notifikace - complete FILL nebo CANCEL", data.event) #muzeme znovu nakupovat, mazeme limitku, blockbuy a pendingbuys #self.state.blockbuy = 0 + + #ADDPROFIT - datd o funkce + prodej = data.order.filled_qty * data.order.filled_avg_price + nakup = self.state.positions + + + ic("notifikace sell mazeme limitku a update pozic") #updatujeme pozice self.state.avgp, self.state.positions = self.interface.pos() diff --git a/v2realbot/strategy/__pycache__/StrategyOrderLimitVykladaci.cpython-310.pyc b/v2realbot/strategy/__pycache__/StrategyOrderLimitVykladaci.cpython-310.pyc index 22523dc..58a26e8 100644 Binary files a/v2realbot/strategy/__pycache__/StrategyOrderLimitVykladaci.cpython-310.pyc and b/v2realbot/strategy/__pycache__/StrategyOrderLimitVykladaci.cpython-310.pyc differ diff --git a/v2realbot/strategy/__pycache__/base.cpython-310.pyc b/v2realbot/strategy/__pycache__/base.cpython-310.pyc index 22fd505..dc78ba9 100644 Binary files a/v2realbot/strategy/__pycache__/base.cpython-310.pyc and b/v2realbot/strategy/__pycache__/base.cpython-310.pyc differ diff --git a/v2realbot/strategy/base.py b/v2realbot/strategy/base.py index f1e6298..7ce66eb 100644 --- a/v2realbot/strategy/base.py +++ b/v2realbot/strategy/base.py @@ -48,6 +48,7 @@ class Strategy: self.account = account self.key = get_key(mode=self.mode, account=self.account) self.rtqueue = None + self.profit = 0 #TODO predelat na dynamické queues