Oof, reverse clearing logic-routines in paper eng

paper_clear_logics_fix
Tyler Goodlet 2022-09-10 16:24:25 -04:00
parent 087a34f061
commit cc3bb85c66
1 changed files with 5 additions and 5 deletions

View File

@ -333,7 +333,7 @@ async def simulate_fills(
key=itemgetter(0), key=itemgetter(0),
)) ))
def sell_on_bid(our_price): def buy_on_ask(our_price):
return tick_price <= our_price return tick_price <= our_price
sells: bidict[str, tuple] = client._sells[sym] sells: bidict[str, tuple] = client._sells[sym]
@ -342,7 +342,7 @@ async def simulate_fills(
key=itemgetter(0) key=itemgetter(0)
) )
def buy_on_ask(our_price): def sell_on_bid(our_price):
return tick_price >= our_price return tick_price >= our_price
match tick: match tick:
@ -358,7 +358,7 @@ async def simulate_fills(
iter_entries = zip( iter_entries = zip(
iter_buys, iter_buys,
itertools.repeat(sell_on_bid) itertools.repeat(buy_on_ask)
) )
case { case {
@ -373,7 +373,7 @@ async def simulate_fills(
iter_entries = zip( iter_entries = zip(
iter_sells, iter_sells,
itertools.repeat(buy_on_ask) itertools.repeat(sell_on_bid)
) )
case { case {
@ -394,7 +394,7 @@ async def simulate_fills(
): ):
for order_info, pred in zip( for order_info, pred in zip(
pair, pair,
itertools.cycle([sell_on_bid, buy_on_ask]), itertools.cycle([buy_on_ask, sell_on_bid]),
): ):
yield order_info, pred yield order_info, pred