/// <summary> /// Constructor for the Crypto security /// </summary> /// <param name="symbol">The security's 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> public Crypto(Symbol symbol, SecurityExchangeHours exchangeHours, Cash quoteCurrency, SymbolProperties symbolProperties) : base(symbol, quoteCurrency, symbolProperties, new CryptoExchange(exchangeHours), new ForexCache(), new SecurityPortfolioModel(), new ImmediateFillModel(), new ConstantFeeModel(0), new ConstantSlippageModel(0), new ImmediateSettlementModel(), Securities.VolatilityModel.Null, new SecurityMarginModel(50m), new ForexDataFilter(), new SecurityPriceVariationModel() ) { Holdings = new CryptoHolding(this); // decompose the symbol into each currency pair string baseCurrencySymbol, quoteCurrencySymbol; Forex.Forex.DecomposeCurrencyPair(symbol.Value, out baseCurrencySymbol, out quoteCurrencySymbol); BaseCurrencySymbol = baseCurrencySymbol; }
/// <summary> /// Constructor for the Crypto security /// </summary> /// <param name="symbol">The security's 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> /// <param name="securityCache">Cache to store <see cref="Security"/> data</param> public Crypto(Symbol symbol, SecurityExchangeHours exchangeHours, Cash quoteCurrency, SymbolProperties symbolProperties, ICurrencyConverter currencyConverter, IRegisteredSecurityDataTypesProvider registeredTypes, SecurityCache securityCache) : base(symbol, quoteCurrency, symbolProperties, new CryptoExchange(exchangeHours), securityCache, new SecurityPortfolioModel(), new ImmediateFillModel(), new GDAXFeeModel(), new ConstantSlippageModel(0), new ImmediateSettlementModel(), Securities.VolatilityModel.Null, new CashBuyingPowerModel(), new ForexDataFilter(), new SecurityPriceVariationModel(), currencyConverter, registeredTypes ) { Holdings = new CryptoHolding(this, currencyConverter); // decompose the symbol into each currency pair string quoteCurrencySymbol, baseCurrencySymbol; DecomposeCurrencyPair(symbol, symbolProperties, out baseCurrencySymbol, out quoteCurrencySymbol); BaseCurrencySymbol = baseCurrencySymbol; }
/// <summary> /// Constructor for the Crypto 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> /// <param name="currencyConverter">Currency converter used to convert <see cref="CashAmount"/> /// instances into units of the account currency</param> public Crypto(SecurityExchangeHours exchangeHours, Cash quoteCurrency, SubscriptionDataConfig config, SymbolProperties symbolProperties, ICurrencyConverter currencyConverter) : base(config, quoteCurrency, symbolProperties, new CryptoExchange(exchangeHours), new ForexCache(), new SecurityPortfolioModel(), new ImmediateFillModel(), new GDAXFeeModel(), new ConstantSlippageModel(0), new ImmediateSettlementModel(), Securities.VolatilityModel.Null, new CashBuyingPowerModel(), new ForexDataFilter(), new SecurityPriceVariationModel(), currencyConverter ) { Holdings = new CryptoHolding(this, currencyConverter); // decompose the symbol into each currency pair string baseCurrencySymbol, quoteCurrencySymbol; Forex.Forex.DecomposeCurrencyPair(config.Symbol.Value, out baseCurrencySymbol, out quoteCurrencySymbol); BaseCurrencySymbol = baseCurrencySymbol; }