Skip to content

Commit e6d8f16

Browse files
author
rob
committed
clean up genunits
1 parent bd0a055 commit e6d8f16

File tree

18 files changed

+329
-268
lines changed

18 files changed

+329
-268
lines changed

docs/instruments.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ system.get_list_of_bad_markets()
313313

314314
### Automatically excluded
315315

316-
It's also possible that there are some instruments that have zero positions. The most likely explanation for this is that you have set a speed limit on trading costs, and there are no trading rules that are cheap enough to trade the given instrument.
316+
It's also possible that there are some instruments that have zero positions. The most likely explanation for this is that you have set a speed limit on trading costs, and there are no trading rules that are cheap enough to trade the given instrument. These are automatically added to the list of markets given a zero weight for optimisation.
317317

318318

319319
## Customising the list of 'all instruments' and 'excluded for optimisation'

sysbrokers/IB/ib_instruments_data.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from sysbrokers.broker_instrument_data import brokerFuturesInstrumentData
1010

1111
from syscore.fileutils import resolve_path_and_filename_for_package
12-
from syscore.genutils import value_or_npnan
12+
from syscore.genutils import return_another_value_if_nan
1313
from syscore.objects import missing_instrument, missing_file
1414

1515
from sysobjects.instruments import futuresInstrument
@@ -173,11 +173,11 @@ def get_instrument_object_from_config(
173173
config_row = config[config.Instrument == instrument_code]
174174
symbol = config_row.IBSymbol.values[0]
175175
exchange = config_row.IBExchange.values[0]
176-
currency = value_or_npnan(config_row.IBCurrency.values[0], NOT_REQUIRED_FOR_IB)
177-
ib_multiplier = value_or_npnan(
176+
currency = return_another_value_if_nan(config_row.IBCurrency.values[0], NOT_REQUIRED_FOR_IB)
177+
ib_multiplier = return_another_value_if_nan(
178178
config_row.IBMultiplier.values[0], NOT_REQUIRED_FOR_IB
179179
)
180-
price_magnifier = value_or_npnan(config_row.priceMagnifier.values[0], 1.0)
180+
price_magnifier = return_another_value_if_nan(config_row.priceMagnifier.values[0], 1.0)
181181
ignore_weekly = config_row.IgnoreWeekly.values[0]
182182

183183
# We use the flexibility of futuresInstrument to add additional arguments

0 commit comments

Comments
 (0)