Esempio n. 1
0
        private StochArray ConvertReturns(StochArray returnsArray, Func <double, double, double> converter)
        {
            var currencyReturns = GetCurrencyReturns(Accumulation.Annualised);

            int sim    = MaxSim;
            int hor    = MaxHorizon;
            var result = new double[sim][];

            for (int i = 0; i < sim; i++)
            {
                var simReturns = new double[hor];
                for (int j = 0; j < hor; j++)
                {
                    simReturns[j] = converter(currencyReturns[i][j], returnsArray[i][j]);
                }
                result[i] = simReturns;
            }

            return(new StochArray(result));
        }
Esempio n. 2
0
 public StochArray GetGBPStochArrayReturns(StochArray localReturnsStochArray) =>
 ConvertReturns(localReturnsStochArray, _convertFromLocalToGBP);
Esempio n. 3
0
 public StochArray GetLocalStochArrayReturns(StochArray gbpReturnsStochArray) =>
 ConvertReturns(gbpReturnsStochArray, _convertFromGBPToLocal);