public void CanAnalyzeRSIRange()
        {
            var repo  = new MocAnalyseRepository();
            var task  = new AnalyzeRSIRangeTask(repo);
            var state = new DataState {
                Symbol = "AAPL", Last = new DateTime(2012, 4, 4)
            };
            var result = task.AnalyzeData(state);

            Assert.IsTrue(result != null);
            Assert.IsTrue(result.Symbol == "AAPL");
            Assert.IsTrue(result.Name == RSIRange.Name);
            Assert.IsTrue(result.Date.Year == 2012 && result.Date.Month == 4 && result.Date.Day == 4);

            /*
             * <Data>
             * <Min>31.62</Min>
             * <Max>82.39</Max>
             * <L5>39.96</L5>
             * <H5>75.06</H5>
             * <L10>42.93</L10>
             * <H10>74.08</H10>
             * <L15>45.75</L15>
             * <H15>70.41</H15>
             * </Data>
             */
        }
예제 #2
0
        public void CanAnalyzeRSI()
        {
            var repo  = new MocAnalyseRepository();
            var task  = new AnalyzeRSITask(repo);
            var state = new DataState {
                Symbol = "AAPL", Last = new DateTime(2012, 4, 4)
            };
            var result = task.AnalyzeData(state);

            Assert.IsTrue(result != null);
            Assert.IsTrue(result.Symbol == "AAPL");
            Assert.IsTrue(result.Name == RSI.Name);
            Assert.IsTrue(result.Date.Year == 2012 && result.Date.Month == 4 && result.Date.Day == 4);

            /*
             * <Data>
             * <PercentGT50>73.00</PercentGT50>
             * <Avg>57.71</Avg>
             * <LastRSI>75.53</LastRSI>
             * <TotalDays>352</TotalDays>
             * <MaxContGT50Days>72</MaxContGT50Days>
             * <AvgContGT50Days>10.28</AvgContGT50Days>
             * <MaxContLT50Days>11</MaxContLT50Days>
             * <AvgContLT50Days>3.80</AvgContLT50Days>
             * <LastContDays>17</LastContDays>
             * </Data>
             */
        }
예제 #3
0
        public void CanAnalyzeSMA()
        {
            var repo  = new MocAnalyseRepository();
            var task  = new AnalyzeSMATask(repo);
            var state = new DataState {
                Symbol = "AAPL", Last = new DateTime(2012, 4, 4)
            };
            var result = task.AnalyzeData(state);

            Assert.IsTrue(result != null);
            Assert.IsTrue(result.Symbol == "AAPL");
            Assert.IsTrue(result.Name == SMA.Name);
            Assert.IsTrue(result.Date.Year == 2012 && result.Date.Month == 4 && result.Date.Day == 4);

            /*
             * <Data>
             * <SMA50>114.55</SMA50>
             * <SMA200>102.95</SMA200>
             * </Data>
             */
        }
예제 #4
0
        public void CanAnalyzeRSIPredict()
        {
            var repo  = new MocAnalyseRepository();
            var task  = new AnalyzeRSIPredictTask(repo);
            var state = new DataState {
                Symbol = "AAPL", Last = new DateTime(2012, 4, 4)
            };
            var result = task.AnalyzeData(state);

            Assert.IsTrue(result != null);
            Assert.IsTrue(result.Symbol == "AAPL");
            Assert.IsTrue(result.Name == RSIPredict.Name);
            Assert.IsTrue(result.Date.Year == 2012 && result.Date.Month == 4 && result.Date.Day == 4);

            /*
             * <Data>
             * <PredictRsi30Price>101.81</PredictRsi30Price>
             * <PredictRsi50Price>120.18</PredictRsi50Price>
             * <PredictRsi70Price>128.06</PredictRsi70Price>
             * </Data>
             */
        }
        public void CanAnalyzeGainLoss()
        {
            var repo  = new MocAnalyseRepository();
            var task  = new AnalyzeGainLossTask(repo);
            var state = new DataState {
                Symbol = "AAPL", Last = new DateTime(2012, 4, 4)
            };
            var result = task.AnalyzeData(state);

            Assert.IsTrue(result != null);
            Assert.IsTrue(result.Symbol == "AAPL");
            Assert.IsTrue(result.Name == GainLoss.Name);
            Assert.IsTrue(result.Date.Year == 2012 && result.Date.Month == 4 && result.Date.Day == 4);

            /*
             * <Data>
             * <MaxContGainDays>5</MaxContGainDays>
             * <AvgContGainDays>2.33</AvgContGainDays>
             * <MaxContLossDays>3</MaxContLossDays>
             * <AvgContLossDays>1.22</AvgContLossDays>
             * <LastGLContDays>1</LastGLContDays>
             * </Data>*/
        }
예제 #6
0
        public void CanAnalyzeProfit()
        {
            var repo  = new MocAnalyseRepository();
            var task  = new AnalyzeProfitTask(repo);
            var state = new DataState {
                Symbol = "AAPL", Last = new DateTime(2012, 4, 4)
            };
            var result = task.AnalyzeData(state);

            Assert.IsTrue(result != null);
            Assert.IsTrue(result.Symbol == "AAPL");
            Assert.IsTrue(result.Name == Profit.Name);
            Assert.IsTrue(result.Date.Year == 2012 && result.Date.Month == 4 && result.Date.Day == 4);

            /*
             * <Data>
             * <R20Day>14.62</R20Day>
             * <R50Day>13.48</R50Day>
             * <R100Day>29.36</R100Day>
             * <R150Day>37.14</R150Day>
             * <R200Day>53.04</R200Day>
             * </Data>
             */
        }