Closed ElDuderinoBerlin closed 1 year ago
@maddinthegreat I purposely kept it this way to allow users to decide what to do with the data themselves. I'm open to suggestions of course
Hi,
where do you get the URLs from? Is there an API documentation for the Yahoo-API? Didn't find something.
Regards Martin
I made this that way:
public sealed class StockSplitData { public DateTime Date { get; set; } = default!; public string StockSplit { get; set; } = default!;
private void Parse(out double before, out double after)
{
var splitted = StockSplit.Split(':');
if (splitted.Length != 2 || !double.TryParse(splitted[0], out after) || !double.TryParse(splitted[1], out before))
{
throw new FormatException($"{nameof(StockSplit)} has incorrect format!");
}
}
public double Before
{
get
{
Parse(out var before, out var after);
return before;
}
}
public double After
{
get
{
Parse(out var before, out var after);
return after;
}
}
public override string ToString()
{
return $"Date: {Date:dd.MM.yyyy} - Before: {Before:#.#}, After:{After:#.#}";
}
}
@maddinthegreat These urls were compiled mostly by a good friend of mine who managed to analyze the internal data network that Yahoo uses to populate their website. These are not meant to be public at all so you won't find any documentation for any of them. As far as your code goes, I will use something similar to return a StockSplit object that will have the converted values. Or if you want, you could contribute to this project and add some of your code instead. Let me know
Stale issue message
Hi,
splits shall be numerator / denominator, not a string.
In most cases ppl must parse the string and build the ratio to calculate adjusted prices.
Just a hint.
Regards Martin