/// <summary> /// Initializes a new instance of the <see cref="ConsistentChangeStockFilter"/> class. /// </summary> /// <param name="stockHistoryProvider">The stock history provider.</param> /// <param name="periods">The periods used to reach a decision as to whether or not the stock is an investment candidate</param> public ConsistentChangeStockFilter(IStockHistoryDataProvider stockHistoryProvider, int periods) { Condition.Requires(stockHistoryProvider).IsNotNull(); Condition.Requires(periods).IsGreaterThan(1); this._stockHistoryProvider = stockHistoryProvider; this._periods = periods; }
/// <summary> /// Initializes a new instance of the <see cref="ConsistentChangeStockFilter"/> class. /// </summary> /// <param name="stockHistoryProvider">The stock history provider.</param> /// <param name="periods">The periods used to reach a decision as to whether or not the stock is an investment candidate</param> /// <param name="reductionRate">The minimum rate by which the stock price must have fallen</param> /// <param name="growthRate">The minimum rate by which the stock price must have risen.</param> public MinimumRateOfChangeStockFilter(IStockHistoryDataProvider stockHistoryProvider, int periods, decimal reductionRate, decimal growthRate) { Condition.Requires(stockHistoryProvider).IsNotNull(); Condition.Requires(reductionRate).IsGreaterThan(0); Condition.Requires(growthRate).IsGreaterThan(0); Condition.Requires(periods).IsGreaterThan(1); this._stockHistoryProvider = stockHistoryProvider; this._reductionRate = reductionRate; this._growthRate = growthRate; this._periods = periods; }
/// <summary> /// Initializes a new instance of the <see cref="DecisionByGrowthAndCurrentPosition"/> class. /// </summary> /// <param name="stockHistoryDataProvider">The stock history data provider.</param> /// <param name="accountDataProvider">The account data provider.</param> /// <param name="periods">The periods number of periods over which to measure stock growth</param> /// <param name="bidAmount">The bid amount.</param> /// <param name="maxSpreadLoss">The maximum amount of money we are willing to loose when opening our position based on the stocks spread</param> public DecisionByGrowthAndCurrentPosition( IStockHistoryDataProvider stockHistoryDataProvider, IAccountDataProvider accountDataProvider, int periods, decimal maxBidAmount, decimal maxSpreadLoss) { Condition.Requires(stockHistoryDataProvider).IsNotNull(); Condition.Requires(_accountDataProvider).IsNotNull(); Condition.Requires(periods).IsGreaterThan(0); Condition.Requires(maxBidAmount).IsGreaterThan(0); Condition.Requires(maxSpreadLoss).IsGreaterThan(0); this._stockHistoryProvider = stockHistoryDataProvider; this._accountDataProvider = accountDataProvider; this._periods = periods; this._maxBidAmount = maxBidAmount; this._maxSpreadLoss = maxSpreadLoss; }