Exemplo n.º 1
0
        /********************************************************
         * CLASS VARIABLES
         *********************************************************/


        /********************************************************
         * CONSTRUCTOR/DELEGATE DEFINITIONS
         *********************************************************/
        /// <summary>
        /// Constructor for the forex security
        /// </summary>
        public Forex(string symbol, Resolution resolution, bool fillDataForward, decimal leverage, bool extendedMarketHours, bool isDynamicallyLoadedData = false) :
            base(symbol, SecurityType.Forex, resolution, fillDataForward, leverage, extendedMarketHours, isDynamicallyLoadedData)
        {
            //Holdings for new Vehicle:
            Cache    = new ForexCache();
            Holdings = new ForexHolding(symbol, this.Model);
            Exchange = new ForexExchange();
            Model    = new ForexTransactionModel();
        }
Exemplo n.º 2
0
 /********************************************************
 * CLASS VARIABLES
 *********************************************************/
 /********************************************************
 * CONSTRUCTOR/DELEGATE DEFINITIONS
 *********************************************************/
 /// <summary>
 /// Constructor for the forex security
 /// </summary>
 public Forex(string symbol, Resolution resolution, bool fillDataForward, decimal leverage, bool extendedMarketHours, bool isDynamicallyLoadedData = false)
     : base(symbol, SecurityType.Forex, resolution, fillDataForward, leverage, extendedMarketHours, isDynamicallyLoadedData)
 {
     //Holdings for new Vehicle:
     Cache = new ForexCache();
     Holdings = new ForexHolding(symbol, this.Model);
     Exchange = new ForexExchange();
     Model = new ForexTransactionModel();
 }
Exemplo n.º 3
0
        /********************************************************
         * CLASS VARIABLES
         *********************************************************/


        /********************************************************
         * CONSTRUCTOR/DELEGATE DEFINITIONS
         *********************************************************/
        /// <summary>
        /// Constructor for the forex security
        /// </summary>
        public Forex(string symbol, SubscriptionDataConfig config, decimal leverage, bool isDynamicallyLoadedData = false)
            : base(symbol, config, leverage, isDynamicallyLoadedData)
        {
            //Holdings for new Vehicle:
            Cache    = new ForexCache();
            Holdings = new ForexHolding(symbol, leverage, this.Model);
            Exchange = new ForexExchange();
            Model    = new ForexTransactionModel();
        }
Exemplo n.º 4
0
        /// <summary>
        /// Constructor for the forex security
        /// </summary>
        /// <param name="quoteCurrency">The cash object that represent the quote currency</param>
        /// <param name="config">The subscription configuration for this security</param>
        /// <param name="leverage">The leverage used for this security</param>
        /// <param name="isDynamicallyLoadedData">True for custom data, false otherwise</param>
        public Forex(Cash quoteCurrency, SubscriptionDataConfig config, decimal leverage, bool isDynamicallyLoadedData = false)
            : base(config, leverage, isDynamicallyLoadedData)
        {
            QuoteCurrency = quoteCurrency;
            //Holdings for new Vehicle:
            Cache = new ForexCache();
            Exchange = new ForexExchange();
            DataFilter = new ForexDataFilter();
            TransactionModel = new ForexTransactionModel();
            PortfolioModel = new ForexPortfolioModel();
            MarginModel = new ForexMarginModel(leverage);
            Holdings = new ForexHolding(this, TransactionModel, MarginModel);

            // decompose the symbol into each currency pair
            string baseCurrencySymbol, quoteCurrencySymbol;
            DecomposeCurrencyPair(config.Symbol, out baseCurrencySymbol, out quoteCurrencySymbol);
            BaseCurrencySymbol = baseCurrencySymbol;
            QuoteCurrencySymbol = quoteCurrencySymbol;
        }
