TOSQUASH: 552a8c298cd (return index for arrow..)
							parent
							
								
									c0a521358f
								
							
						
					
					
						commit
						1ba92a026f
					
				| 
						 | 
					@ -1037,10 +1037,11 @@ async def process_trade_msg(
 | 
				
			||||||
            # should only be one "fill" for an alert
 | 
					            # should only be one "fill" for an alert
 | 
				
			||||||
            # add a triangle and remove the level line
 | 
					            # add a triangle and remove the level line
 | 
				
			||||||
            req = Order(**req)
 | 
					            req = Order(**req)
 | 
				
			||||||
 | 
					            index = flume.get_index(time.time())
 | 
				
			||||||
            mode.on_fill(
 | 
					            mode.on_fill(
 | 
				
			||||||
                oid,
 | 
					                oid,
 | 
				
			||||||
                price=req.price,
 | 
					                price=req.price,
 | 
				
			||||||
                arrow_index=flume.get_index(time.time()),
 | 
					                arrow_index=index,
 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
            mode.lines.remove_line(uuid=oid)
 | 
					            mode.lines.remove_line(uuid=oid)
 | 
				
			||||||
            msg.req = req
 | 
					            msg.req = req
 | 
				
			||||||
| 
						 | 
					@ -1068,26 +1069,27 @@ async def process_trade_msg(
 | 
				
			||||||
            action = order.action
 | 
					            action = order.action
 | 
				
			||||||
            details = msg.brokerd_msg
 | 
					            details = msg.brokerd_msg
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            # TODO: put the actual exchange timestamp?
 | 
				
			||||||
 | 
					            # NOTE: currently the ``kraken`` openOrders sub
 | 
				
			||||||
 | 
					            # doesn't deliver their engine timestamp as part of
 | 
				
			||||||
 | 
					            # it's schema, so this value is **not** from them
 | 
				
			||||||
 | 
					            # (see our backend code). We should probably either
 | 
				
			||||||
 | 
					            # include all provider-engine timestamps in the
 | 
				
			||||||
 | 
					            # summary 'closed' status msg and/or figure out
 | 
				
			||||||
 | 
					            # a way to indicate what is a `brokerd` stamp versus
 | 
				
			||||||
 | 
					            # a true backend one? This will require finagling
 | 
				
			||||||
 | 
					            # with how each backend tracks/summarizes time
 | 
				
			||||||
 | 
					            # stamps for the downstream API.
 | 
				
			||||||
 | 
					            index = flume.get_index(
 | 
				
			||||||
 | 
					                details['broker_time']
 | 
				
			||||||
 | 
					            )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            # TODO: some kinda progress system
 | 
					            # TODO: some kinda progress system
 | 
				
			||||||
            mode.on_fill(
 | 
					            mode.on_fill(
 | 
				
			||||||
                oid,
 | 
					                oid,
 | 
				
			||||||
                price=details['price'],
 | 
					                price=details['price'],
 | 
				
			||||||
 | 
					                arrow_index=index,
 | 
				
			||||||
                pointing='up' if action == 'buy' else 'down',
 | 
					                pointing='up' if action == 'buy' else 'down',
 | 
				
			||||||
 | 
					 | 
				
			||||||
                # TODO: put the actual exchange timestamp
 | 
					 | 
				
			||||||
                arrow_index=flume.get_index(
 | 
					 | 
				
			||||||
                    # TODO: note currently the ``kraken`` openOrders sub
 | 
					 | 
				
			||||||
                    # doesn't deliver their engine timestamp as part of
 | 
					 | 
				
			||||||
                    # it's schema, so this value is **not** from them
 | 
					 | 
				
			||||||
                    # (see our backend code). We should probably either
 | 
					 | 
				
			||||||
                    # include all provider-engine timestamps in the
 | 
					 | 
				
			||||||
                    # summary 'closed' status msg and/or figure out
 | 
					 | 
				
			||||||
                    # a way to indicate what is a `brokerd` stamp versus
 | 
					 | 
				
			||||||
                    # a true backend one? This will require finagling
 | 
					 | 
				
			||||||
                    # with how each backend tracks/summarizes time
 | 
					 | 
				
			||||||
                    # stamps for the downstream API.
 | 
					 | 
				
			||||||
                    details['broker_time']
 | 
					 | 
				
			||||||
                ),
 | 
					 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            # TODO: append these fill events to the position's clear
 | 
					            # TODO: append these fill events to the position's clear
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue