コード例 #1
0
ファイル: Forex.cs プロジェクト: intelliBrain/Lean
 /********************************************************
 * 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();
 }
コード例 #2
0
ファイル: Forex.cs プロジェクト: tradecraft/Lean
        /********************************************************
         * 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();
        }
コード例 #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();
        }
コード例 #4
0
ファイル: Forex.cs プロジェクト: sopnic/Lean
        /********************************************************
        * 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;
        }
コード例 #5
0
ファイル: Forex.cs プロジェクト: tuddman/Lean
        /********************************************************
         * 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;
        }
コード例 #6
0
ファイル: Forex.cs プロジェクト: 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;
        }
コード例 #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;
        }