Exemple #1
0
        /********************************************************
         * CONSTRUCTOR/DELEGATE DEFINITIONS
         *********************************************************/
        /// <summary>
        /// Construct the Market Vehicle
        /// </summary>
        public Security(string symbol, SecurityType type, Resolution resolution, bool fillDataForward, decimal leverage, bool extendedMarketHours)
        {
            //Set Basics:
            this._symbol                = symbol;
            this._type                  = type;
            this._resolution            = resolution;
            this._isFillDataForward     = fillDataForward;
            this._leverage              = leverage;
            this._isExtendedMarketHours = extendedMarketHours;

            //Holdings for new Vehicle:
            Cache    = new SecurityCache();
            Holdings = new SecurityHolding(symbol, Model);
            Exchange = new SecurityExchange();

            //Cannot initalise a default model.
            Model = null;

            //Set data type:
            if (resolution == Resolution.Minute || resolution == Resolution.Second)
            {
                _dataType = typeof(TradeBar);
            }
            else
            {
                _dataType = typeof(Tick);
            }
        }
        /******************************************************** 
        * CONSTRUCTOR DEFINITION
        *********************************************************/

        /// <summary>
        /// Create a new holding class instance setting the initial properties to $0.
        /// </summary>
        /// <param name="security">The security being held</param>
        /// <param name="transactionModel">The transaction model used for the security</param>
        /// <param name="marginModel">The margin model used for the security</param>
        public SecurityHolding(Security security, ISecurityTransactionModel transactionModel, ISecurityMarginModel marginModel)
        {
            _security = security;
            TransactionModel = transactionModel;
            MarginModel = marginModel;
            //Total Sales Volume for the day
            _totalSaleVolume = 0;
            _lastTradeProfit = 0;
        }
        /********************************************************
        * CONSTRUCTOR/DELEGATE DEFINITIONS
        *********************************************************/
        /// <summary>
        /// Launch a new holding class with Trader Dealer:
        /// </summary>
        public SecurityHolding(string symbol, ISecurityTransactionModel transactionModel)
        {
            this._model = transactionModel;
            this._symbol = symbol;

            //Total Sales Volume for the day
            this._totalSaleVolume = 0;
            this._lastTradeProfit = 0;
        }
Exemple #4
0
        /******************************************************** 
        * CONSTRUCTOR DEFINITION
        *********************************************************/
        /// <summary>
        /// Create a new holding class instance setting the initial properties to $0.
        /// </summary>
        public SecurityHolding(string symbol, ISecurityTransactionModel transactionModel)
        {
            _model = transactionModel;
            _symbol = symbol;

            //Total Sales Volume for the day
            _totalSaleVolume = 0;
            _lastTradeProfit = 0;
        }
Exemple #5
0
        /******************************************************** 
        * CONSTRUCTOR DEFINITION
        *********************************************************/

        /// <summary>
        /// Create a new holding class instance setting the initial properties to $0.
        /// </summary>
        public SecurityHolding(string symbol, SecurityType type, decimal leverage, ISecurityTransactionModel transactionModel)
        {
            _model = transactionModel;
            _symbol = symbol;
            _leverage = leverage;
            _securityType = type;
            //Total Sales Volume for the day
            _totalSaleVolume = 0;
            _lastTradeProfit = 0;
        }
Exemple #6
0
        /// <summary>
        /// Create a new holding class instance setting the initial properties to $0.
        /// </summary>
        public SecurityHolding(string symbol, SecurityType type, ISecurityTransactionModel transactionModel)
        {
            _model = transactionModel;
            _symbol = symbol;
            _securityType = type;

            //Total Sales Volume for the day
            _totalSaleVolume = 0;
            _lastTradeProfit = 0;
        }
Exemple #7
0
        /******************************************************** 
        * CLASS VARIABLES
        *********************************************************/

        /******************************************************** 
        * CONSTRUCTOR/DELEGATE DEFINITIONS
        *********************************************************/

        /// <summary>
        /// Forex Holding Class
        /// </summary>
        public ForexHolding(string symbol, decimal leverage, ISecurityTransactionModel transactionModel)
            : base(symbol, SecurityType.Forex, leverage, transactionModel)
        {
            //Nothing to do.
        }
