bugfix
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
from v2realbot.config import Keys, get_key
|
||||
from v2realbot.enums.enums import Mode, Account, OrderSide
|
||||
from v2realbot.enums.enums import Mode, Account, OrderSide, OrderType
|
||||
from v2realbot.interfaces.live_interface import LiveInterface
|
||||
from msgpack import packb, unpackb
|
||||
key = get_key(mode=Mode.PAPER, account=Account.ACCOUNT1)
|
||||
@ -20,7 +20,7 @@ if int(data["index"])%int(consolidation_bar_count) == 0:
|
||||
print("***Consolidation ENTRY***")
|
||||
|
||||
orderlist = li.get_open_orders(symbol=symbol, side=None)
|
||||
#print(orderlist)
|
||||
print(orderlist)
|
||||
pendingbuys_new = {}
|
||||
limitka = None
|
||||
jevylozeno = 1
|
||||
@ -29,7 +29,7 @@ if int(data["index"])%int(consolidation_bar_count) == 0:
|
||||
print("Puvodni LIMITKA", limitka)
|
||||
limitka = o.id
|
||||
print("Přepsaná LIMITKA", limitka)
|
||||
if o.side == OrderSide.BUY:
|
||||
if o.side == OrderSide.BUY and o.order_type == OrderType.LIMIT:
|
||||
pendingbuys_new[str(o.id)]=o.limit_price
|
||||
|
||||
if pendingbuys_new != pendingbuys:
|
||||
|
||||
@ -2,7 +2,7 @@ import os,sys
|
||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
from v2realbot.strategy.base import StrategyState
|
||||
from v2realbot.strategy.StrategyOrderLimitVykladaci import StrategyOrderLimitVykladaci
|
||||
from v2realbot.enums.enums import RecordType, StartBarAlign, Mode, Account, OrderSide
|
||||
from v2realbot.enums.enums import RecordType, StartBarAlign, Mode, Account, OrderSide, OrderType
|
||||
from v2realbot.indicators.indicators import ema
|
||||
from v2realbot.utils.utils import ltp, isrising, isfalling,trunc,AttributeDict, zoneNY, price2dec, dict_replace_value, print, safe_get
|
||||
from datetime import datetime
|
||||
@ -305,7 +305,7 @@ def next(data, state: StrategyState):
|
||||
print("prepocitavam filledmnozstvi od limitka_qty a filled_qty", limitka_qty, limitka_filled_qty)
|
||||
limitka_qty = int(limitka_qty) - int(limitka_filled_qty)
|
||||
##TODO sem pridat upravu ceny
|
||||
if o.side == OrderSide.BUY:
|
||||
if o.side == OrderSide.BUY and o.order_type == OrderType.LIMIT:
|
||||
pendingbuys_new[str(o.id)]=float(o.limit_price)
|
||||
|
||||
state.ilog(e="Konzolidace limitky", msg=f"stejna:{(str(limitka_old)==str(state.vars.limitka))}", limitka_old=str(limitka_old), limitka_new=str(state.vars.limitka), limitka_new_price=state.vars.limitka_price, limitka_qty=limitka_qty, limitka_filled_qty=limitka_filled_qty)
|
||||
|
||||
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
from enum import Enum
|
||||
from alpaca.trading.enums import OrderSide, OrderStatus
|
||||
from alpaca.trading.enums import OrderSide, OrderStatus, OrderType
|
||||
class Order:
|
||||
def __init__(self, id: str, status: OrderStatus, side: OrderSide, symbol: str, qty: int, limit_price: float = None, filled_qty: int = 0, filled_avg_price: float = 0, filled_time: float = None) -> None:
|
||||
self.id = id
|
||||
|
||||
Reference in New Issue
Block a user