public static void ProcessRawData(string rawData, ref ECurrencyPair outCurrencyPair, ref decimal outCurrency) { /* {"symbol":"BTCUSDT","price":"3870.03000000"} */ // Define regular expression pattern string pattern; //pattern = @"""symbol"":""(\s+)"",""price"":""(\s+)"""; pattern = @"\{""symbol"":""(\w+)"",""price"":""(\d*\.\d*)""\}"; Regex rx = new Regex(pattern); MatchCollection matchCollection = Regex.Matches(rawData, pattern); foreach (Match match in matchCollection) { Enum.TryParse(match.Groups[1].Value, out outCurrencyPair); outCurrency = Convert.ToDecimal(match.Groups[2].Value); } // linear regression (a form of polinomial regression) // polinomial regression // logistic regression (binary and catogory answers) // super logistic regression is nural networks // matlab/archave // standform mit machine learning course // know linear algebra // The google ledger //outSymbol = }
public static void ProcessRawData(string rawData, ref ECurrencyPair outCurrencyPair, ref decimal outCurrency) { /* {"symbol":"BTCUSDT","price":"3870.03000000"} */ // Define regular expression pattern string pattern; pattern = @"\{""symbol"":""(\w+)"",""price"":""(\d*\.\d*)""\}"; Regex rx = new Regex(pattern); MatchCollection matchCollection = Regex.Matches(rawData, pattern); foreach (Match match in matchCollection) { Enum.TryParse(match.Groups[1].Value, out outCurrencyPair); outCurrency = Convert.ToDecimal(match.Groups[2].Value, CultureInfo.InvariantCulture); } }
public JsonResult Refresh(StandardTradeToolInputModel standardTradeToolInputModel) { restClientController = new RestClientController(standardTradeToolInputModel.EndPoint, standardTradeToolInputModel.HttpMethod); restClientController.MakeRequest(); //ECurrencyPair currencyPair = new ECurrencyPair(); //decimal tickerPrice = 0.0M; //exchangeDataModel.CurrencyPair = currencyPair; //exchangeDataModel.TickerPrice = tickerPrice; //InitiateTrade(); string rawTicker = restClientController.GetResponse(); ECurrencyPair currencyPair = ECurrencyPair.NOT_SELECTED; decimal amount = 0.0m; ExchangeController.ProcessRawData(rawTicker, ref currencyPair, ref amount); standardTradeToolViewModel.CurrencyPair = currencyPair.ToString(); standardTradeToolViewModel.Amount = amount; return(Json(standardTradeToolViewModel, JsonRequestBehavior.AllowGet)); }