Esempio n. 1
0
        public static void Start()
        {
            Events.CandleEvent += Events_CandleEvent;
            strategies.Add(new BBBullMarket());

            while (true)
            {
                foreach (string p in Candles.Keys)
                {
                    int secToWait = 120;

                    if (Candles[p][0].Resolution == "1m")
                    {
                        secToWait = 120;
                    }
                    else if (Candles[p][0].Resolution == "5m")
                    {
                        secToWait = 600;
                    }

                    if (Candles[p][Candles[p].Count - 1].time.AddSeconds(secToWait) < DateTime.Now)
                    {
                        BitfinexCandleGetter.GetNewCandle(Candles[p][0].Resolution, p, Candles[p][0].Symbol);
                        Thread.Sleep(2000);
                    }
                }

                Thread.Sleep(500);
            }
        }
Esempio n. 2
0
        public static void AddTradingPair(string resolution, string pair, string symbol)
        {
            if (Candles.ContainsKey(pair))
            {
                return;
            }

            BitfinexCandleGetter.GetNewCandle(resolution, pair, symbol);
        }