/// <summary> /// Constructor for the Future security /// </summary> /// <param name="symbol">The subscription security symbol</param> /// <param name="exchangeHours">Defines the hours this exchange is open</param> /// <param name="quoteCurrency">The cash object that represent the quote currency</param> /// <param name="symbolProperties">The symbol properties for this security</param> /// <param name="currencyConverter">Currency converter used to convert <see cref="CashAmount"/> /// instances into units of the account currency</param> /// <param name="registeredTypes">Provides all data types registered in the algorithm</param> public Future(Symbol symbol, SecurityExchangeHours exchangeHours, Cash quoteCurrency, SymbolProperties symbolProperties, ICurrencyConverter currencyConverter, IRegisteredSecurityDataTypesProvider registeredTypes, SecurityCache securityCache ) : base(symbol, quoteCurrency, symbolProperties, new FutureExchange(exchangeHours), securityCache, new SecurityPortfolioModel(), new ImmediateFillModel(), new InteractiveBrokersFeeModel(), new ConstantSlippageModel(0), new ImmediateSettlementModel(), Securities.VolatilityModel.Null, new FutureMarginModel(), new SecurityDataFilter(), new SecurityPriceVariationModel(), currencyConverter, registeredTypes ) { // for now all futures are cash settled as we don't allow underlying (Live Cattle?) to be posted on the account SettlementType = SettlementType.Cash; Holdings = new FutureHolding(this, currencyConverter); _symbolProperties = symbolProperties; SetFilter(TimeSpan.Zero, TimeSpan.FromDays(35)); }
/// <summary> /// Constructor for the Future security /// </summary> /// <param name="exchangeHours">Defines the hours this exchange is open</param> /// <param name="quoteCurrency">The cash object that represent the quote currency</param> /// <param name="config">The subscription configuration for this security</param> /// <param name="symbolProperties">The symbol properties for this security</param> public Future(SecurityExchangeHours exchangeHours, SubscriptionDataConfig config, Cash quoteCurrency, SymbolProperties symbolProperties) : base(config, quoteCurrency, symbolProperties, new FutureExchange(exchangeHours), new FutureCache(), new SecurityPortfolioModel(), new ImmediateFillModel(), new InteractiveBrokersFeeModel(), new ConstantSlippageModel(0), new ImmediateSettlementModel(), Securities.VolatilityModel.Null, new FutureMarginModel(), new SecurityDataFilter(), new SecurityPriceVariationModel() ) { // for now all futures are cash settled as we don't allow underlying (Live Cattle?) to be posted on the account SettlementType = SettlementType.Cash; Holdings = new FutureHolding(this); _symbolProperties = symbolProperties; SetFilter(TimeSpan.Zero, TimeSpan.FromDays(35)); }