Exemple #8
0
 /// <summary>
 /// Constructor for equities holdings.
 /// </summary>
 /// <param name="security">The security being held</param>
 /// <param name="transactionModel">The transaction model used for the security</param>
 /// <param name="marginModel">The margin model used for the security</param>
 public EquityHolding(Security security, ISecurityTransactionModel transactionModel, ISecurityMarginModel marginModel)
     : base(security)
 {
 }
        /******************************************************** 
        * CLASS VARIABLES
        *********************************************************/

        /******************************************************** 
        * CONSTRUCTOR/DELEGATE DEFINITIONS
        *********************************************************/
        /// <summary>
        /// Equity Holding Class
        /// </summary>
        public EquityHolding(string symbol, ISecurityTransactionModel transactionModel) :
            base(symbol, transactionModel)
        {
        }
Exemple #10
0
        /******************************************************** 
        * CONSTRUCTOR DEFINITION
        *********************************************************/

        /// <summary>
        /// Create a new holding class instance setting the initial properties to $0.
        /// </summary>
        public SecurityHolding(string symbol, ISecurityTransactionModel transactionModel)
            : this(symbol, SecurityType.Equity, transactionModel)
        {
        }
Exemple #11
0
        /********************************************************
         * CLASS VARIABLES
         *********************************************************/

        /********************************************************
         * CONSTRUCTOR/DELEGATE DEFINITIONS
         *********************************************************/

        /// <summary>
        /// Constructor for equities holdings.
        /// </summary>
        /// <param name="security">The security being held</param>
        /// <param name="transactionModel">The transaction model used for the security</param>
        /// <param name="marginModel">The margin model used for the security</param>
        public EquityHolding(Security security, ISecurityTransactionModel transactionModel, ISecurityMarginModel marginModel)
            : base(security)
        {
        }
Exemple #12
0
 /// <summary>
 /// Forex Holding Class
 /// </summary>
 /// <param name="security">The forex security being held</param>
 /// <param name="transactionModel">The transaction model used for the security</param>
 /// <param name="marginModel">The margin model used for the security</param>
 public ForexHolding(Forex security, ISecurityTransactionModel transactionModel, ISecurityMarginModel marginModel)
     : base(security)
 {
     _forex = security;
 }
Exemple #13
0
        /******************************************************** 
        * CLASS VARIABLES
        *********************************************************/

        /******************************************************** 
        * CONSTRUCTOR/DELEGATE DEFINITIONS
        *********************************************************/

        /// <summary>
        /// Constructor for equities holdings.
        /// </summary>
        public EquityHolding(string symbol, decimal leverage, ISecurityTransactionModel transactionModel)
            : base(symbol, SecurityType.Equity, leverage,  transactionModel)
        {
        }
Exemple #14
0
 /********************************************************
 * CONSTRUCTOR DEFINITION
 *********************************************************/
 /// <summary>
 /// Create a new holding class instance setting the initial properties to $0.
 /// </summary>
 public SecurityHolding(string symbol, ISecurityTransactionModel transactionModel)
     : this(symbol, SecurityType.Equity, transactionModel)
 {
 }
Exemple #15
0
 /********************************************************
 * CONSTRUCTOR/DELEGATE DEFINITIONS
 *********************************************************/
 /// <summary>
 /// Forex Holding Class
 /// </summary>
 /// <param name="security">The forex security being held</param>
 /// <param name="transactionModel">The transaction model used for the security</param>
 /// <param name="marginModel">The margin model used for the security</param>
 public ForexHolding(Forex security, ISecurityTransactionModel transactionModel, ISecurityMarginModel marginModel)
     : base(security)
 {
     _forex = security;
 }
Exemple #16
0
        /******************************************************** 
        * CLASS VARIABLES
        *********************************************************/


        /******************************************************** 
        * CONSTRUCTOR/DELEGATE DEFINITIONS
        *********************************************************/
        /// <summary>
        /// Forex Holding Class
        /// </summary>
        public ForexHolding(string symbol, ISecurityTransactionModel transactionModel) :
            base(symbol, transactionModel)
        {
            //Nothing to do.
        }