Algorithmic Skepticism: How to Trade Based on Mathematics, Not Emotions - читать онлайн бесплатно, автор Julius Vega, ЛитПортал
На страницу:
3 из 4
Настройки чтения
Размер шрифта
Высота строк
Поля

Emergent behavior manifests in more subtle forms as well—for instance, when cross-instrument and cross-exchange arbitrage algorithms begin transmitting a localized price shock into a global one, spreading the imbalance across the entire interconnected network of markets within fractions of a second. What begins as a minor anomaly on a single venue turns into a systemic event encompassing dozens of correlated assets before human consciousness has time to comprehend what is happening.

Inadequate Volatility Assessment

The fifth vulnerability concerns a fundamental assumption underlying most risk models: that volatility obeys predictable statistical laws, and that its historical distribution provides a sufficient basis for assessing future risk. This assumption holds up reasonably well during calm periods and breaks down catastrophically at moments of structural shift.

Classical parametric models relying on the normal distribution of price increments systematically underestimate the probability of extreme deviations—the so-called fat tails of the distribution. In reality, sharp movements occur far more frequently than theoretical models predict, and their amplitude can exceed expectations several times over. An algorithm that sizes its positions based on the standard deviation of the preceding weeks or months turns out to be fundamentally unprepared for an event that, statistically, should occur once a decade but in practice occurs far more often—largely because real market distributions do not conform to simplified theoretical models.

There is also a reverse side to this problem—volatility clustering, a phenomenon whereby periods of calm and periods of turbulence tend to cluster in time rather than distribute evenly. A model trained on a prolonged calm period comes to treat low volatility as the norm and calibrates its risk parameters accordingly low. When the market enters a turbulent phase, this understated calibration produces a systematic underestimation of risk precisely at the moment when the cost of error is greatest. Indicators built on historical variance respond to a regime change with a lag, since by their very construction they average information over some period rather than instantly recognizing a structural break.

Particularly dangerous is the situation in which low liquidity and understated volatility estimates compound one another. An algorithm sees a calm market with tight spreads and infers low risk, not realizing that this calm is illusory and holds only until an order large enough to appear reveals the true fragility of the liquidity beneath it. At that moment, the model that underestimated volatility finds itself doubly vulnerable—not only is it unprepared for a sharp price move, but it is also unprepared for that move to be amplified by the absence of opposing orders in the book.

Cognitive Biases of Developers as a Hidden Source of Systemic Risk

The sixth, and in some sense the most fundamental vulnerability, is rooted not in mathematics or market mechanics, but in the mind of the person who creates the algorithm. Machine learning is conventionally considered objective simply because it operates with numbers rather than emotions. Yet every number, every training dataset, every chosen hyperparameter passes through a human decision, and thus bears the imprint of the very same cognitive biases from which algorithmic trading is meant to liberate the trader.

The first and most widespread bias of the developer is confirmation bias in the selection of training data. A strategy creator, initially convinced of the existence of a particular pattern, tends unconsciously to select the historical period and set of instruments in such a way that the hypothesis is confirmed. This is not always a conscious falsification. More often it is the result of dozens of minor decisions, each of which seems neutral, but which in aggregate steer the sample toward the desired result. The choice of this time window rather than an adjacent one, this evaluation metric rather than an alternative, this method of handling outliers rather than another—all of these are points where subjectivity seeps into what is supposedly an objective system.

The second bias is excessive faith in complexity as a marker of quality. A developer who has spent months building a multilayered model with dozens of parameters is psychologically inclined to regard its superiority over simple rules as self-evident, simply by virtue of the effort invested. This is the classic trap of justifying sunk costs: the more time spent creating a system, the harder it becomes to acknowledge that a simpler approach might work no worse—and at times even better—in large part because it is less susceptible to overfitting.

The third bias is the illusion of objectivity in metrics. A developer choosing the objective function for model optimization brings to that choice their own beliefs about what matters and what is secondary. Optimization exclusively for total returns without accounting for the depth and duration of drawdowns reflects a hidden assumption about the psychological resilience of the future user of the system, an assumption that is rarely tested explicitly. A metric that appears strictly mathematical in fact embodies the creator's subjective choice of priorities.

Finally, the fourth and perhaps most insidious bias is the endowment effect applied to one's own creation. A developer who has invested intellectual effort and time into a particular architecture tends to interpret ambiguous testing results in favor of their model, to delay acknowledging its failure, and to seek justifications for individual losing trade sequences instead of honestly reassessing fundamental assumptions. This bias explains why numerous demonstrably unviable strategies continue to be exploited far longer than cold statistical analysis would permit: their creators are psychologically unprepared to admit the defeat of their own intellectual construct.

