コード例 #1
0
ファイル: Consecutive.cs プロジェクト: w1r2p1/GoblinBat
 internal Consecutive(BackTesting bt, Catalog.XingAPI.Specify specify)
 {
     this.bt       = bt;
     this.specify  = specify;
     this.judge    = specify.Strategy.Length == 2 && int.TryParse(specify.Strategy, out int judge) ? judge : int.MaxValue;
     Short         = new Stack <double>(256);
     Long          = new Stack <double>(256);
     bt.SendDatum += Analysize;
 }
コード例 #2
0
ファイル: Analysis.cs プロジェクト: hur-kyuh-leez/Strategy
        internal Analysis(BackTesting bt, Catalog.XingAPI.Specify specify) : base(specify)
        {
            this.bt       = bt;
            bt.SendDatum += Analysize;

            if (specify.Time == 1440)
            {
                bt.SendQuotes += OnReceiveQuotes;
            }
        }
コード例 #3
0
ファイル: GoblinBat.cs プロジェクト: w1r2p1/GoblinBat
        void OnReceiveStrategy(object sender, EventHandler.BackTesting.Statistics e)
        {
            if (string.IsNullOrEmpty(e.Setting.Code) == false && string.IsNullOrEmpty(e.Setting.Strategy) == false && retrieve.SetIdentify(e.Setting) >= 0)
            {
                Cursor = Cursors.Default;
                retrieve.SetStatistics(e.Setting, new List <string>(secret.strategy), secret.rate[0]);

                return;
            }
            if (Chart == null)
            {
                Chart = new ChartControl();
                panel.Controls.Add(Chart);
                Chart.Dock = DockStyle.Fill;
            }
            if (retrieve.OnReceiveRepositoryID(e.Game) == false)
            {
                var message = string.Empty;
                Task = new Task(() => message = new BackTesting((char)86, retrieve.GetImitationModel(e.Game), key).Message);
                Task.Start();

                if (TimerBox.Show(secret.BackTesting, e.Game.Strategy, MessageBoxButtons.OK, MessageBoxIcon.Warning, (uint)15E+3).Equals(DialogResult.OK))
                {
                    Cursor = Cursors.AppStarting;
                    Task.Wait();

                    if (string.IsNullOrEmpty(message) == false && TimerBox.Show(message, e.Game.Strategy, MessageBoxButtons.OK, MessageBoxIcon.Warning, 3251).Equals(DialogResult.OK))
                    {
                        Cursor = Cursors.Default;

                        return;
                    }
                }
            }
            var task = new Task <Dictionary <DateTime, string> >(() => retrieve.OnReceiveInformation(e.Game));

            task.Start();
            Cursor           = Cursors.WaitCursor;
            SendInformation += Chart.OnReceiveChartValue;
            task.Wait();
            SuspendLayout();
            SendInformation?.Invoke(this, new EventHandler.BackTesting.Statistics(task.Result));
            Size = Chart.SetChartValue();
            Statistical.Hide();
            Chart.Show();
            ResumeLayout();
            CenterToScreen();
            Cursor           = Cursors.Default;
            SendInformation -= Chart.OnReceiveChartValue;
        }
コード例 #4
0
ファイル: Analysis.cs プロジェクト: w1r2p1/GoblinBat
        protected internal Analysis(BackTesting bt, Catalog.XingAPI.Specify specify) : base(specify)
        {
            if (specify.Strategy.Length > 2)
            {
                this.bt       = bt;
                bt.SendDatum += Analysize;

                if (specify.Time == 1440)
                {
                    bt.SendQuotes += OnReceiveQuotes;
                    RollOver       = !specify.RollOver;
                }
            }
        }
コード例 #5
0
 internal Fly(BackTesting bt, Catalog.XingAPI.Specify specify) : base(bt, specify) => Console.WriteLine(specify.Strategy);