17 using System.Collections.Generic;
53 return GetProperty<AccountType>(nameof(
AccountType));
79 if ((markets as PyObject).TryConvert(out IReadOnlyDictionary<SecurityType, string> csharpDic))
84 var dic =
new Dictionary<SecurityType, string>();
85 foreach (var item
in markets)
87 using var pyItem = item as PyObject;
89 dic[market] = markets[item];
92 (markets as PyObject).Dispose();
142 if (!PyTuple.IsTupleType(result))
144 throw new ArgumentException($
@"{(Instance as dynamic).__class__.__name__}.CanSubmitOrder(): Must return a tuple value where the first value is a bool and the second a BrokerageMessageEvent");
148 return result[0].As<
bool>();
168 if (!PyTuple.IsTupleType(result))
170 throw new ArgumentException($
@"{(Instance as dynamic).__class__.__name__}.CanUpdateOrder(): Must return a tuple value where the first value is a bool and the second a BrokerageMessageEvent");
174 return result[0].As<
bool>();
188 if (benchmark.TryConvert<
IBenchmark>(out var csharpBenchmark))
190 return csharpBenchmark;
206 if (feeModel.TryConvert<
IFeeModel>(out var csharpFeeModel))
208 return csharpFeeModel;
224 if (fillModel.TryConvert<
IFillModel>(out var csharpFillModel))
226 return csharpFillModel;
239 return InvokeMethod<decimal>(nameof(
GetLeverage), security);
252 if (settlementModel.TryConvert<
ISettlementModel>(out var csharpSettlementModel))
254 return csharpSettlementModel;
266 [Obsolete(
"Flagged deprecated and will remove December 1st 2018")]
269 return InvokeMethod<ISettlementModel>(nameof(
GetSettlementModel), security, accountType);
282 if (slippageModel.TryConvert<
ISlippageModel>(out var csharpSlippageModel))
284 return csharpSlippageModel;
299 return InvokeMethod<bool>(nameof(
Shortable), algorithm, symbol, quantity);
313 if (buyingPowerModel.TryConvert<
IBuyingPowerModel>(out var csharpBuyingPowerModel))
315 return csharpBuyingPowerModel;
327 [Obsolete(
"Flagged deprecated and will remove December 1st 2018")]
330 return InvokeMethod<IBuyingPowerModel>(nameof(
GetBuyingPowerModel), security, accountType);
342 if (shortableProvider.TryConvert<
IShortableProvider>(out var csharpShortableProvider))
344 return csharpShortableProvider;
374 return csharpBuyingPowerModel;