Ejemplo n.º 1
0
        /// <summary>
        /// Calculation of Thrust indicators
        /// </summary>
        /// <param name="ds">data to calculate CCI</param>
        /// <param name="period">period to calculate</param>
        /// <param name="name"></param>
        public Market_TRIN(DataSeries ds, string name)
            : base(ds, name)
        {
            //application.Data stockData = new application.Data(AppTypes.TimeRanges.Y1, AppTypes.TimeScaleFromCode("D1"), "SSI");
            application.MarketData market          = new application.MarketData(AppTypes.TimeRanges.Y1, AppTypes.TimeScaleFromCode("D1"));
            DataSeries             advancingIssues = market.AdvancingIssues;
            DataSeries             decliningIssues = market.DecliningIssues;

            DataSeries advancingVolume = market.AdvancingVolume;
            DataSeries decliningVolume = market.DecliningVolume;

            DataSeries result1 = advancingIssues / decliningIssues;
            DataSeries result2 = advancingVolume / decliningVolume;

            DataSeries result3 = result1 / result2;

            int begin = 0;

            FirstValidValue = 0;
            this.Name       = name;
            for (int i = begin, j = 0; j < result3.Count; i++, j++)
            {
                this[i] = result3[j];
            }
        }
Ejemplo n.º 2
0
 public void SignalSeriesTest()
 {
     //application.MarketData market = new application.MarketData(AppTypes.TimeRanges.Y1, AppTypes.TimeScaleFromType(AppTypes.TimeScaleTypes.Day),"SSI");
     application.MarketData stockData = new application.MarketData(AppTypes.TimeRanges.Y1, AppTypes.TimeScaleFromCode("D1"));
     DataSeries ds = null; // TODO: Initialize to an appropriate value
     double fastPeriod = 12; 
     double slowPeriod = 26; 
     double signalPeriod = 9; 
     string name = string.Empty; // TODO: Initialize to an appropriate value
     MACD target = new MACD(ds, fastPeriod, slowPeriod, signalPeriod, name); // TODO: Initialize to an appropriate value
     DataSeries actual;
     actual = target.SignalSeries;
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Ejemplo n.º 3
0
        public void SignalSeriesTest()
        {
            //application.MarketData market = new application.MarketData(AppTypes.TimeRanges.Y1, AppTypes.TimeScaleFromType(AppTypes.TimeScaleTypes.Day),"SSI");
            application.MarketData stockData = new application.MarketData(AppTypes.TimeRanges.Y1, AppTypes.TimeScaleFromCode("D1"));
            DataSeries             ds        = null; // TODO: Initialize to an appropriate value
            double     fastPeriod            = 12;
            double     slowPeriod            = 26;
            double     signalPeriod          = 9;
            string     name   = string.Empty;                                             // TODO: Initialize to an appropriate value
            MACD       target = new MACD(ds, fastPeriod, slowPeriod, signalPeriod, name); // TODO: Initialize to an appropriate value
            DataSeries actual;

            actual = target.SignalSeries;
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Calculation of Thrust indicators
        /// </summary>
        /// <param name="ds">data to calculate CCI</param>        
        /// <param name="period">period to calculate</param>
        /// <param name="name"></param>
        public Market_TRIN(DataSeries ds, string name)
            : base(ds, name)
        {
            //application.Data stockData = new application.Data(AppTypes.TimeRanges.Y1, AppTypes.TimeScaleFromCode("D1"), "SSI");
            application.MarketData market = new application.MarketData(AppTypes.TimeRanges.Y1, AppTypes.TimeScaleFromCode("D1"));
            DataSeries advancingIssues = market.AdvancingIssues;
            DataSeries decliningIssues = market.DecliningIssues;

            DataSeries advancingVolume = market.AdvancingVolume;
            DataSeries decliningVolume = market.DecliningVolume;

            DataSeries result1 = advancingIssues / decliningIssues;
            DataSeries result2 = advancingVolume / decliningVolume;

            DataSeries result3 = result1 / result2;

            int begin = 0;
            FirstValidValue = 0;
            this.Name = name;
            for (int i = begin, j = 0; j < result3.Count; i++, j++)
                this[i] = result3[j];
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Calculation of Thrust indicators
        /// </summary>
        /// <param name="ds">data to calculate CCI</param>
        /// <param name="period">period to calculate</param>
        /// <param name="name"></param>
        public Market_BreadthTrust(DataSeries ds, double period, string name)
            : base(ds, name)
        {
            //application.Data stockData = new application.Data(AppTypes.TimeRanges.Y1, AppTypes.TimeScaleFromCode("D1"), "SSI");
            application.MarketData market          = new application.MarketData(AppTypes.TimeRanges.Y1, AppTypes.TimeScaleFromCode("D1"));
            DataSeries             advancingIssues = market.AdvancingIssues;
            DataSeries             decliningIssues = market.DecliningIssues;

            DataSeries emaAdvancingIssues = Indicators.EMA.Series(advancingIssues, period, "emaAdvancingIssues");
            DataSeries emaTotalIssues     = Indicators.EMA.Series(advancingIssues + decliningIssues, period, "emaTotalIssues");

            DataSeries result3 = emaAdvancingIssues / emaTotalIssues;

            int begin = 0;

            FirstValidValue = 0;
            this.Name       = name;
            for (int i = begin, j = 0; j < result3.Count; i++, j++)
            {
                this[i] = result3[j];
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Calculation of Thrust indicators
        /// </summary>
        /// <param name="ds">data to calculate CCI</param>        
        /// <param name="period">period to calculate</param>
        /// <param name="name"></param>
        public Market_BreadthTrust(DataSeries ds,double period, string name)
            : base(ds, name)
        {
            //application.Data stockData = new application.Data(AppTypes.TimeRanges.Y1, AppTypes.TimeScaleFromCode("D1"), "SSI");
            application.MarketData market = new application.MarketData(AppTypes.TimeRanges.Y1, AppTypes.TimeScaleFromType(AppTypes.TimeScaleTypes.Day));
            DataSeries advancingIssues = market.AdvancingIssues;
            DataSeries decliningIssues = market.DecliningIssues;

            DataSeries emaAdvancingIssues = Indicators.EMA.Series(advancingIssues, period, "emaAdvancingIssues");
            DataSeries emaTotalIssues = Indicators.EMA.Series(advancingIssues + decliningIssues, period, "emaTotalIssues");

            DataSeries result3 = emaAdvancingIssues /emaTotalIssues;

            int begin = 0;
            FirstValidValue = 0;
            this.Name = name;
            for (int i = begin, j = 0; j < result3.Count; i++, j++)
                this[i] = result3[j] * 100;
        }