|
|
|
|
|
by withinboredom
981 days ago
|
|
Looking at the code, the purpose was to locate the nearest resistance by analyzing current orders in the market, and the slope of the orders around each resistance point, over time. This was used as one signal on whether or buy/sell. Std Deviation was calculated with this code: 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. |
|