The aggregate of these six vulnerabilities forms not a list of isolated risks, but an interconnected system of weak points, where an error in one dimension amplifies vulnerability in another. An overfitted model is especially dangerous under conditions of low liquidity, since it cannot recognize a regime shift in time due to time lags in indicator calculation. Inadequate volatility assessment becomes fatal at the very moment of emergent resonance among multiple algorithms. And underlying all of this stands the human being, whose own cognitive biases are invisibly embedded in code that is conventionally deemed impartial. Understanding this architecture of vulnerabilities is not a reason to abandon algorithmic trading, but rather a necessary condition for building systems capable of surviving not in the ideal laboratory conditions of a historical backtest, but in the real, unpredictable, and constantly changing market.

Chapter 4: Metrics and Filters for Market Analysis

Three Pillars of Filtration: Volatility, Liquidity, Momentum

Any attempt to analyze the market without a clear system of coordinates is doomed to become an endless wandering among candlesticks, lines, and multicolored indicators. To avoid drowning in this visual noise, we must isolate the foundation—three parameters around which the entire subsequent architecture of signal filtration is built: volatility, liquidity, and momentum. Each addresses its own task, and only their joint application creates a robust system of decision-making.

Volatility answers the question "how strongly can price change over a chosen time interval." It is not an abstract quantity, but an applied tool for calculating risk. A trader who ignores volatility is condemned either to stops so tight they get knocked out by market noise, or so wide that they turn capital management into a lottery. Volatility is dynamic: it contracts during periods of consolidation and expands sharply at moments of news releases or structural shifts. Understanding the current phase of volatility is the first filter that determines whether it is worth considering entry into a position at all.

Liquidity is responsible for the executability of an idea. One can construct a strategy that is impeccable from the standpoint of logic, but if the market at the moment of intended entry lacks sufficient depth, any trade will become a struggle against slippage and widened spreads. Liquidity is not a constant, but a variable that changes depending on the time of day, day of the week, and the approach of macroeconomic events. Filtering by liquidity means that the trader consciously refuses entries during periods when the market is structurally unprepared to accept their order without losses.

Momentum is the third element, responsible for the strength and direction of the current movement. It shows how convincingly the market is moving in the chosen direction, and allows us to distinguish a full-fledged impulse from a sluggish price drift. Momentum does not exist in isolation from volatility and liquidity: strong movement under low liquidity often proves artificial and quickly retraces, whereas the same movement under high volume and sufficient order book depth testifies to a genuine redistribution of forces between buyers and sellers.

The synthesis of these three metrics creates a complete filter. Volatility determines the size of risk, liquidity determines the very possibility of safe execution, and momentum determines whether there is any sense in considering the movement as significant at all. The absence of even one element from this triad transforms analysis into an incomplete picture, where decisions are made blindly with respect to one of the key aspects of market mechanics.

Volatility as a Risk Calculation Tool, Not Merely an Indicator

A widespread error lies in treating volatility as a secondary technical indicator, useful only for adjusting the appearance of a chart. In reality, volatility is the foundation upon which an entire capital management system is built. The Average True Range, reflecting the typical amplitude of price movement over a chosen period, should not be used in isolation, but rather in direct conjunction with position size and stop-loss level.

The logic is straightforward: if the typical daily range of an asset is two and a half percent, yet the stop-loss is placed at one percent, the trader is playing against the statistics of their own instrument. The market will, with high probability, hit such a stop before the movement has time to develop in the anticipated direction. The correct approach presupposes an inverse relationship: the higher the current volatility of the instrument, the smaller the volume of the position being opened should be, and the wider the stop-loss should be relative to the entry point.

One should recognize that volatility is not static over time. There exist periods of compression, when the range of movements contracts and the market seems to pause before a decision, and periods of expansion, when amplitude suddenly increases. The transition from compression to expansion is one of the most informative signals, since it often precedes strong directional movement. The analyst's task is to track not only the absolute value of volatility, but also its historical dynamics, comparing current readings against multi-year average values. A sharp deviation from the norm is a signal that market conditions have changed and require a reassessment of customary risk parameters.

Volatility and liquidity are closely intertwined. The market becomes most dangerous for mechanical adherence to familiar rules exactly when liquidity suddenly falls while volatility simultaneously rises. Such a combination often precedes gaps, breaks, and cascading movements, where standard risk calculation models cease to function correctly. Understanding this interrelationship compels us to treat volatility not as a static figure in the corner of a chart, but as a living, constantly changing indicator of market state.

Liquidity as the Foundation of Idea Execution

