Hi,
I have a couple of working indicators, but created another one.
It works well when I createt it when wealthlab is running. eg. compiles OK, loads data OK.
But after restarting Wealthlab (as admin) it doesnt load. No dll is created.
It's likely caused by me using classes from assembly references, that seem to work during runtime but not startup.
Is there any compiler log created a startup so I can more easily find the problem.
Commenting out code and restarting is what I'm doing now, but not very efficient.
Code if anyone wants to try them selves. Needs a free API key from COINAPI.
I have a couple of working indicators, but created another one.
It works well when I createt it when wealthlab is running. eg. compiles OK, loads data OK.
But after restarting Wealthlab (as admin) it doesnt load. No dll is created.
It's likely caused by me using classes from assembly references, that seem to work during runtime but not startup.
Is there any compiler log created a startup so I can more easily find the problem.
Commenting out code and restarting is what I'm doing now, but not very efficient.
Code if anyone wants to try them selves. Needs a free API key from COINAPI.
CODE:
using WealthLab.Core; using System; using System.Text; using System.Collections.Generic; using System.Globalization; using WealthLab.Indicators; using Newtonsoft.Json.Linq; using System.Diagnostics; using System.Text.RegularExpressions; using System.Linq; using System.IO.Compression; using System.IO; using System.Net; using System.Net.Http; using System.Threading.Tasks; using System.IO.Compression; namespace WealthLab.MyIndicators { public class CoinAPI : IndicatorBase { public bool ExtendedDebug = false; //parameterless constructor public CoinAPI() : base() { } //for code based construction public CoinAPI(TimeSeries source, String symbol) : base() { Parameters[0].Value = source; Parameters[1].Value = symbol; Populate(); } //static Series method public static CoinAPI Series(TimeSeries source, String symbol) { return new CoinAPI(source, symbol); } //name public override string Name { get { return "CoinAPI"; } } //abbreviation public override string Abbreviation { get { return "CoinAPI"; } } //description public override string HelpDescription { get { return ""; } } //price pane public override string PaneTag { get { return "CoinAPI"; } } //default color public override WLColor DefaultColor { get { return WLColor.FromArgb(255, 0, 0, 255); } } //default plot style public override PlotStyle DefaultPlotStyle { get { return PlotStyle.Line; } } //populate public override void Populate() { TimeSeries source = Parameters[0].AsTimeSeries; String symbol = Parameters[1].AsString; if (ExtendedDebug) WLHost.Instance.AddLogItem(Name, $"Generating data source.DateTimes.First:" + source.DateTimes.First().ToString(), WLColor.Green); DateTimes = source.DateTimes; var CoinAPI = CoinAPIFactory.GetCoinAPI(symbol); if (ExtendedDebug) WLHost.Instance.AddLogItem(Name, $"Generating data CoinAPI.Count (1)" + CoinAPI.DateTimes.Count + " " + CoinAPI.Values.Count, WLColor.Green); if (ExtendedDebug) CoinAPIFactory.LogFirstAndLast(CoinAPI, 2, "CoinAPI (1) "); TimeSeries ts = null; if (source != null && source.Count > 0) { //var sourceClone double lastValue = Double.NaN; var valueList = new List<double>(); ts = MergeDataPoints(CoinAPI, source); //ts = TimeSeriesSynchronizer.Synchronize(CoinAPI, (TimeSeriesBase)source); } if (ts != null) { if (ExtendedDebug) WLHost.Instance.AddLogItem(Name, $"Generating data source.DateTimes.First:" + source.DateTimes.First().ToString() + " ts.DateTimes.First " + ts.DateTimes.First().ToString(), WLColor.Green); if (ExtendedDebug) CoinAPIFactory.LogFirstAndLast(this, 2, "This (2) "); if (ExtendedDebug) CoinAPIFactory.LogFirstAndLast(ts, 2, "ts (2) "); if (ExtendedDebug) WLHost.Instance.AddLogItem(Name, $"Generating data this.Count (2):" + CoinAPI.DateTimes.Count + " " + CoinAPI.Values.Count, WLColor.Green); DateTimes = source.DateTimes; this.AssumeValuesOf(ts); if (ExtendedDebug) WLHost.Instance.AddLogItem(Name, $"Generating data this.Count (3):" + this.DateTimes.Count + " " + this.Values.Count, WLColor.Green); if (ExtendedDebug) CoinAPIFactory.LogFirstAndLast(this, 2, "This (3) "); if (ExtendedDebug) CoinAPIFactory.LogFirstAndLast(ts, 2, "ts (3) "); } else { if (ExtendedDebug) WLHost.Instance.AddLogItem(Name, $"Generating data timeSeries else", WLColor.Green); this.DateTimes = source.DateTimes; } if (ExtendedDebug) WLHost.Instance.AddLogItem(Name, $"Generating data timeSeries END", WLColor.Green); } //generate parameters protected override void GenerateParameters() { AddParameter("Source", ParameterType.TimeSeries, PriceComponent.Close); AddParameter("Symbol", ParameterType.String, "KRAKENFTS_PERP_BTC_USD"); } public TimeSeries MergeDataPoints(TimeSeries instance1, TimeSeries instance2) { // Create a dictionary from instance1 for quick DateTime to Value lookup var valueDict = new Dictionary<DateTime, double>(); for (int i = 0; i < instance1.DateTimes.Count; i++) { // Ensure there are equal counts of DateTimes and Values if (i < instance1.Values.Count) { // If there are duplicate DateTimes in instance1, decide how to handle them. // Here, we'll overwrite with the latest value. valueDict[instance1.DateTimes[i]] = instance1.Values[i]; } } // Prepare the new DataClass instance TimeSeries mergedInstance = new TimeSeries(); foreach (var dt in instance2.DateTimes) { mergedInstance.DateTimes.Add(dt); if (valueDict.TryGetValue(dt, out double value)) { mergedInstance.Values.Add(value); } else { mergedInstance.Values.Add(Double.NaN); } } return mergedInstance; } } public static class CoinAPIFactory { public static string Name = "CoinAPI"; public static CoinAPI GetCoinAPI(string symbol) { var CoinAPI = new CoinAPI(); WLHost.Instance.AddLogItem(Name, $"Generating data: (Start)", WLColor.Green); try { bool loadedFromCache = false; try { loadedFromCache = CoinAPI.LoadDataFromCache(Name, symbol, DateTime.MinValue, DateTime.MaxValue, 0); } catch (Exception ex1) { WLHost.Instance.AddLogItem(Name, $"Generating data LoadDataFromCache: {ex1.Message} " + ex1.StackTrace, WLColor.Green); } WLHost.Instance.AddLogItem(Name, $"loadedFromCache: {loadedFromCache} {CoinAPI.Count}", WLColor.Green); if (CoinAPI.Count == 0 | (loadedFromCache && CoinAPI.Count > 0 && CoinAPI.DateTimes[^1] < DateTime.Today.AddDays(-1))) { var data = GetCoinAPIAPI(symbol); CoinAPI.Tooltip = $"{Name}:{symbol}"; var j = 0; foreach (var kvp in data) { try { if (!Double.IsNaN(kvp.Value) && !CoinAPI.DateTimes.Contains(kvp.Key)) { //WLHost.Instance.AddLogItem(Name, $"{kvp.Key} {kvp.Value}", WLColor.Green); CoinAPI.Add(kvp.Value, kvp.Key); } } catch (Exception ex1) { WLHost.Instance.AddLogItem(Name, $"Generating data foreach (var kvp in data):{kvp.Key} : {kvp.Value} : {ex1.Message} " + ex1.StackTrace, WLColor.Green); } } try { CoinAPI.SaveHistoryToCache(Name, symbol); } catch (Exception ex1) { WLHost.Instance.AddLogItem(Name, $"Generating data SaveHistoryToCache: {ex1.Message} " + ex1.StackTrace, WLColor.Green); } } } catch (Exception ex) { // Log any errors during data retrieval. WLHost.Instance.AddLogItem(Name, $"Generating data: {ex.Message} " + ex.StackTrace, WLColor.Green); } return CoinAPI; } //private static readonly HttpClient client = new HttpClient(); private static Dictionary<DateTime, double> GetCoinAPIAPI(String symbol) { HttpClient client = new HttpClient(); var data = new Dictionary<DateTime, double>(); try { WLHost.Instance.AddLogItem(Name, $"Fetching data for :" + symbol, WLColor.Green); // Set up HTTP client with necessary headers. // WLWebClient client = new WLWebClient(WLWebClientOptions.Compression); client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); client.DefaultRequestHeaders.Add("Accept-Encoding", "gzip"); client.DefaultRequestHeaders.Add("Upgrade-Insecure-Requests", "1"); client.DefaultRequestHeaders.Add("X-CoinAPI-Key", "YOUOWNFREEAPIKEY"); string url = $"<a href="https://rest.coinapi.io/v1/ohlcv/" target="_blank">https://rest.coinapi.io/v1/ohlcv/</a>{symbol}/history?period_id=1DAY&limit=10000"; string result = ""; try { // Send a GET request //response = client.GetStringAsync(url).Result; var request = new HttpRequestMessage(HttpMethod.Get, url); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Accept-Encoding", "gzip"); request.Headers.Add("Upgrade-Insecure-Requests", "1"); request.Headers.Add("X-CoinAPI-Key", "4d50d598-b471-4617-97ef-1c9ebf4d606d"); // Send request and get response synchronously var response = client.Send(request); response.EnsureSuccessStatusCode(); // Decompress if necessary (e.g., gzip) var contentStream = response.Content.ReadAsStream(); using (var decompressedStream = new GZipStream(contentStream, CompressionMode.Decompress)) using (var reader = new StreamReader(decompressedStream, Encoding.UTF8)) { result = reader.ReadToEnd(); } } catch (Exception ex) { } //string result = "[]"; //WLHost.Instance.AddLogItem(Name, $"Data: {HttpClient} ", WLColor.Green); // Parse the JSON response. var jsonResponse = JArray.Parse(result); var dataArray = jsonResponse; var adjustedSymbolName = symbol;//ConvertSymbolName(symbol); WLHost.Instance.AddLogItem(Name, $"Fetching data for : {adjustedSymbolName} ", WLColor.Green); // Extract date and value pairs from the JSON array. foreach (var item in dataArray) { // Optional: Log the item for debugging // WLHost.Instance.AddLogItem(Name, item.ToString(), WLColor.Green); // Extract and parse the 'time_period_start' field if (DateTime.TryParse(item["time_period_start"]?.ToString(), out DateTime dateTime) && item["price_close"] != null) { // Extract the date component (without time) if needed DateTime date = dateTime.Date; // Parse the 'price_close' value if (double.TryParse(item["price_close"].ToString().Replace(",","."), NumberStyles.Any, CultureInfo.InvariantCulture, out double priceClose)) { // Store the date and price_close in the dictionary data[date] = priceClose; } else { // Handle parsing error for price_close if necessary // For example, log the error // WLHost.Instance.AddLogItem(Name, $"Invalid price_close value: {item["price_close"]}", WLColor.Red); } } else { // Handle parsing error for time_period_start or missing price_close if necessary // For example, log the error // WLHost.Instance.AddLogItem(Name, $"Invalid time_period_start or missing price_close: {item}", WLColor.Red); } } } catch (Exception ex) { // Log any errors during data retrieval. WLHost.Instance.AddLogItem(Name, $"Error fetching data: {ex.Message} " + ex.StackTrace, WLColor.Green); } return data; // Return the populated dictionary. } public static string ConvertSymbolName(string input) { if (string.IsNullOrEmpty(input)) return input; var result = new StringBuilder(); bool capitalizeNext = false; foreach (char c in input) { if (c == '-') { capitalizeNext = true; } else { if (capitalizeNext) { result.Append(char.ToUpper(c)); capitalizeNext = false; } else { result.Append(c); } } } return result.ToString(); } public static void LogFirstAndLast(TimeSeries ts, int number, string message) { for (int n = 0; n < number && n < ts.Values.Count - 1; n++) { WLHost.Instance.AddLogItem(Name, message + $" Values[{n}] {ts.Values[n]}", WLColor.Green); } for (int n = ts.Values.Count - 1; n > (ts.Values.Count - 1 - number) && n >= 0; n--) { WLHost.Instance.AddLogItem(Name, message + $" Values[{n}] {ts.Values[n]}", WLColor.Green); } for (int n = 0; n < number && n < ts.Values.Count - 1; n++) { WLHost.Instance.AddLogItem(Name, message + $" DateTimes[{n}] {ts.DateTimes[n]}", WLColor.Green); } for (int n = ts.Values.Count - 1; n > (ts.Values.Count - 1 - number) && n >= 0; n--) { WLHost.Instance.AddLogItem(Name, message + $" DateTimes[{n}] {ts.DateTimes[n]}", WLColor.Green); } } } }
Rename
How many Indicator classes have you named "CoinAPI" or "BitcoinData"?
Only one of each.
I can get the file to load/compile if I comment out both
1. Everything about HttpClient
2. new GZipStream(contentStream, CompressionMode.Decompress);
So it's likely some problem with the Assembly references (I've doublechecked that I have checked the required ones) that are causing the issue.
Everything works OK if 1 and 2 are added during runtime. Compiles and loads data without issues.
Code that can be compiled and loaded at startup, but obviosly doesnt do much due to comments.:
I can get the file to load/compile if I comment out both
1. Everything about HttpClient
2. new GZipStream(contentStream, CompressionMode.Decompress);
So it's likely some problem with the Assembly references (I've doublechecked that I have checked the required ones) that are causing the issue.
Everything works OK if 1 and 2 are added during runtime. Compiles and loads data without issues.
Code that can be compiled and loaded at startup, but obviosly doesnt do much due to comments.:
CODE:
using WealthLab.Core; using System; using System.Text; using System.Collections.Generic; using System.Globalization; using WealthLab.Indicators; using Newtonsoft.Json.Linq; using System.Diagnostics; using System.Text.RegularExpressions; using System.Linq; using System.IO.Compression; using System.IO; using System.Net; using System.Net.Http; using System.Threading.Tasks; namespace WealthLab.MyIndicators { public class CoinAPI : IndicatorBase { public bool ExtendedDebug = false; //parameterless constructor public CoinAPI() : base() { } //for code based construction public CoinAPI(TimeSeries source, String symbol) : base() { Parameters[0].Value = source; Parameters[1].Value = symbol; Populate(); } //static Series method public static CoinAPI Series(TimeSeries source, String symbol) { return new CoinAPI(source, symbol); } //name public override string Name { get { return "CoinAPI"; } } //abbreviation public override string Abbreviation { get { return "CoinAPI"; } } //description public override string HelpDescription { get { return ""; } } //price pane public override string PaneTag { get { return "CoinAPI"; } } //default color public override WLColor DefaultColor { get { return WLColor.FromArgb(255, 0, 0, 255); } } //default plot style public override PlotStyle DefaultPlotStyle { get { return PlotStyle.Line; } } //populate public override void Populate() { TimeSeries source = Parameters[0].AsTimeSeries; String symbol = Parameters[1].AsString; if (ExtendedDebug) WLHost.Instance.AddLogItem(Name, $"Generating data source.DateTimes.First:" + source.DateTimes.First().ToString(), WLColor.Green); DateTimes = source.DateTimes; var CoinAPI = CoinAPIFactory.GetCoinAPI(symbol); if (ExtendedDebug) WLHost.Instance.AddLogItem(Name, $"Generating data CoinAPI.Count (1)" + CoinAPI.DateTimes.Count + " " + CoinAPI.Values.Count, WLColor.Green); if (ExtendedDebug) CoinAPIFactory.LogFirstAndLast(CoinAPI, 2, "CoinAPI (1) "); TimeSeries ts = null; if (source != null && source.Count > 0) { //var sourceClone double lastValue = Double.NaN; var valueList = new List<double>(); ts = MergeDataPoints(CoinAPI, source); //ts = TimeSeriesSynchronizer.Synchronize(CoinAPI, (TimeSeriesBase)source); } if (ts != null) { if (ExtendedDebug) WLHost.Instance.AddLogItem(Name, $"Generating data source.DateTimes.First:" + source.DateTimes.First().ToString() + " ts.DateTimes.First " + ts.DateTimes.First().ToString(), WLColor.Green); if (ExtendedDebug) CoinAPIFactory.LogFirstAndLast(this, 2, "This (2) "); if (ExtendedDebug) CoinAPIFactory.LogFirstAndLast(ts, 2, "ts (2) "); if (ExtendedDebug) WLHost.Instance.AddLogItem(Name, $"Generating data this.Count (2):" + CoinAPI.DateTimes.Count + " " + CoinAPI.Values.Count, WLColor.Green); DateTimes = source.DateTimes; this.AssumeValuesOf(ts); if (ExtendedDebug) WLHost.Instance.AddLogItem(Name, $"Generating data this.Count (3):" + this.DateTimes.Count + " " + this.Values.Count, WLColor.Green); if (ExtendedDebug) CoinAPIFactory.LogFirstAndLast(this, 2, "This (3) "); if (ExtendedDebug) CoinAPIFactory.LogFirstAndLast(ts, 2, "ts (3) "); } else { if (ExtendedDebug) WLHost.Instance.AddLogItem(Name, $"Generating data timeSeries else", WLColor.Green); this.DateTimes = source.DateTimes; } if (ExtendedDebug) WLHost.Instance.AddLogItem(Name, $"Generating data timeSeries END", WLColor.Green); } //generate parameters protected override void GenerateParameters() { AddParameter("Source", ParameterType.TimeSeries, PriceComponent.Close); AddParameter("Symbol", ParameterType.String, "KRAKENFTS_PERP_BTC_USD"); } public TimeSeries MergeDataPoints(TimeSeries instance1, TimeSeries instance2) { // Create a dictionary from instance1 for quick DateTime to Value lookup var valueDict = new Dictionary<DateTime, double>(); for (int i = 0; i < instance1.DateTimes.Count; i++) { // Ensure there are equal counts of DateTimes and Values if (i < instance1.Values.Count) { // If there are duplicate DateTimes in instance1, decide how to handle them. // Here, we'll overwrite with the latest value. valueDict[instance1.DateTimes[i]] = instance1.Values[i]; } } // Prepare the new DataClass instance TimeSeries mergedInstance = new TimeSeries(); foreach (var dt in instance2.DateTimes) { mergedInstance.DateTimes.Add(dt); if (valueDict.TryGetValue(dt, out double value)) { mergedInstance.Values.Add(value); } else { mergedInstance.Values.Add(Double.NaN); } } return mergedInstance; } } public static class CoinAPIFactory { public static string Name = "CoinAPI"; public static CoinAPI GetCoinAPI(string symbol) { var CoinAPI = new CoinAPI(); WLHost.Instance.AddLogItem(Name, $"Generating data: (Start)", WLColor.Green); try { bool loadedFromCache = false; try { loadedFromCache = CoinAPI.LoadDataFromCache(Name, symbol, DateTime.MinValue, DateTime.MaxValue, 0); } catch (Exception ex1) { WLHost.Instance.AddLogItem(Name, $"Generating data LoadDataFromCache: {ex1.Message} " + ex1.StackTrace, WLColor.Green); } WLHost.Instance.AddLogItem(Name, $"loadedFromCache: {loadedFromCache} {CoinAPI.Count}", WLColor.Green); if (CoinAPI.Count == 0 | (loadedFromCache && CoinAPI.Count > 0 && CoinAPI.DateTimes[^1] < DateTime.Today.AddDays(-1))) { var data = GetCoinAPIAPI(symbol); CoinAPI.Tooltip = $"{Name}:{symbol}"; var j = 0; foreach (var kvp in data) { try { if (!Double.IsNaN(kvp.Value) && !CoinAPI.DateTimes.Contains(kvp.Key)) { //WLHost.Instance.AddLogItem(Name, $"{kvp.Key} {kvp.Value}", WLColor.Green); CoinAPI.Add(kvp.Value, kvp.Key); } } catch (Exception ex1) { WLHost.Instance.AddLogItem(Name, $"Generating data foreach (var kvp in data):{kvp.Key} : {kvp.Value} : {ex1.Message} " + ex1.StackTrace, WLColor.Green); } } try { CoinAPI.SaveHistoryToCache(Name, symbol); } catch (Exception ex1) { WLHost.Instance.AddLogItem(Name, $"Generating data SaveHistoryToCache: {ex1.Message} " + ex1.StackTrace, WLColor.Green); } } } catch (Exception ex) { // Log any errors during data retrieval. WLHost.Instance.AddLogItem(Name, $"Generating data: {ex.Message} " + ex.StackTrace, WLColor.Green); } return CoinAPI; } //private static readonly HttpClient client = new HttpClient(); private static Dictionary<DateTime, double> GetCoinAPIAPI(String symbol) { //var client = new HttpClient(); var data = new Dictionary<DateTime, double>(); try { WLHost.Instance.AddLogItem(Name, $"Fetching data for :" + symbol, WLColor.Green); // Set up HTTP client with necessary headers. // WLWebClient client = new WLWebClient(WLWebClientOptions.Compression); /*client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); client.DefaultRequestHeaders.Add("Accept-Encoding", "gzip"); client.DefaultRequestHeaders.Add("Upgrade-Insecure-Requests", "1"); client.DefaultRequestHeaders.Add("X-CoinAPI-Key", "4d50d598-b471-4617-97ef-1c9ebf4d606d"); string url = $"<a href="https://rest.coinapi.io/v1/ohlcv/" target="_blank">https://rest.coinapi.io/v1/ohlcv/</a>{symbol}/history?period_id=1DAY&limit=10000"; string result = ""; try { // Send a GET request //response = client.GetStringAsync(url).Result; var request = new HttpRequestMessage(HttpMethod.Get, url); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Accept-Encoding", "gzip"); request.Headers.Add("Upgrade-Insecure-Requests", "1"); request.Headers.Add("X-CoinAPI-Key", "MYSECRETAPIKEY"); // Send request and get response synchronously var response = client.Send(request); response.EnsureSuccessStatusCode(); // Decompress if necessary (e.g., gzip) var contentStream = response.Content.ReadAsStream(); /* using (var decompressedStream = new GZipStream(contentStream, CompressionMode.Decompress)) using (var reader = new StreamReader(decompressedStream, Encoding.UTF8)) { result = reader.ReadToEnd(); } } catch (Exception ex) { } */ //var contentStream = new MemoryStream(); //var decompressedStream = new GZipStream(contentStream, CompressionMode.Decompress); //using (var decompressedStream = new GZipStream(contentStream, CompressionMode.Decompress)) { //using (var reader = new StreamReader(decompressedStream, Encoding.UTF8)) //{ // var result1 = reader.ReadToEnd(); //} string result = "[]"; // Parse the JSON response. var jsonResponse = JArray.Parse(result); var dataArray = jsonResponse; var adjustedSymbolName = symbol;//ConvertSymbolName(symbol); WLHost.Instance.AddLogItem(Name, $"Fetching data for : {adjustedSymbolName} ", WLColor.Green); // Extract date and value pairs from the JSON array. foreach (var item in dataArray) { // Optional: Log the item for debugging // WLHost.Instance.AddLogItem(Name, item.ToString(), WLColor.Green); // Extract and parse the 'time_period_start' field if (DateTime.TryParse(item["time_period_start"]?.ToString(), out DateTime dateTime) && item["price_close"] != null) { // Extract the date component (without time) if needed DateTime date = dateTime.Date; // Parse the 'price_close' value if (double.TryParse(item["price_close"].ToString().Replace(",", "."), NumberStyles.Any, CultureInfo.InvariantCulture, out double priceClose)) { // Store the date and price_close in the dictionary data[date] = priceClose; } else { // Handle parsing error for price_close if necessary // For example, log the error // WLHost.Instance.AddLogItem(Name, $"Invalid price_close value: {item["price_close"]}", WLColor.Red); } } else { // Handle parsing error for time_period_start or missing price_close if necessary // For example, log the error // WLHost.Instance.AddLogItem(Name, $"Invalid time_period_start or missing price_close: {item}", WLColor.Red); } } } catch (Exception ex) { // Log any errors during data retrieval. WLHost.Instance.AddLogItem(Name, $"Error fetching data: {ex.Message} " + ex.StackTrace, WLColor.Green); } return data; // Return the populated dictionary. } public static string ConvertSymbolName(string input) { if (string.IsNullOrEmpty(input)) return input; var result = new StringBuilder(); bool capitalizeNext = false; foreach (char c in input) { if (c == '-') { capitalizeNext = true; } else { if (capitalizeNext) { result.Append(char.ToUpper(c)); capitalizeNext = false; } else { result.Append(c); } } } return result.ToString(); } public static void LogFirstAndLast(TimeSeries ts, int number, string message) { for (int n = 0; n < number && n < ts.Values.Count - 1; n++) { WLHost.Instance.AddLogItem(Name, message + $" Values[{n}] {ts.Values[n]}", WLColor.Green); } for (int n = ts.Values.Count - 1; n > (ts.Values.Count - 1 - number) && n >= 0; n--) { WLHost.Instance.AddLogItem(Name, message + $" Values[{n}] {ts.Values[n]}", WLColor.Green); } for (int n = 0; n < number && n < ts.Values.Count - 1; n++) { WLHost.Instance.AddLogItem(Name, message + $" DateTimes[{n}] {ts.DateTimes[n]}", WLColor.Green); } for (int n = ts.Values.Count - 1; n > (ts.Values.Count - 1 - number) && n >= 0; n--) { WLHost.Instance.AddLogItem(Name, message + $" DateTimes[{n}] {ts.DateTimes[n]}", WLColor.Green); } } } }
No need to troubleshoot this anymore. Got it working to make httprequest without compression.
Your Response
Post
Edit Post
Login is required