Beispiel #1
0
 private async Task SubSpecificMarkets()
 {
     foreach (string mk in OPTIONS.SubSpecificDeltas)
     {
         await BtrexWS.SubscribeMarket(mk);
     }
 }
Beispiel #2
0
        static async Task RunAsync()
        {
            //UPDATE LOCALLY STORED 5m CANDLES, AND .CSV RECORDS:
            await HistoricalData.UpdateHistData();

            //INITIALIZE DATA, THEN CONNECT WEBSOCKET
            BtrexData.NewData();
            await BtrexWS.Connect();

            ConfigTraceLogging();

            //SUBSCRIBE TO DESIRED MARKETS, THEN START-DATA-UPDATES:
            await BtrexController.InitializeMarkets();

            //START DATA THREAD
            await BtrexData.StartDataUpdates();

            //START CALCS/STRATEGY WORK:
            BtrexController.StartWork();

            //START TRADING THREAD
            BtrexREST.TradeController.StartTrading();

            Console.WriteLine("\r\n\r\n-PRESS ENTER 3 TIMES TO EXIT-\r\n\r\n");
            Console.ReadLine();
            Console.ReadLine();
            Console.ReadLine();
            Environment.Exit(0);
        }
Beispiel #3
0
        private async Task SubSpecificMarkets()
        {
            foreach (string mk in SpecificDeltas)
            {
                await BtrexWS.SubscribeMarket(mk);
            }

            await PreloadCandlesDict(6);
        }
Beispiel #4
0
        private async Task SubTopMarketsByVol(int n)
        {
            List <string> topMarkets = await BtrexREST.GetTopMarketsByBVbtcOnly(n);

            foreach (string mk in topMarkets)
            {
                await BtrexWS.SubscribeMarket("BTC-" + mk);
            }

            await PreloadCandlesDict(6);
        }
Beispiel #5
0
        private async Task SubTopMarketsByVol(int n)
        {
            List <string> topMarkets = await BtrexREST.GetTopMarketsByBVbtcOnly(n);

            //ADD DELTAS FROM HOLDINGS TABLE
            foreach (DataTable dt in Holdings.Tables)
            {
                foreach (DataRow row in dt.Rows)
                {
                    if (!topMarkets.Exists(o => o == row["MarketDelta"].ToString().Split('-')[1]))
                    {
                        topMarkets.Add((string)row["MarketDelta"].ToString().Split('-')[1]);
                    }
                }
            }

            //SUBSCRIBE ALL MARKETS, RETRY FAILED AT END:
            List <MarketQueryResponse> timeGapMarkets = await BtrexWS.SubscribeMarketsList(topMarkets.Except(OPTIONS.ExcludeTheseDeltas).ToList());

            if (timeGapMarkets.Count > 0)
            {
                await RetryTimeGappedMarkets(timeGapMarkets);
            }
        }