Liquidity is often underestimated by beginning market participants, who focus exclusively on price direction while forgetting how realistic it actually is to enter and exit a position without substantial costs. Yet liquidity is what determines whether a theoretically sound idea will turn into a profitable trade or drown in slippage and a widened spread.

The key error lies in assessing liquidity solely through the lens of total trading volume over a period. The absolute magnitude of turnover tells us little without understanding how it is distributed across time and price levels. Far more informative is the analysis of trade clustering—how volume is distributed around specific price points. If large volume concentrates within a narrow range, this signals the formation of a significant zone of interest among market participants, whereas volume spread thinly across a wide range points rather to an absence of consensus.

Liquidity also possesses a pronounced temporal structure. Different trading sessions exhibit fundamentally different market depth: periods of overlap between major sessions are traditionally characterized by elevated activity, while nighttime hours or pre-holiday periods are accompanied by a thinning of the order book. In such moments, even an order that would be modest by the standards of an ordinary day can trigger a move disproportionate to the real fundamental interest in the asset. Filtering signals by time of day is a necessary element of discipline, especially for instruments traded around the clock.

A practical filter worth incorporating into any analytical system is comparing current volume against the median value for the preceding period. If volume at the moment a signal forms is substantially below the typical level, it is reasonable to disregard that signal regardless of how visually attractive it appears on the chart. A breakout of a key level against a backdrop of depleted liquidity will, with high probability, prove false, since the move is not backed by enough real participants willing to hold the new price.

The imbalance between buy and sell volume near significant price levels needs close examination. If price repeatedly tests a certain level, yet the volume of aggressive buying consistently declines, this signals weakening interest even though the level has not formally been broken. Such a divergence between price and volume is one of the most reliable indicators of an approaching shift in the balance of power.

Momentum and Its True Nature

Momentum is often confused with simple price direction, although it is in fact a fundamentally different category—it measures the speed and force of change, not the fact of a rise or fall itself. An asset may be rising, yet doing so ever more slowly, losing the inner energy of its move long before the price formally reverses. This is where the diagnostic value of momentum comes in: it allows us to see trend exhaustion before it becomes obvious from price itself.

Working with momentum requires understanding its relative, rather than absolute, nature. A strong move in a low-liquidity asset with a thin order book may look impressive on a chart yet carry no predictive value whatsoever, since it is not confirmed by real participation from major players. Conversely, a move moderate in amplitude, accompanied by steady volume growth and narrowing spreads, may signal the formation of a sustainable trend.

A substantial error when working with momentum is examining it in isolation from the broader market context. A signal of accelerating movement carries fundamentally different weight depending on whether it occurs at the beginning of a trend, in its middle, or on the approach to a historical resistance level. The same numerical momentum reading can mean trend continuation in one context and a sign of exhaustion in another. That is why momentum should never be used as a standalone, isolated trigger for decision-making: it acquires meaning only in combination with the assessment of volatility and liquidity described above.

Timeframe Selection as an Architectural Decision

The choice of temporal scale for analysis is not a secondary technical detail, but a fundamental architectural decision that determines the entire subsequent logic of the system. Different timeframes answer fundamentally different questions, and any attempt to use the same horizon for all tasks inevitably leads to distorted conclusions.

Short-term trading with position holding spanning minutes or hours requires working with lower intervals—from minute to hourly candles. At these scales, market microstructure dominates: local liquidity imbalances, brief spikes of aggressive orders, reactions to technical levels within the current session. Yet the finer the chosen interval, the more pronounced the market noise becomes—noise bearing no relation to sustainable patterns. Patterns that appear distinct on a minute chart often dissolve when the sample size increases, revealing themselves as statistical artifacts rather than reproducible models of market behavior.

Medium-term analysis, oriented toward holding positions from several days to several weeks, is reasonably constructed on a pairing of four-hour and daily charts. The four-hour interval allows us to capture local reversals and entry points with acceptable precision, while the daily chart establishes the broader context and confirms or refutes the direction suggested by the lower timeframe. This nesting of timeframes within one another is not a formality, but a method to filter out a substantial portion of false signals: movement that lacks confirmation on the higher interval will, with high probability, prove to be short-term noise.

For long-term positions, weekly and monthly charts become the primary source of information, where the overall picture emerges from the aggregate of numerous daily fluctuations, and random variations are virtually eliminated by the length of the observation period. Here, what matters is not tactical signals but macrostructural levels and the persistence of the dominant trend across many cycles.

The cardinal principle of multi-timeframe analysis is that a signal obtained on a lower interval must receive confirmation on a higher interval before it becomes grounds for action. Divergence between timeframes is not a reason to disregard the analysis, but rather an independent source of information pointing to a transitional, indeterminate state of the market—one in which it is more prudent to refrain from active moves than to attempt to guess the direction in which this conflict will resolve.

