Exemplo n.º 1
0
        /// <summary>
        /// Called by the <see cref="IScheduler" /> when a
        /// <see cref="ITrigger" /> fires that is associated with
        /// the <see cref="IJob" />.
        /// </summary>
        public virtual Task Execute(IJobExecutionContext context)
        {
            log.Info($"Ready to shuffle your g0ldz!");

            // Call the Bittrex Trade manager with the strategy of our choosing.
            var manager = new GenericTradeManager(new BittrexApi(), new BigThree(), null, (a) => log.Info(a));

            // Call the process method to start processing the current situation.
            manager.CheckStrategySignals().GetAwaiter().GetResult();

            return(Task.FromResult(true));
        }
Exemplo n.º 2
0
        public static async Task Run([TimerTrigger("10 3 * * * *")] TimerInfo myTimer, TraceWriter log)
        {
            try
            {
                log.Info("Starting processing...");

                // Call the trade manager with the strategy of our choosing.
                var manager = new GenericTradeManager(
                    new BinanceApi(),
                    new BollingerAwe(),
                    null, (a) => log.Info(a)
                    );

                // Call the process method to start processing the current situation.
                await manager.CheckStrategySignals();

                log.Info("Done...");
            }
            catch (Exception ex)
            {
                // If anything goes wrong log an error to Azure.
                log.Error(ex.Message + ex.StackTrace);
            }
        }