Exemplo n.º 5
0
        /********************************************************
         * CLASS VARIABLES
         *********************************************************/

        /********************************************************
         * CONSTRUCTOR/DELEGATE DEFINITIONS
         *********************************************************/
        /// <summary>
        /// Constructor for the forex security
        /// </summary>
        /// <param name="quoteCurrency">The cash object that represent the quote currency</param>
        /// <param name="config">The subscription configuration for this security</param>
        /// <param name="leverage">The leverage used for this security</param>
        /// <param name="isDynamicallyLoadedData">True for custom data, false otherwise</param>
        public Forex(Cash quoteCurrency, SubscriptionDataConfig config, decimal leverage, bool isDynamicallyLoadedData = false)
            : base(config, leverage, isDynamicallyLoadedData)
        {
            QuoteCurrency = quoteCurrency;
            //Holdings for new Vehicle:
            Cache            = new ForexCache();
            Exchange         = new ForexExchange();
            DataFilter       = new ForexDataFilter();
            TransactionModel = new ForexTransactionModel();
            PortfolioModel   = new ForexPortfolioModel();
            MarginModel      = new ForexMarginModel(leverage);
            Holdings         = new ForexHolding(this, TransactionModel, MarginModel);

            // decompose the symbol into each currency pair
            string baseCurrencySymbol, quoteCurrencySymbol;

            DecomposeCurrencyPair(config.Symbol, out baseCurrencySymbol, out quoteCurrencySymbol);
            BaseCurrencySymbol  = baseCurrencySymbol;
            QuoteCurrencySymbol = quoteCurrencySymbol;
        }
Exemplo n.º 6
0
Arquivo: Forex.cs Projeto: skyfyl/Lean
        /// <summary>
        /// Constructor for the forex 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="leverage">The leverage used for this security</param>
        public Forex(SecurityExchangeHours exchangeHours, Cash quoteCurrency, SubscriptionDataConfig config, decimal leverage)
            : base(exchangeHours, config, leverage)
        {
            QuoteCurrency = quoteCurrency;
            //Holdings for new Vehicle:
            Cache = new ForexCache();
            Exchange = new ForexExchange(exchangeHours); 
            DataFilter = new ForexDataFilter();
            TransactionModel = new ForexTransactionModel();
            PortfolioModel = new ForexPortfolioModel();
            MarginModel = new ForexMarginModel(leverage);
            SettlementModel = new ImmediateSettlementModel();
            Holdings = new ForexHolding(this);

            // decompose the symbol into each currency pair
            string baseCurrencySymbol, quoteCurrencySymbol;
            DecomposeCurrencyPair(config.Symbol.Value, out baseCurrencySymbol, out quoteCurrencySymbol);
            BaseCurrencySymbol = baseCurrencySymbol;
            QuoteCurrencySymbol = quoteCurrencySymbol;
        }
Exemplo n.º 7
0
        /// <summary>
        /// Constructor for the forex 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="leverage">The leverage used for this security</param>
        public Forex(SecurityExchangeHours exchangeHours, Cash quoteCurrency, SubscriptionDataConfig config, decimal leverage)
            : base(exchangeHours, config, leverage)
        {
            QuoteCurrency = quoteCurrency;
            //Holdings for new Vehicle:
            Cache            = new ForexCache();
            Exchange         = new ForexExchange(exchangeHours);
            DataFilter       = new ForexDataFilter();
            TransactionModel = new ForexTransactionModel();
            PortfolioModel   = new ForexPortfolioModel();
            MarginModel      = new ForexMarginModel(leverage);
            Holdings         = new ForexHolding(this);

            // decompose the symbol into each currency pair
            string baseCurrencySymbol, quoteCurrencySymbol;

            DecomposeCurrencyPair(config.Symbol.Value, out baseCurrencySymbol, out quoteCurrencySymbol);
            BaseCurrencySymbol  = baseCurrencySymbol;
            QuoteCurrencySymbol = quoteCurrencySymbol;
        }