Beispiel #1
0
        public async Task MultiBarServerTest()
        {
            List <IBar> bars = BarMocks.UpMove(1000, (double)100).ToList();

            BarPipeServer server = new BarPipeServer();

            int i = 0;

            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();

            foreach (var bar in bars)
            {
                bar.BarId = 0;

                bar.Period = 100;

                BarService.AddBar(symbol, bar);
            }

            stopwatch.Stop();

            Debug.WriteLine($"this took {stopwatch.ElapsedMilliseconds}");

            Thread.Sleep(15000);
        }
Beispiel #2
0
        public async Task BarServerTest()
        {
            BarPipeServer server = new BarPipeServer();

            bar.BarId = 0;

            bar.Period = 100;

            await BarService.AddBar(symbol, bar);

            Thread.Sleep(30000);
        }
 public IActionResult Post([FromBody] BarDTO value)
 {
     return(Json(new { barId = _service.AddBar(value) }));
 }