Signal Filtering by Volume

Trading volume deserves separate, in-depth consideration, since it is most often the decisive factor separating a genuine signal from a market artifact. Price change alone is insufficient grounds for a decision: a move unconfirmed by volume will very likely prove to be a temporary fluctuation lacking any durable foundation.

A practical approach to filtering involves comparing current volume against its rolling median over the preceding period. If a breakout of a significant level is accompanied by volume that substantially exceeds typical values, this confirms the participation of major players and raises the probability that the move will continue. If, conversely, the breakout occurs against a backdrop of average or below-average volume, it is prudent to treat such a signal with considerable skepticism.

Of particular value is the analysis of the difference between the volume of aggressive buying and the volume of aggressive selling near key price zones. A persistent skew toward buying, combined with a simultaneous absence of upward price movement, may indicate hidden accumulation by major participants who deliberately avoid a sharp shift in price so as not to trigger a premature reaction from other players. The inverse situation—price rising while the volume of confirming purchases declines—is a classic sign of a weakening trend, even if the price is formally continuing to set new local highs.

Volume clustering at specific price levels, not merely its distribution over time, adds yet another layer of analysis. Zones where the largest trading volumes have historically concentrated often go on to serve as significant support or resistance levels, since that is where the greatest mass of open positions accumulates among participants for whom that price carries psychological and financial significance.

Oscillators in the Context of Trend

The application of oscillators—indicators of overbought and oversold conditions that remain among the most widely used, yet simultaneously among the most frequently misinterpreted, tools of technical analysis—calls for careful examination. The fundamental error lies in treating the oscillator as an independent reversal signal, when in reality it merely reflects the degree of exhaustion in the current move relative to recent price history.

Oscillator readings must be interpreted strictly within the context of the broader trend, never in isolation from it. A high oscillator reading signaling overbought conditions within an uptrend by no means always foreshadows an impending reversal—far more often it simply indicates the probability of a short-term correction within a continuing upward move. Attempting to open a short position on the strength of overbought territory alone, amid a strong uptrend, is one of the most common sources of losses among novice market participants, since a trend can hold an oscillator in an extreme zone considerably longer than intuition would suggest.

The productive approach is to use the oscillator not as an independent trigger but as an additional filter layered onto an already-established trend direction. If the higher timeframe confirms an upward move and price is trading above the long-term moving average, then an oversold reading on the lower interval may be treated as an area in which to look for trend-following entries, whereas an overbought reading in that same context serves as a signal for caution rather than a trigger for opening a position against the trend.

An additional layer of filtering comes from comparing oscillator readings against the position of price relative to moving averages of different periods. If price holds above the long-term average while the oscillator reaches extreme values characteristic of overbought conditions, the statistically more probable scenario is not a full-fledged trend reversal but a correction toward the intermediate-term moving average, followed by a resumption of the primary move. Understanding this pattern spares traders from premature, loss-making attempts to trade against the dominant force in the market.

The Synthesis of Metrics as the Foundation of a Robust System

None of the metrics we have examined operates in isolation, nor should any be perceived as a self-sufficient source of trading decisions. Volatility without regard for liquidity becomes an abstract figure that fails to illuminate the real executability of an idea. Momentum without volume confirmation risks proving to be an illusion of strength where no genuine participant interest exists. An oscillator viewed outside the context of the dominant trend systematically misleads us about the probability of a reversal.

A robust signal-filtering system is built as a multilayered process, in which each successive filter strips away a portion of the noise left over from the one before it. First, the overall trend is determined on a higher timeframe; then the current level of volatility is assessed to calibrate risk; next, liquidity is checked for sufficiency to ensure safe execution; after that, volume is analyzed to confirm the significance of the move; and only at the very last stage are oscillators brought in—not as grounds for entry, but as a tool for refining timing and gauging the degree of exhaustion in the current impulse. Such a sequence transforms a collection of disparate indicators into a coherent, logically integrated architecture of analysis, in which every decision rests on a constellation of mutually confirming data rather than on a single, isolated signal.

Chapter 5: Risk and Position Management

The market does not punish an incorrect forecast. It punishes an incorrectly calculated position size. This statement sounds paradoxical to a novice convinced that the main task of trading is guessing the direction of price movement. But anyone who has spent enough time in the market knows the bitter truth: even a strategy with forecast accuracy above fifty percent can drive an account to zero if the size of each bet is not reconciled with the mathematics of capital. And conversely, a mediocre system with only a modest edge can deliver steady returns for years, provided risk management is built as an engineering discipline rather than as an intuitive sense of "how much I can afford to lose."

На страницу:
3 из 4