## Lossless Algorithms

The following is a lossless algorithm I invented for generating support/resist in trading with no thresholds or parameters. On each price move, the price range traveled loses a point in score. The resulting score of any price range is its support/resist strength, which declines the more it is traveled across (zero being strongest and untraveled). Visually, the price line looks like an eraser scrubbing away ranges on the chart; ranges least scrubbed thin out to support/resist lines. The reason I call it a "lossless" algorithm is because it doesn't estimate anything or use any seeded values/thresholds. There are no knobs to tweak and no assumptions to take. It is a perfect 1-to-1 map of where price moves most and least freely. It is also extremely light both in computation and space because all you're doing is a single subtraction per datapoint and the max number of ranges to keep score of is one new range per datapoint.

Those familiar with other algorithms I've written will note I habitually design my algorithms this way (to not rely on any seeded values, parameters, or numbers in general). It's especially hard to explain to those who only think in math or stats-based formulas, as the algorithm is more like a set of instructions on how a draw or perform a task. It's like pouring water over a surface to detect cracks rather than laboriously examining it; I wouldn't know where to start to describe that as a math equation, let alone prove it with empirical data (not that data actually proves anything to begin with). The trendlines algorithm I wrote years earlier for Tech Trader is designed similarly as sticks falling toward the price line and "landing" the only physical way possible. This is in contrast to most quants/data-scientists who calculate backwards instead to some arbitrary lookback window or threshold to define things; not only is their approach computationally expensive (by constantly re-sampling the last x datapoints), but the result fundamentally can only ever be an estimate, one that changes drastically depending on assumptions used. People always ask me what numbers I use for lookback window, granularity, thresholds, assumptions, etc, but for an algorithm like the one here, those things literally don't exist. It's like asking for the number of pixels in a vector image; there's no such thing. It might as well be infinite.

It's not as if I go out of my way to avoid having parameters to tweak in my algorithms; it's just not how I think. I try to imagine how I would do a task by hand, and that is what becomes the algorithm. I never see myself crunching statistics or running some equation in my head. Then again, I've always sucked at calculating numbers anyway, so I guess it makes sense I end up coding without them.

Those familiar with other algorithms I've written will note I habitually design my algorithms this way (to not rely on any seeded values, parameters, or numbers in general). It's especially hard to explain to those who only think in math or stats-based formulas, as the algorithm is more like a set of instructions on how a draw or perform a task. It's like pouring water over a surface to detect cracks rather than laboriously examining it; I wouldn't know where to start to describe that as a math equation, let alone prove it with empirical data (not that data actually proves anything to begin with). The trendlines algorithm I wrote years earlier for Tech Trader is designed similarly as sticks falling toward the price line and "landing" the only physical way possible. This is in contrast to most quants/data-scientists who calculate backwards instead to some arbitrary lookback window or threshold to define things; not only is their approach computationally expensive (by constantly re-sampling the last x datapoints), but the result fundamentally can only ever be an estimate, one that changes drastically depending on assumptions used. People always ask me what numbers I use for lookback window, granularity, thresholds, assumptions, etc, but for an algorithm like the one here, those things literally don't exist. It's like asking for the number of pixels in a vector image; there's no such thing. It might as well be infinite.

It's not as if I go out of my way to avoid having parameters to tweak in my algorithms; it's just not how I think. I try to imagine how I would do a task by hand, and that is what becomes the algorithm. I never see myself crunching statistics or running some equation in my head. Then again, I've always sucked at calculating numbers anyway, so I guess it makes sense I end up coding without them.

188 unique view(s)

« Data Does Not Equal Fact | -More Ideas- |

« Death is Only a Door | -Back to Blabberbox- | The Sound That Isn't There » |