public void PairMarketDataRegressionMainTest()
        {
            const int kRegressionSec = 10;
            const int kMinDataCount = 5;
            const int kBufferSize = 10;
            IPairMarketDataRegressionPolicy policy = new RegressionPolicyDefault();

            PairMarketDataRegression regression = new PairMarketDataRegression(
                kRegressionSec, kMinDataCount, kBufferSize, policy);
            PairMarketDataRegression_Accessor acc = new PairMarketDataRegression_Accessor(
                new PrivateObject(regression));

            EmptyTest(acc);
            OneDataTest(acc);
            TwoDataTest(acc);
            FiveDataTest(acc);
            TenDataTest(acc);
            ChangeSlopeTest(acc);
        }
Example #2
0
        void LoadPeriodicMarketData(DateTime targetDate)
        {
            String KTB_SPOT_PATH = String.Format("{0}{1}_38000_ktb_spot_market_data_{2}_period.txt",
                PATH,
                targetDate.ToString("yyyy_MM_dd"),
                SPOT_10YR);

            String KTB_FUTURE_PATH = String.Format("{0}{1}_25412_future_market_data_{2}_period.txt",
                PATH,
                targetDate.ToString("yyyy_MM_dd"),
                FUTURE_10YR);

            _dataSpot10yr = new PeriodicMarketDataCollection(KTB_SPOT_PATH);
            _dataFuture10yr = new PeriodicMarketDataCollection(KTB_FUTURE_PATH);

            _regression = new PairMarketDataRegression(
                60 * 60 * 6,
                1000,
                60 * 60 * 6 * 3,
                new RegressionPolicyDefault());
        }
 public void Register(PairMarketDataRegression regression, ref RawMarketData rmdY, ref RawMarketData rmdX)
 {
     Datum datum = new Datum(regression, rmdY, rmdX);
     _data.Add(datum);
 }
 public Datum(PairMarketDataRegression regression,
     RawMarketData rmdY, RawMarketData rmdX)
 {
     this.Regression = regression;
     this.RmdY = rmdY;
     this.RmdX = rmdX;
 }