public void SetUp()
 {
     _dataLoader           = SystemDataLoaderUtils.CreateSubstitute(PricesCount, LastDate);
     _commission           = CommissionUtils.CreateSubstitute();
     _slippage             = SlippageUtils.CreateSusbstitute();
     TestObj               = new PositionsRebalancer(_dataLoader, _commission, _slippage);
     _openPriceLevelCalled = false;
 }
        public void SetUp()
        {
            _dataProvider = StockDataProviderUtils.CreateSubstitute(DateTime.MinValue);
            _dataLoader   = SystemDataLoaderUtils.CreateSubstitute(2 * BackBufRange, BackBufRange, DateTime.Now.Date);
            TestObj       = new StocksDataPreloader(_dataProvider, _dataLoader);

            _stat = new StockStatMock("", BackBufRange);
        }
 public void SetUp()
 {
     _dataLoader               = SystemDataLoaderUtils.CreateSubstitute(PricesCount, LastDate);
     _commission               = CommissionUtils.CreateSubstitute();
     _slippage                 = SlippageUtils.CreateSusbstitute();
     TestObj                   = new PositionsCloser(_dataLoader, _commission, _slippage);
     _positionSelectorCalled   = false;
     _closePriceSelectorCalled = false;
 }
示例#4
0
 public void SetUp()
 {
     _dataLoader           = SystemDataLoaderUtils.CreateSubstitute(PricesCount, LastDate);
     _commission           = CommissionUtils.CreateSubstitute();
     _slippage             = SlippageUtils.CreateSusbstitute();
     TestObj               = new SignalsProcessor(_dataLoader, _commission, _slippage);
     _signalSelectorCalled = false;
     _openPriceLevelCalled = false;
 }
        public void SetUp()
        {
            _dataProvider           = StockDataProviderUtils.CreateSubstitute(DateTime.MinValue);
            _dataLoader             = SystemDataLoaderUtils.CreateSubstituteWithConstantPriceInRange(PricesCount, StartingPrice, PriceRange, LastDate);
            _dataDefinitionProvider = Substitute.For <ISystemDataDefinitionProvider>();
            _signalGeneratorOnOpen  = Substitute.For <ISignalGeneratorOnOpen>();
            _signalGeneratorOnClose = Substitute.For <ISignalGeneratorOnClose>();
            _commission             = CommissionUtils.CreateSubstitute();
            _slippage = SlippageUtils.CreateSusbstitute();
            _mmPositionCloseCalculator = Substitute.For <IMMPositionCloseCalculator>();
            _systemState = new SystemState()
            {
                Cash = InitialCash
            };

            _slippage.CalculateOpen(default, default, default, default).ReturnsForAnyArgs(args => args.ArgAt <float>(3));
 public void SetUp()
 {
     _stock = new StockDefinition()
     {
         Type = StockType.Stock
     };
     _stock2  = new StockDefinition();
     _testObj = new SystemState()
     {
         Cash = CashValue
     };
     _stockPrices      = new StockPricesData(1);
     _dataLoader       = SystemDataLoaderUtils.CreateSubstitute(_stockPrices);
     _commission       = CommissionUtils.CreateSubstitute(Commission);
     _slippage         = SlippageUtils.CreateSusbstitute();
     EntrySignal.Stock = _stock;
 }