public Sploders() { m_api = new ExchangeSharpApi(ExchangeSet.All); m_rawGainers24 = new SortedDictionary <DateTime, Dictionary <string, CoinMarketCapTicker> >(); m_cmc = new CoinMarketCapApi(); m_maker = new CandlestickMaker(); }
static void ExecuteGator(string[] args) { Console.WriteLine("********** GATOR " + new string('*', 83)); var apiXS = new ExchangeSharpApi(); //apiXS.Gator("ETH-USD", amountRequested:200, bips:125); if (args.Length < 4) { Console.WriteLine("usage: dotnet CryptoConsole.dll gator <symbol> <amount> <bips> (#display)"); Console.WriteLine(); Console.WriteLine(" ex: dotnet CryptoConsole.dll gator ETH-USD 200 125"); Console.WriteLine(" dotnet CryptoConsole.dll gator BTC-USD 90 125 20"); Console.WriteLine(" dotnet CryptoConsole.dll gator BTC-USDT 75 150"); Console.WriteLine(); return; } string symbol = args[1]; decimal amount = decimal.Parse(args[2]); int bips = int.Parse(args[3]); int displayBook = 0; if (args.Length > 3) { displayBook = int.Parse(args[4]); } apiXS.Gator(symbol, amount, bips, displayBook); }
static void ExecuteBalance(string[] args) { Console.WriteLine("********** BALANCE " + new string('*', 81)); var apiXS = new ExchangeSharpApi(); if (args.Length < 3) { Console.WriteLine("usage: dotnet CryptoConsole.dll balance <exchange> <btcsymbol>"); Console.WriteLine(); Console.WriteLine(" ex: dotnet CryptoConsole.dll balance ALL *"); Console.WriteLine(" dotnet CryptoConsole.dll balance BINANCE btcusdt"); Console.WriteLine(" dotnet CryptoConsole.dll balance GDAX btcusd"); Console.WriteLine(" dotnet CryptoConsole.dll balance BITTREX btcusdt"); Console.WriteLine(); return; } string exchange = args[1].ToUpper(); if (exchange == "ALL") { DisplayAllExchangeBalances(); } else { string btcsymbol = args[2].ToLower(); DisplayBalances(exchange, btcsymbol); } Console.WriteLine(); }
// CTOR: // Given an exchange and symbol and number of bars to use in RealizedVolatility calculation // AND Given ExchangeSharpRestApi object // Construct the Renko public Renko(string exchange, string symbol, int numberOfBars, ExchangeSharpApi xsapi) { m_api = xsapi; m_maker = new CandlestickMaker(); m_exchange = exchange; m_symbol = symbol; m_nbars = numberOfBars; ConstructRenko(); }
// CTOR: // Given an exchange and symbol and number of bars to use in RealizedVolatility calculation // Construct the Renko public Renko(string exchange, string symbol, int numberOfBars) { m_api = new ExchangeSharpApi(); m_api.LoadCredentials(Credentials.CredentialsFile, Credentials.CredentialsPassword); m_maker = new CandlestickMaker(); m_exchange = exchange; m_symbol = symbol; m_nbars = numberOfBars; ConstructRenko(); }
//private List<TradeSymbolRawCsvRecord> m_tradeSymbols; //private List<TradeSymbolRawCsvRecord> m_activeTradeSymbols; public TraderFX() { m_api = new ExchangeSharpApi(ExchangeSet.All); m_api.LoadCredentials(Credentials.CredentialsFile, Credentials.CredentialsPassword); m_creds = Credentials.LoadEncryptedCsv(Credentials.CredentialsFile, Credentials.CredentialsPassword); m_prowl = new ProwlPub(m_creds["PROWL"].Key, "Scalper"); m_om = new OrderManager(m_creds); //m_maker = new CandlestickMaker(); //m_orders = new ConcurrentBag<ExchangeOrderResult>(); m_priceFeed = PriceFeed.Instance; }
public TraderScalper() { m_api = new ExchangeSharpApi(ExchangeSet.All); m_api.LoadCredentials(Credentials.CredentialsFile, Credentials.CredentialsPassword); m_creds = Credentials.LoadEncryptedCsv(Credentials.CredentialsFile, Credentials.CredentialsPassword); m_prowl = new ProwlPub(m_creds["PROWL"].Key, "Scalper"); m_om = new OrderManager(m_creds); m_maker = new CandlestickMaker(); m_orders = new ConcurrentBag <ExchangeOrderResult>(); m_binanceRestApi = new BinanceRestApi(m_creds["BINANCE"].Key, m_creds["BINANCE"].Secret); ReadTradeSymbols(); }
public TradeBinanceArbsXS() { m_api = new ExchangeSharpApi(); m_api.LoadCredentials(Credentials.CredentialsFile, Credentials.CredentialsPassword); m_creds = Credentials.LoadEncryptedCsv(Credentials.CredentialsFile, Credentials.CredentialsPassword); //m_tickers = new ConcurrentDictionary<string, ConcurrentDictionary<string, ConcurrentStack<ExchangeTicker>>>(); m_tradingSymbols.AddRange(new List <string>() { "ETHUSDT", "BTCUSDT" }); m_tradingSymbols.AddRange(new List <string>() { "NEOUSDT", "NEOETH", "NEOBTC" }); m_tradingSymbols.AddRange(new List <string>() { "BNBUSDT", "BNBETH", "BNBBTC" }); m_tradingSymbols.AddRange(new List <string>() { "QTUMUSDT", "QTUMETH", "QTUMBTC" }); m_tradingSymbols.AddRange(new List <string>() { "LTCUSDT", "LTCETH", "LTCBTC" }); m_tradingSymbols.AddRange(new List <string>() { "BCCUSDT", "BCCETH", "BCCBTC" }); m_tradingSymbols.AddRange(new List <string>() { "ADAUSDT", "ADAETH", "ADABTC" }); m_tradingSymbols.AddRange(new List <string>() { "XRPUSDT", "XRPETH", "XRPBTC" }); SetTradeSizes(5.0M); InitializeArbPositions(); }
public CollectorTickers() { m_api = new ExchangeSharpApi(); m_tickers = new ConcurrentDictionary <string, ConcurrentDictionary <string, ConcurrentStack <ExchangeTicker> > >(); }
public CryptoWindowsForm() { InitializeComponent(); m_api = new ExchangeSharpApi(ExchangeSet.All); m_api.LoadCredentials(Credentials.CredentialsFile, Credentials.CredentialsPassword); }
public TraderCrossExchange() { m_api = new ExchangeSharpApi(); m_api.LoadCredentials(Credentials.CredentialsFile, Credentials.CredentialsPassword); m_tickers = new ConcurrentDictionary <string, ConcurrentDictionary <string, ConcurrentStack <ExchangeTicker> > >(); }
public TraderBuySellIndicator() { m_api = new ExchangeSharpApi(); m_api.LoadCredentials(Credentials.CredentialsFile, Credentials.CredentialsPassword); m_creds = Credentials.LoadEncryptedCsv(Credentials.CredentialsFile, Credentials.CredentialsPassword); }
public Bank() { m_api = new ExchangeSharpApi(); m_api.LoadCredentials(Credentials.CredentialsFile, Credentials.CredentialsPassword); }
static void Main(string[] args) { Console.WriteLine("\n*** WELCOME TO AGGREGATOR ***\n"); var apiXS = new ExchangeSharpApi(); //apiXS.Gator("ETH-USD", amountRequested: 200, bips:125); apiXS.Test(); //CryptoWebSocketApis.GeminiWebSocket.TestGeminiTickers_marketdata(); Console.WriteLine("(Back in MAIN)"); Console.ReadKey(); return; //CryptoTools.Cryptography.Cryptography.EncryptFile("X:/Users/Trader/Documents/hat_apis.json", "/Users/michael/Documents/hat_apis.enc", pw); // encrypt api key file m_credentialsFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "system.apis.enc"); // read ".enc" file from application path m_pw = @"myKey123"; m_factory = new ApiFactory(m_credentialsFile, m_pw); /*TradeBittrexArbs.InitializeApi(credentialsFile, pw); * TradeBittrexArbs.Test(); * TradeBinanceArbs.InitializeApi(credentialsFile, pw); * TradeBinanceArbs.Test(); * TradeGdaxArbs.InitializeApi(credentialsFile, pw); * TradeGdaxArbs.Test(); * TradeKraken.InitializeApi(credentialsFile, pw); * TradeKraken.Test(); * TradeGemini.InitializeApi(credentialsFile, pw); * TradeGemini.Test();*/ // Get CoinMarketCap rankings var cmcap = new CoinMarketCapApi(); cmcap.Test(); /*var rank = cmcap.GetRankings(); * var gainers1h = rank.OrderByDescending(t => t.percent_change_1h); * var gainers24h = rank.OrderByDescending(t => t.percent_change_24h); * var gainers7d = rank.OrderByDescending(t => t.percent_change_7d); * var losers1h = rank.OrderBy(t => t.percent_change_1h); * var losers24h = rank.OrderBy(t => t.percent_change_24h); * var losers7d = rank.OrderBy(t => t.percent_change_7d);*/ //BinanceTotals(); //var mgr = new CryptoTools.SymbolManager(); //SellBinance(0.50M, "bnb"); /*DisplayBalances("KRAKEN", "btcusd"); * DisplayBalances("BITFINEX", "btcusd"); * DisplayBalances("BINANCE", "btcusdt"); * DisplayBalances("BITTREX", "btcusdt"); * DisplayBalances("POLONIEX", "btcusdt"); * DisplayBalances("GDAX", "btcusd"); * * try * { * GdaxRestApi api = m_factory.Get("GDAX") as GdaxRestApi; * api.PrintCoinbaseAccounts().Wait(); * } * catch (Exception ex) * { * Console.WriteLine("\nGDAX Coinbase Error: {0}", ex.Message); * }*/ Console.Write("\n\nPress any key to exit... "); Console.ReadKey(); return; //BinanceArbs.InitializeApi(); TradeBinanceArbs.GetBalances(out decimal initTotalBtc, out decimal initTotalUsdt, true); Console.WriteLine("\n{0} {1} BTC {2} USDT\n", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), initTotalBtc, initTotalUsdt); // [LocalTime, exch1UpdateTime, exch1BitCoinPrice, exch2UpdateTime, exch2BitCoinPrice] List <string> symbols = new List <string>(); symbols.AddRange(new List <string>() { "ethusdt", "btcusdt" }); symbols.AddRange(new List <string>() { "neousdt", "neoeth", "neobtc" }); symbols.AddRange(new List <string>() { "bnbusdt", "bnbeth", "bnbbtc" }); symbols.AddRange(new List <string>() { "qtumusdt", "qtumeth", "qtumbtc" }); symbols.AddRange(new List <string>() { "ltcusdt", "ltceth", "ltcbtc" }); symbols.AddRange(new List <string>() { "bccusdt", "bcceth", "bccbtc" }); symbols.AddRange(new List <string>() { "adausdt", "adaeth", "adabtc" }); List <string> streams = new List <string>(); streams.Add("ticker"); streams.Add("aggTrade"); TradeBinanceArbs.BinanceStreams(streams.ToArray(), symbols.ToArray()); //GdaxTickers(); //GeminiTickers(); //BinanceTickers(); //BitfinexTickers(); }