Adjust order mode to use `Flume.get_index()`
							parent
							
								
									b92ff7caf9
								
							
						
					
					
						commit
						42e0048b7c
					
				| 
						 | 
					@ -930,7 +930,6 @@ async def process_trade_msg(
 | 
				
			||||||
 | 
					
 | 
				
			||||||
) -> tuple[Dialog, Status]:
 | 
					) -> tuple[Dialog, Status]:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    get_index = mode.chart.get_index
 | 
					 | 
				
			||||||
    fmsg = pformat(msg)
 | 
					    fmsg = pformat(msg)
 | 
				
			||||||
    log.debug(f'Received order msg:\n{fmsg}')
 | 
					    log.debug(f'Received order msg:\n{fmsg}')
 | 
				
			||||||
    name = msg['name']
 | 
					    name = msg['name']
 | 
				
			||||||
| 
						 | 
					@ -965,6 +964,9 @@ async def process_trade_msg(
 | 
				
			||||||
    oid = msg.oid
 | 
					    oid = msg.oid
 | 
				
			||||||
    dialog: Dialog = mode.dialogs.get(oid)
 | 
					    dialog: Dialog = mode.dialogs.get(oid)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    fqsn = dialog.symbol.front_fqsn()
 | 
				
			||||||
 | 
					    flume = mode.feed.flumes[fqsn]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    match msg:
 | 
					    match msg:
 | 
				
			||||||
        case Status(
 | 
					        case Status(
 | 
				
			||||||
            resp='dark_open' | 'open',
 | 
					            resp='dark_open' | 'open',
 | 
				
			||||||
| 
						 | 
					@ -1037,7 +1039,7 @@ async def process_trade_msg(
 | 
				
			||||||
            mode.on_fill(
 | 
					            mode.on_fill(
 | 
				
			||||||
                oid,
 | 
					                oid,
 | 
				
			||||||
                price=req.price,
 | 
					                price=req.price,
 | 
				
			||||||
                arrow_index=get_index(time.time()),
 | 
					                arrow_index=flume.get_index(time.time()),
 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
            mode.lines.remove_line(uuid=oid)
 | 
					            mode.lines.remove_line(uuid=oid)
 | 
				
			||||||
            msg.req = req
 | 
					            msg.req = req
 | 
				
			||||||
| 
						 | 
					@ -1072,7 +1074,7 @@ async def process_trade_msg(
 | 
				
			||||||
                pointing='up' if action == 'buy' else 'down',
 | 
					                pointing='up' if action == 'buy' else 'down',
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                # TODO: put the actual exchange timestamp
 | 
					                # TODO: put the actual exchange timestamp
 | 
				
			||||||
                arrow_index=get_index(
 | 
					                arrow_index=flume.get_index(
 | 
				
			||||||
                    # TODO: note currently the ``kraken`` openOrders sub
 | 
					                    # TODO: note currently the ``kraken`` openOrders sub
 | 
				
			||||||
                    # doesn't deliver their engine timestamp as part of
 | 
					                    # doesn't deliver their engine timestamp as part of
 | 
				
			||||||
                    # it's schema, so this value is **not** from them
 | 
					                    # it's schema, so this value is **not** from them
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue