Beispiel #1
0
        private ChartPointsPredition Predict(TimeFrame TFrame, string product, int deep, int ahead, int position, List <ChartPoint> LCPoints)
        {
            int iDeep  = deep;
            int iAhead = ahead;

            if (position < iDeep)
            {
                return(null);
            }


            int               iDecimals       = int.Parse(OSBlotter.Get(product).DecimalPlaces);
            int               iMinMatches     = 1;
            double            dMinResolution  = 1;
            List <ChartPoint> LCPSub          = LCPoints.GetRange(0, position);
            List <ChartPoint> LCPSubSpecified = LCPoints.GetRange(position - iDeep, iDeep);
            //List<ChartPoint> LCPSubPredicted = LCPoints.GetRange(position, iAhead);//TODO comment



            ChartPointsPredition CPsP = ANALYSIS.PredictNextSpecified(product, LCPSub, LCPSubSpecified, TFrame, iDecimals, iMinMatches, dMinResolution, iAhead, new double[] { 0, 0, 0, 0, 0 });

            CPsP.Prognosis(0);
            CPsP.Position = position;
            return(CPsP);
        }
Beispiel #2
0
        public void Predict(TimeFrame TFrame, double[] IASymiliarities)
        {
            if (this.AvalaibleMeans() <= 0)
            {
                return;
            }

            //int iMinutes = ABBREVIATIONS.ToMinutes(TFrame);

            List <string> LSLiquids = ANALYSIS.GetLiquids(ARCHIVE.GetProducts(), ORBlotter, 60, 30, dSpreadFactor, TFrame); //Chooce only those products whose Activity in last 5 minutes is above 0.5 of spread //List<string> LSLiquidsLive = ANALYSIS.GetLiquidsLive(ORBlotter, 50, 3, 0.2, TFrame);

            if (LSLiquids.Count < 10 && dSpreadFactor > 0.35)
            {
                dSpreadFactor -= 0.0025;
            }
            else if (LSLiquids.Count > 20)
            {
                dSpreadFactor += 0.0025;
            }



            //List<Thread> LThrdLiquid = new List<Thread>();
            foreach (string product in LSLiquids)//ORBlotter.GetProducts)
            {
                //LThrdLiquid.Add(new Thread(delegate() {

                List <ChartPoint> LCPoints          = ARCHIVE.GetDATA(TFrame, product);
                ChartPoint        CPLAst            = LCPoints.Last();
                List <ChartPoint> LCPointsSpecified = ORBlotter.Archive.Get(product, TFrame, IASymiliarities.Length);

                if (LCPointsSpecified != null)
                {
                    ChartPointPredition      CPPrediction = ANALYSIS.PredictNextSpecified(product, LCPoints, LCPointsSpecified, TFrame, ORBlotter.Get(product).Decimals, IASymiliarities);
                    ChartPointPredition.Kind CPPKind      = CPPrediction.Prognosis();


                    if (CPPKind != ChartPointPredition.Kind.Uncertain)
                    {
                        this.TryUpdate(CPPrediction);
                    }
                }
                //  }));
                // LThrdLiquid.Last().Priority = ThreadPriority.BelowNormal;
                // LThrdLiquid.Last().Start();
            }

            //foreach (Thread Thrd in LThrdLiquid)  Thrd.Join();
        }