public void ComparesAgainstExternalDataAfterReset()
        {
            var rocr = new RateOfChangeRatio("ROCR", 5);

            RunTestIndicator(rocr);
            rocr.Reset();
            RunTestIndicator(rocr);
        }
Beispiel #2
0
 public override void Initialize()
 {
     SetStartDate(2013, 10, 07);  //Set Start Date
     SetEndDate(2013, 10, 11);    //Set End Date
     SetCash(100000);             //Set Strategy Cash
     // Find more symbols here: http://quantconnect.com/data
     AddEquity("SPY", Resolution.Second);
     Securities["SPY"].FeeModel = new ConstantFeeTransactionModel((decimal)0);
     _rateOfChangeRatio         = ROCR("SPY", 1, Resolution.Minute);
 }
 private static void RunTestIndicator(RateOfChangeRatio rocr)
 {
     TestHelper.TestIndicator(rocr, "spy_rocr.txt", "ROCR_5", (ind, expected) => Assert.AreEqual(expected, (double)ind.Current.Value, 1e-6));
 }
 public void ResetsProperly()
 {
     var rocr = new RateOfChangeRatio("ROCR", 5);
 
     TestHelper.TestIndicatorReset(rocr, "spy_rocr.txt");
 }