Category Archives: probability

Trade Exit Strategy

I’ve not put all that much focus on trade exit strategies as usually have relied on trading signal to determine when to reverse a position (in addition to various risk related parameters).   I have a situation, now, where I need to determine the exit independent of the signal.   Thus will need to make an exit decision based on other criteria.

As the saying goes, “cut your losses short and let your profits run”.   As simple as this sounds is not necessarily simple to implement.   Any given price path will have “retracements”, i.e. price will not move in a monotonic fashion.    So how does one set the “trigger” to exit the trade such that can ride over “retracement” noise towards more profit?

Standard Practice
Standard practice is to use a variety of indicators to determine when to exit a profitable trade:

  1. retracement as % of “volatility” (recent trading range)
    Using recent trading ranges (a proxy to variance) to scale the amount of retracement can work well in certain conditions.
  2. arbitrary limits: max profit, maximum trade time
    We may have a view around maximum time or profit opportunity for a strategy, allowing us to avoid a later drawdown to signal our exit.
  3. various technical indicators

Some Problems
When trading intra-day observing the market tick-to-tick, the above rules do not work well.   High frequency data has many short-lived high-amplitude spikes (high relative to typical price movements).  This is particularly evident in periods of the trading day with lower liquidity.

Whereas recent trading ranges usually provide a reasonable view on the current period’s noise level for medium-low frequency data, the same is not generally true for high frequency.

Picture 1

Optimal Approach
An optimal approach to the problem is to use a price path model where we can determine the probability of a retracement swinging back in the direction of profit;  Or for that matter, determine the probability of subsequent price action retracing prior to any significant retracement.    Such a model cannot possibly be right all of the time, but done successfully will have a significant edge over even odds.

The price path model provides the probability of a price going through a level at time t.  Given that can ask:

  • what is the probability of the price going through a level within a time period
  • what is the probability of the price remaining within a corridor within a time period

The above allow us to make optimal exit decisions based on risk considerations (the corridor) and likely (or unlikely) movement in the positive direction.

Embedded in such a model, though, is an accurate view on the price process within a near window, a view and a strategy in its own right.

I developed a general calibration and prediction framework for the price path model, however, the price process SDE needs more work (although it shows good predictive behavior in certain market conditions, does not handle all well as of yet).   Are there better alternatives for the short-term?

Mean-Reversion Collar
Short of a semi-predictive probabalistic model the next best thing might be to make use of our recently developed mean-reversion envelope.   The envelope can be tuned to various cycle periods and amplitudes.

Noise exhibits as a mean-reverting process around some evolving mean.   We can tune the envelope to encompass the level of noise we wish to ignore.   The projected mean therefore indicates the overall direction of price on average.    We can use this then to determine whether to carry the trade forward through a retracement or not.

Picture 3

9 Comments

Filed under money management, probability, strategies, volatility

Price Path Probability (Again)

So I completed a model and calibration which determines the probability of a price going through a level within a given time period. If one can arrive at a high confidence level, this is incredibly useful for multi-leg execution and as a prop strategy in its own right.

The model uses a SDE with mean reversion, a trend component, and an evolving distribution to determine the price across time. The SDE is evaluated as a monte carlo simulation on a grid. We determine the conditional probability of going from one price level to the next for a given (small) time interval. The sum of the product of the probabilities along the price path represents the posterior probability of being at the given price node at a given time.

With the grid in hand, one can query the grid to determine the probability of a price being above or below a level within a given time, etc. For some markets, we are seeing a 75% confidence level, meaning we are right 3/4 of the time. There were some markets where there was no distinct edge in the approach, I have ideas on how to adjust this, but have not had the time to revisit.

The evolution of the distribution was the most complex to model. Unlike idealized option models, where the distribution is stationary and generally gaussian, the observed intra-day distribution over short periods is neither gaussian nor stationary. We noted that the first 3 or 4 moments have dynamics which can be modelled and fitted on top of an empirical distribution.

The trending and mean reversion functions were fitted using a maximum likelihood estimate, which was easily obtained from the distribution for each time step under given assumptions. The parameters were evolved with a GA to maximize the likelihood.

Leave a comment

Filed under prediction, probability, statistics

Price Path Probability

What is the probable path of a security over the next 1 second, 5 seconds, 30 seconds?

I attended a quantitative algorithmic trading seminar 3 weeks ago where one presenter was discussing fill probability (in general terms). The presenter claimed that their model predicts the price path over the next few minutes to determine how best to read a VWAP strategy.

While I don’t believe it is possible to predict a specific price path, it is possible to determine the probability of any given price path. If we can determine the probability of any given path through time from the current price to some final price in N seconds or minutes, we can compute the expected probability of going through a price level within some period of time.

The expected probability through a node at time Tn at price level Pa on a multinomial tree will simply be the sum of the probability of all sub-paths from Ts to Tn going through Pa. That part may be simple, but accurately determining the likely paths / probabilities is a hard research problem.

Given that the number of paths is exponential with time, the farther out we look the more time it takes to compute a precise expectation. We must use a monte carlo analysis, sampling a calibrated timeseries equation, to approximate the expectation function.

Determining the timeseries function that accurately reflects the market is a very hard research problem. Alas, if I told you my approach would have to kill you 😉

Leave a comment

Filed under prediction, probability, statistics

Path Dependent Problem

Saw a fun problem posed on one of the Joel On Software forums:

On a empty chessboard, a knight starts from a point (say location x,y) and it starts moving randomly, but once it moves out of board, it can’t come back inside. So what is the total probability that it stays within the board after N steps.

This problem is similar to a digital knockout barrier option, but where the path is the random movement of a chess piece across the board rather than the movement of a security price over time. The solution I wrote up was as follows:

This can be computed as the an expectation function across all possible paths (including paths outside of the 8×8 grid). Think of a 8-way tree where the root represents the starting position and each node has 8 children representing each of the 8 possible moves from the current position.

The joint probability of:

– making the move (1/8)
– within grid (0 or 1)

should be the value of any given node (basically 1/8 or 0). For any given path of length N, the joint probability of having taken the path and being fully within the grid is either (1/8)^N or 0. The expectation function simply sums across all possible N length paths.

The expectation function and paths can be expressed as a recursive sum (assuming i,j in chessboard for [1,8]):

E(i,j,N) =

  • 1/8[E(i-2,j-1,N-1) + E(i-2,j+1,N-1) + E(i+2,j-1,N-1) + …] if 1 <= i,j <= 8
  • 1 if N <= 0
  • 0 otherwise

I would be curious to see other approaches for this problem. The recurrence relation with conditional function is interesting because can introduce a wide variety of conditions and payoffs. Would be easy to change the “barriers” and/or skews in the probability of moving in one direction versus another.

Leave a comment

Filed under probability