Skip to content

Commit

Permalink
fix init
Browse files Browse the repository at this point in the history
  • Loading branch information
r0fls committed Nov 25, 2024
1 parent 457b9ab commit 9948723
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion order_manager/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@
from utils.logger import logger

class OrderManager:
async def __init__(self, engine, brokers):
def __init__(self, engine, brokers):
logger.info('Initializing OrderManager')
self.engine = engine
self.db_manager = DBManager(engine)
self.brokers = brokers

async def reconcile_orders(self, orders):
logger.info('Reconciling orders', extra={'orders': orders})
for order in orders:
await self.reconcile_order(order)
# Commit the transaction

async def reconcile_order(self, order):
logger.info(f'Reconciling order {order.id}', extra={'order_id': order.id, 'broker': order.broker, 'symbol': order.symbol, 'quantity': order.quantity, 'price': order.price, 'side': order.side, 'status': order.status, 'type': order.type, 'time_in_force': order.time_in_force, 'created_at': order.created_at, 'updated_at': order.updated_at, 'filled_at': order.filled_at, 'filled_quantity': order.filled_quantity, 'remaining_quantity': order.remaining_quantity, 'canceled_at': order.canceled_at, 'failed_at': order.failed_at, 'message': order.message})
Expand Down

0 comments on commit 9948723

Please sign in to comment.