Beispiel #1
0
        /// <summary>
        /// Constructor for the CFD 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 Cfd(SecurityExchangeHours exchangeHours, Cash quoteCurrency, SubscriptionDataConfig config, SymbolProperties symbolProperties)
            : base(config,
                   new CfdExchange(exchangeHours),
                   new CfdCache(),
                   new CfdPortfolioModel(),
                   new ImmediateFillModel(),
                   new ConstantFeeModel(0),
                   new SpreadSlippageModel(),
                   new ImmediateSettlementModel(),
                   new CfdMarginModel(50m),
                   new CfdDataFilter()
                   )
        {
            QuoteCurrency    = quoteCurrency;
            Holdings         = new CfdHolding(this);
            SymbolProperties = symbolProperties;

            if (symbolProperties == null)
            {
                throw new ArgumentException("CFD requires a valid SymbolProperties argument");
            }

            if (symbolProperties.QuoteCurrency != quoteCurrency.Symbol)
            {
                throw new ArgumentException("CFD SymbolProperties.QuoteCurrency and QuoteCurrency.Symbol do not match.");
            }
        }
Beispiel #2
0
 /// <summary>
 /// Constructor for the CFD 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 for storing Security data</param>
 public Cfd(Symbol symbol,
            SecurityExchangeHours exchangeHours,
            Cash quoteCurrency,
            SymbolProperties symbolProperties,
            ICurrencyConverter currencyConverter,
            IRegisteredSecurityDataTypesProvider registeredTypes,
            SecurityCache securityCache)
     : base(symbol,
            quoteCurrency,
            symbolProperties,
            new CfdExchange(exchangeHours),
            securityCache,
            new SecurityPortfolioModel(),
            new ImmediateFillModel(),
            new ConstantFeeModel(0),
            new ConstantSlippageModel(0),
            new ImmediateSettlementModel(),
            Securities.VolatilityModel.Null,
            new SecurityMarginModel(50m),
            new CfdDataFilter(),
            new SecurityPriceVariationModel(),
            currencyConverter,
            registeredTypes
            )
 {
     Holdings = new CfdHolding(this, currencyConverter);
 }
Beispiel #3
0
Datei: Cfd.cs Projekt: neosb/Lean
 /// <summary>
 /// Constructor for the CFD 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 Cfd(SecurityExchangeHours exchangeHours, Cash quoteCurrency, SubscriptionDataConfig config, SymbolProperties symbolProperties)
     : base(config,
         quoteCurrency,
         symbolProperties,
         new CfdExchange(exchangeHours),
         new CfdCache(),
         new SecurityPortfolioModel(),
         new ImmediateFillModel(),
         new ConstantFeeModel(0),
         new SpreadSlippageModel(),
         new ImmediateSettlementModel(),
         new SecurityMarginModel(50m),
         new CfdDataFilter()
         )
 {
     Holdings = new CfdHolding(this);
 }
Beispiel #4
0
 /// <summary>
 /// Constructor for the CFD 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 Cfd(SecurityExchangeHours exchangeHours, Cash quoteCurrency, SubscriptionDataConfig config, SymbolProperties symbolProperties)
     : base(config,
            quoteCurrency,
            symbolProperties,
            new CfdExchange(exchangeHours),
            new CfdCache(),
            new SecurityPortfolioModel(),
            new ImmediateFillModel(),
            new ConstantFeeModel(0),
            new SpreadSlippageModel(),
            new ImmediateSettlementModel(),
            new SecurityMarginModel(50m),
            new CfdDataFilter()
            )
 {
     Holdings = new CfdHolding(this);
 }
Beispiel #5
0
 /// <summary>
 /// Constructor for the CFD 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 Cfd(Symbol symbol, SecurityExchangeHours exchangeHours, Cash quoteCurrency, SymbolProperties symbolProperties)
     : base(symbol,
         quoteCurrency,
         symbolProperties,
         new CfdExchange(exchangeHours),
         new CfdCache(),
         new SecurityPortfolioModel(),
         new ImmediateFillModel(),
         new ConstantFeeModel(0),
         new SpreadSlippageModel(),
         new ImmediateSettlementModel(),
         Securities.VolatilityModel.Null,
         new SecurityMarginModel(50m),
         new CfdDataFilter()
         )
 {
     Holdings = new CfdHolding(this);
 }
Beispiel #6
0
 /// <summary>
 /// Constructor for the CFD 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 Cfd(Symbol symbol, SecurityExchangeHours exchangeHours, Cash quoteCurrency, SymbolProperties symbolProperties)
     : base(symbol,
            quoteCurrency,
            symbolProperties,
            new CfdExchange(exchangeHours),
            new CfdCache(),
            new SecurityPortfolioModel(),
            new ImmediateFillModel(),
            new ConstantFeeModel(0),
            new SpreadSlippageModel(),
            new ImmediateSettlementModel(),
            Securities.VolatilityModel.Null,
            new SecurityMarginModel(50m),
            new CfdDataFilter()
            )
 {
     Holdings = new CfdHolding(this);
 }
Beispiel #7
0
 /// <summary>
 /// Constructor for the CFD 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 Cfd(SecurityExchangeHours exchangeHours, Cash quoteCurrency, SubscriptionDataConfig config, SymbolProperties symbolProperties, ICurrencyConverter currencyConverter)
     : base(config,
            quoteCurrency,
            symbolProperties,
            new CfdExchange(exchangeHours),
            new CfdCache(),
            new SecurityPortfolioModel(),
            new ImmediateFillModel(),
            new ConstantFeeModel(0),
            new ConstantSlippageModel(0),
            new ImmediateSettlementModel(),
            Securities.VolatilityModel.Null,
            new SecurityMarginModel(50m),
            new CfdDataFilter(),
            new SecurityPriceVariationModel(),
            currencyConverter
            )
 {
     Holdings = new CfdHolding(this);
 }
Beispiel #8
0
        /// <summary>
        /// Constructor for the CFD 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 Cfd(SecurityExchangeHours exchangeHours, Cash quoteCurrency, SubscriptionDataConfig config, SymbolProperties symbolProperties)
            : base(config,
                new CfdExchange(exchangeHours),
                new CfdCache(),
                new CfdPortfolioModel(),
                new ImmediateFillModel(),
                new ConstantFeeModel(0),
                new SpreadSlippageModel(),
                new ImmediateSettlementModel(),
                new CfdMarginModel(50m),
                new CfdDataFilter()
                )
        {
            QuoteCurrency = quoteCurrency;
            Holdings = new CfdHolding(this);
            SymbolProperties = symbolProperties;

            if (symbolProperties == null)
                throw new ArgumentException("CFD requires a valid SymbolProperties argument");

            if (symbolProperties.QuoteCurrency != quoteCurrency.Symbol)
                throw new ArgumentException("CFD SymbolProperties.QuoteCurrency and QuoteCurrency.Symbol do not match.");
        }