Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_convert_to_camel_case(self):
assert to_camel_case('hello_world') == 'helloWorld'
assert to_camel_case('async_') == 'async'
:param list price_data: PriceData filter to specify what market data we wish to receive.
:param dict ex_best_offers_overrides: define order book depth, rollup method.
:param bool virtualise: whether to receive virtualised prices also.
:param bool rollover_stakes: whether to accumulate volume at each price as sum of volume at that price and all better
prices.
:returns: price data criteria for market data.
:rtype: dict
"""
if price_data is None:
price_data = []
if ex_best_offers_overrides is None:
ex_best_offers_overrides = {}
args = locals().copy()
return {
to_camel_case(k): v for k, v in args.items() if v is not None
}
:param float size: amount in account currency to be sent.
:param float price: price at which the order is to be sent.
:param str persistence_type: what happens to order at turn in play.
:param str time_in_force: specify if it is FillOrKill/FillAndKill. This value takes precedence over any
PersistenceType value chosen.
:param float min_fill_size: the minimum amount to be filled for FillAndKill.
:param str bet_target_type: Specify the type of Target, bet to certain backer profit or certain payout value.
Used to adjust to lower stakes if filled at better levels.
:param float bet_target_size: Size of payout of profit to bet.
:returns: Order information to place a limit order.
:rtype: dict
"""
args = locals().copy()
return {
to_camel_case(k): v for k, v in args.items() if v is not None
}
:param list market_ids: filter market data to data pertaining to specific marketIds.
:param list event_type_ids: filter market data to data pertaining to specific event_type ids.
:param list event_ids: filter market data to data pertaining to specific event ids.
:param bool turn_in_play_enabled: restriction on whether market will turn in play or not, not supplied returns all.
:param list venues: restrict markets by venue (only horse racing has venue at the moment)
:param bool bsp_market: restriction on bsp, not supplied will return all.
:param list betting_types: filter on betting types
:param list market_types: filter market data by market types.
:param list country_codes: filter based on country codes
:param list race_types: filter race types
:return: dict
"""
args = locals().copy()
return {
to_camel_case(k): v for k, v in args.items() if v is not None
}
def streaming_order_filter(include_overall_position=None, customer_strategy_refs=None,
partition_matched_by_strategy_ref=None):
"""
:param bool include_overall_position: Returns overall / net position (OrderRunnerChange.mb / OrderRunnerChange.ml)
:param list customer_strategy_refs: Restricts to specified customerStrategyRefs; this will filter orders and
StrategyMatchChanges accordingly (Note: overall postition is not filtered)
:param bool partition_matched_by_strategy_ref: Returns strategy positions (OrderRunnerChange.smc=
Map) - these are sent in delta format as per overall position.
:return: dict
"""
args = locals().copy()
return {
to_camel_case(k): v for k, v in args.items() if v is not None
}
:param float handicap: handicap if placing order on asianhandicap type market
:param str side: side of order
:param resources.LimitOrder limit_order: if orderType is a limitOrder structure details of the order.
:param resources.LimitOnCloseOrder limit_on_close_order: if orderType is a
limitOnCloseOrder structure details of the order.
:param resources.MarketOnCloseOrder market_on_close_order: if orderType is
a marketOnCloseOrder structure details of the order.
:param str customer_order_ref: an optional reference customers can set to identify instructions..
:return: orders to place.
:rtype: dict
"""
args = locals().copy()
return {
to_camel_case(k): v for k, v in args.items() if v is not None
}
:param int rollup_limit: The volume limit to use when rolling up returned sizes. The exact definition of the limit
depends on the rollupModel.
If no limit is provided it will use minimum stake
:param float rollup_liability_threshold: Only applicable when rollupModel is MANAGED_LIABILITY. The rollup model
switches from being stake based to liability based at the smallest lay price which is >= rollupLiabilityThreshold
:param int rollup_liability_factor: Only applicable when rollupModel is MANAGED_LIABILITY. (rollupLiabilityFactor *
rollupLimit) is the minimum liabilty the user is deemed to be comfortable with. After the rollupLiabilityThreshold
price subsequent volumes will be rolled up to minimum value such that the liability >= the minimum liability.
:returns: parameters for inclusion in market data requests.
:rtype: dict
"""
args = locals().copy()
return {
to_camel_case(k): v for k, v in args.items() if v is not None
}
def streaming_market_data_filter(fields=None, ladder_levels=None):
"""
:param list fields: EX_BEST_OFFERS_DISP, EX_BEST_OFFERS, EX_ALL_OFFERS, EX_TRADED,
EX_TRADED_VOL, EX_LTP, EX_MARKET_DEF, SP_TRADED, SP_PROJECTED
:param int ladder_levels: 1->10
:return: dict
"""
args = locals().copy()
return {
to_camel_case(k): v for k, v in args.items() if v is not None
}
def cancel_instruction(bet_id, size_reduction=None):
"""
Instruction to fully or partially cancel an order (only applies to LIMIT orders)
:param str bet_id: identifier of the bet to cancel.
:param float size_reduction: If supplied then this is a partial cancel.
:returns: cancellation report detailing status, cancellation requested and actual cancellation details.
:rtype: dict
"""
args = locals().copy()
return {
to_camel_case(k): v for k, v in args.items() if v is not None
}
def replace_instruction(bet_id, new_price):
"""
Instruction to replace a LIMIT or LIMIT_ON_CLOSE order at a new price.
Original order will be cancelled and a new order placed at the new price for the remaining stake.
:param str bet_id: Unique identifier for the bet
:param float new_price: The price to replace the bet at
:returns: replace report detailing status, replace requested and actual replace details.
:rtype: dict
"""
args = locals().copy()
return {
to_camel_case(k): v for k, v in args.items() if v is not None
}