コード例 #1
0
        async Task LaunchQuoteTask(OrderTask orderTask)
        {
            await orderTask.GetOffer();

            quotedOrderTasks.Add(orderTask);
            await timerTask;

            LaunchAllPlacementTasks();
        }
コード例 #2
0
        async Task LaunchPlacementTask(OrderTask orderTask, int amount)
        {
            await orderTask.PlaceOrder(amount);

            //update all order state vars
            lock (stores)
            {
                AmountQueued -= orderTask.AmountAttempted;
                if (orderTask.Success)
                {
                    AmountAccumulated += orderTask.AmountAttempted;
                }

                Console.WriteLine($"Order finished: {orderTask}\t{ (orderTask.Success ? "SUCCESS" : "FAILED") }\tAccumulated:{AmountAccumulated}\tQueued:{AmountQueued}");
            }

            LaunchAllPlacementTasks();
        }