예제 #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.");
            }
        }
예제 #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);
 }
예제 #3
0
파일: Cfd.cs 프로젝트: 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);
 }
예제 #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);
 }
예제 #5
0
파일: Cfd.cs 프로젝트: aajtodd/Lean
 /// <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);
 }
예제 #6
0
파일: Cfd.cs 프로젝트: ztwaker/Lean
 /// <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);
 }
예제 #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);
 }
예제 #8
0
파일: Cfd.cs 프로젝트: pmerrill/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,
                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.");
        }