public void GetCustomDataLeverageTest() { var dummy = new Security( SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork), new SubscriptionDataConfig( typeof(TradeBar), QuantConnect.Symbol.Create("DUMMY", SecurityType.Base, Market.Bitfinex), Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, false, false, false ), new Cash(Currencies.USD, 0, 1m), SymbolProperties.GetDefault(Currencies.USD), ErrorCurrencyConverter.Instance, RegisteredSecurityDataTypesProvider.Null, new SecurityCache() ); var model = new BitfinexBrokerageModel(); Assert.AreEqual(1M, model.GetLeverage(dummy)); }
public void GetEquityLeverage_ThrowsArgumentException_Test() { var equity = new Security( SecurityExchangeHours.AlwaysOpen(TimeZones.NewYork), new SubscriptionDataConfig( typeof(TradeBar), Symbols.SPY, Resolution.Minute, TimeZones.NewYork, TimeZones.NewYork, false, false, false ), new Cash(Currencies.USD, 0, 1m), SymbolProperties.GetDefault(Currencies.USD), ErrorCurrencyConverter.Instance, RegisteredSecurityDataTypesProvider.Null, new SecurityCache() ); var model = new BitfinexBrokerageModel(); Assert.Throws <ArgumentException>(() => model.GetLeverage(equity)); }
public void GetCashBuyingPowerModelTest() { BitfinexBrokerageModel model = new BitfinexBrokerageModel(AccountType.Cash); Assert.IsInstanceOf <CashBuyingPowerModel>(model.GetBuyingPowerModel(Security)); Assert.AreEqual(1, model.GetLeverage(Security)); }
public void GetSecurityMarginModelTest() { BitfinexBrokerageModel model = new BitfinexBrokerageModel(AccountType.Margin); Assert.IsInstanceOf <SecurityMarginModel>(model.GetBuyingPowerModel(Security)); Assert.AreEqual(3.3M, model.GetLeverage(Security)); }
public void GetFeeModelTest() { BitfinexBrokerageModel model = new BitfinexBrokerageModel(); Assert.IsInstanceOf <BitfinexFeeModel>(model.GetFeeModel(Security)); }