public IndicatorsInputs(databasemarkethistoryfilter database, int historiesLength)
        {
            StartingIndex     = 0;
            OutputArrayLength = historiesLength;

            if (database.HistoryIsCustom)
            {
                StartingIndex = database.ManualStartingIndex;
                int boundsToSubtract = (historiesLength > database.CurrentHistory.Count) ? historiesLength - database.CurrentHistory.Count : 0;
                OutputArrayLength = historiesLength - boundsToSubtract; //use historiesLength as long as it is smaller than custom history
            }
            EndIndex = OutputArrayLength - 1;
        }
Пример #2
0
        public TaLibTester()
        {
            FakeDataBase = new databasemarkethistoryfilter();
            var rng = new Random();

            for (int i = 0; i < HistoriesLength; i++)
            {
                FakeDataBase.CurrentHistory.Add(
                    new GraphBar(
                        rng.NextDouble(),
                        rng.NextDouble(),
                        rng.NextDouble(),
                        rng.NextDouble(),
                        rng.NextDouble(),
                        DateTime.UtcNow));
            }

            OpeningPrices = FakeDataBase.CurrentHistory
                            .Select(bar => bar.OpeningPrice)
                            .ToArray();

            ClosingPrices = FakeDataBase.CurrentHistory
                            .Select(bar => bar.ClosingPrice)
                            .ToArray();

            PriceHighs = FakeDataBase.CurrentHistory
                         .Select(bar => bar.PriceHigh)
                         .ToArray();

            PriceLows = FakeDataBase.CurrentHistory
                        .Select(bar => bar.PriceLow)
                        .ToArray();

            Volumes = FakeDataBase.CurrentHistory
                      .Select(bar => bar.Volume)
                      .ToArray();

            PeriodsPerPrices = ClosingPrices
                               .Select(close => rng.NextDouble())
                               .ToArray();
        }
Пример #3
0
 public Volatilities(databasemarkethistoryfilter databaseInstance)
 {
     database = databaseInstance;
 }
Пример #4
0
 public OverlapStudies(databasemarkethistoryfilter databaseInstance)
 {
     database = databaseInstance;
 }
Пример #5
0
 public Statistics(databasemarkethistoryfilter databaseInstance)
 {
     database = databaseInstance;
 }
 public PriceTransforms(databasemarkethistoryfilter databaseInstance)
 {
     database = databaseInstance;
 }
 public Cycles(databasemarkethistoryfilter databaseInstance)
 {
     database = databaseInstance;
 }
Пример #8
0
 public Momentums(databasemarkethistoryfilter databaseInstance)
 {
     database = databaseInstance;
 }