Keep slots ratio of 1 on derivs at startup

win_fixes
Tyler Goodlet 2021-09-24 11:47:38 -04:00
parent 1f1f0d3909
commit d706f35668
1 changed files with 5 additions and 1 deletions

View File

@ -287,6 +287,7 @@ def mk_allocator(
asset_type = symbol.type_key asset_type = symbol.type_key
# specific configs by asset class / type # specific configs by asset class / type
if asset_type in ('future', 'option', 'futures_option'): if asset_type in ('future', 'option', 'futures_option'):
@ -308,9 +309,12 @@ def mk_allocator(
alloc.currency_limit = round(startup_size, ndigits=2) alloc.currency_limit = round(startup_size, ndigits=2)
else: else:
startup_size = startup_pp.size startup_size = abs(startup_pp.size)
if startup_size > alloc.units_limit: if startup_size > alloc.units_limit:
alloc.units_limit = startup_size alloc.units_limit = startup_size
if asset_type in ('future', 'option', 'futures_option'):
alloc.slots = alloc.units_limit
return alloc return alloc