It also monitored the buy/sell gap, and took some notes from that (large gaps mean new resistances while a small gap means waiting for a big order to break through and cause volatility).
> soooo basically there is no bias
> Looks like it. Though I think md5 is faster, which is maybe what I’m remembering, now that I think about it. This was years ago, funny how memory gets tainted.
public static decimal StdDeviation(IEnumerable<decimal> data, decimal mean)
{
var sumOfSquares = data.Select(x => (x - mean) * (x - mean)).Sum();
return (decimal) Math.Sqrt((double) sumOfSquares / (data.Count() - 1));
}
It was written at 1:30am, according to git blame ... there's even a potential division by 0 hiding in there, so this is some shit code 'just to see what happens'. Anyway, that `data.Count() - 1` is the part that is "wrong" and tbh, I have no idea how it changes things.The mean passed to it wasn't even a true mean either, it was a sliding window mean, of a specific area of resistance multiplied by reciprocal of an "influence" coefficient. Yeah... I have no idea how this shit worked. This is nearly 5 years old at this point and hasn't run in 3+ years.
It used to output a realtime graph that was visible from the web, it would show the output of all this math. From what I remember, this signal shows as a line on the buy side, sloping up/down. That slope indicated whether a specific resistance line was at risk of dissolving or a new one being created with the idea being to buy as much as possible before the resistance line actually dissolved.