Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        public async Task BarServerTest()
        {
            BarPipeServer server = new BarPipeServer();

            bar.BarId = 0;

            bar.Period = 100;

            await BarService.AddBar(symbol, bar);

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