Hot answers tagged algorithm
21
As mentioned elsewhere on this site, Lo, Mamaysky, and Wang (2000) do exactly what you're talking about, namely algorithmic detection of head and shoulders patterns. Their definition:
Head-and-shoulders (HS) and inverted head-and-shoulders (IHS) patterns are characterized by a sequence of five consecutive local extrema $E_1,...,E_5$ such that
$$ HS ...
18
I've worked at a hedge fund that allowed GA-derived strategies. For safety, it required that all models be submitted long before production to make sure that they still worked in the backtests. So there could be a delay of up to several months before a model would be allowed to run.
It's also helpful to separate the sample universe; use a random half of the ...
15
I think the biggest problem that genetic algorithms have are overfitting, data snooping bias and that they are black boxes (not so much like Neural Networks but still - it depends on the way they are implemented).
I think they are not used very much. I guess there are a few hedge funds out there that use it but all in all they were hyped and then busted. ...
14
There are tons of languages used in this field. As for Java-based trading platforms, Marketcetera is popular with customers.
To justify switching languages, you'd need to show that there is a bottleneck preventing your team from collecting more P&L. Have you run a profiler and compared the results with tcpdump? You must show that your existing platform ...
12
I would recommend that you read "Evidence-Based Technical Analysis" by David Aronson.
Firstly, I am mentioning it because it is a highly worthwhile book.
Secondly, on pp151--161 he attempts to "objectify subjective TA", using the head-and-shoulders pattern as an example.
12
Oracle hosted a Trading Applications Developer Workshop in New York on March 15th, 2011. The slides from each of the presentations are here. One of them covers java for Trading Applications, and it seemed to me that the biggest issue raised by the audience was garbage collection. The presentation talks about some configuration parameters that can limit ...
11
I've applied GA to all sorts of things. I had some success in the deterministic world where a pattern actually existed and I knew that some physical structure existed (seismic analysis, vibration analysis, inventory calcs, etc). After I found a GA model that behaved, the real work started....figuring out why it behaved.
I also generated a lot of GA ...
10
In a typical HFT scenario (process incoming UDP quotes and send TCP order entry responses) well written Java can compete with C++ for pure speed. If you need more speed, look to improve the following:
Your code (setup a good benchmark and then profile and tune)
Your networking environment (low-latency switches, DMA NICs)
Your architecture (are you doing ...
9
I have these posts favorited from stackoverflow. They might help you.
High Frequency Trading
What programming language(s) is algorithmic trading software written in?
Why does a derivative trading position always require C++ knowledge?
Jane Street Capital, a high-frequency market making firm, uses OCaml. Here are videos from the head programmer where he ...
8
For years, I performed this brute-force search daily on my universe of tradable stocks and futures. It is a waste of time. If your computer discovers that hog futures and MSFT are cointegrated, for example, do you really care? I would never trade that pair. There is no economic connection between hogs and Microsoft, so I must assume that the reported, small ...
8
There's a lot of people here talking about how GAs are empirical, don't have theoretical foundations, are black-boxes, and the like. I beg to differ! There's a whole branch of economics devoted to looking at markets in terms of evolutionary metaphors: Evolutionary Economics!
I highly recommend the Dopfer book, The Evolutionary Foundations of Economics, ...
8
Assuming you avoid data-snooping bias and all the potential pitfalls of using the past to predict the future, trusting genetic algorithms to find the "right" solution pretty much boils down to the same bet you make when you actively manage a portfolio, whether quantitatively or discretionary. If you believe in market efficiency then increasing your ...
7
Measuring expected shortfall (also known as conditional value-at-risk) answers the simpler question of "what is my average expected loss at the i-th quantile?" given the empirical distribution of returns. A variation is value-at-risk which measures the loss at the i-th quantile.
Arguably you could leave at this this and you have your answer.
You probably ...
6
Theoretically, the answer to the question is yes, a correlation matrix for potential pairs trades can be computed in $O\left((n^2t)^{(\omega+\epsilon)/3}\right)$ time, for any $\epsilon > 0$, where $\omega < 2.38$ is the so-called exponent of matrix multiplication.
However, these algorithms have a reputation for having a very large constant factor ...
6
The most basic strategy is beta-based quantiles. That is to say, you first control for losses on your individual stock versus overall market performance. (Your trading strategy may or may not wish to hedge away the market factor using, say, SPX futures). Then you choose a quantile, call it the 5th percentile, beyond which you consider a move to be ...
5
All things being equal, stocks with the highest bid-ask spread present the greatest opportunity for the market maker
The size of the opportunity (i.e. revenue expectation) can be represented as Volume * Bid-Ask Spread. Your algorithm should rank-order that revenue expectation
Stocks with high current market values will tend to have narrower spreads and be ...
5
I have worked with C++, java and C# implementing a google like search engine for DOD in along with many other software that require high performance (using low level memory mapping and named pipes/tcp).
In my experience, you cannot match speed of C++ with the managed code. In managed code, every call to new, garbage collection, etc. requires multiple ...
4
You question is quite strange: so you do not want to use methods inspired by bioinfo and genetics (neural networks, GA, geometry of folding, etc) but methods that are used in these fields?
In terms of modeling, the problematics in bioinfo and genetics are mainly:
tree or graph matching (to build metrics in the space of molecules), like in SIGMA: a ...
4
I won't give you the answer delivered on a silver platter but hopefully the following will get your started:
a) you need to define exactly over which look-back period you aim to derive the maximum drawdown.
b) you need to keep track of the max price while you iterate the look-back window.
c) you need to keep track of the min price SUBSEQUENT to any NEW ...
3
Zipline, the opensource python backtester, has a batch and iterative implementation for max drawdown.
Here is the batch: https://github.com/quantopian/zipline/blob/master/zipline/finance/risk.py#L284
Here is the iterative:
https://github.com/quantopian/zipline/blob/master/zipline/finance/risk.py#L578
disclosure: I'm one of the zipline maintainers
3
Mathematically speaking that is an impossible thing to do. There are simply too many variables and randomness that you cannot do it.
Rather than analyzing competitors trade data; why don't you analyze the market.
You can consider every bar; as a trade. If the bar was up; it means you went long and made a profit. If the bar was down; it means you went short ...
3
Dynamic Time Warping, recursive, time-delayed feedforward neural networks, wavelets, empirical mode decomposition, ..., there's plenty of it.
BUT If you want my advice, don't go this way, I wasted too much time doing things like that. Neither big nor small players (profitably and consistently) trade this way and for a good reason. Technical analysis is a ...
2
Yes there is a way to find kth largest element in an unsorted list in linear time here. However, depending on what program you are using, implementing the algorithm might not increase performance. The built-in sort function is probably optimized in C, and hence is very fast.
2
This paper by R. Marschinski and H. Kantz may be able to help: "Learning the Optimal Trading Strategy". I have not read it but the authors have published other work which is quite innovative.
Within a realistic model of the stockmarket, we derive the most
successful trading strategy. We first identify the agent who has
realized the largest percentual ...
1
Regarding Joshua's inspired answer, I'm still not sure how you guarantee that scaling gives you the exact high and low values. I suppose that you could simulate until you get a result that is close enough. But that could be hard when, e.g., Open is near High and far from Low.
An alternative solution is to construct a Brownian Bridge between Open and High, ...
1
(After the clarification, this answer is no longer relevant)
Expected maximum drawdown is going to be highly sensitive to your choice of SDE, and to your calibration of it. Therefore you should play with a variety of parameterizations to estimate your model error.
So far as efficient computation goes, we can regard this as a payoff very similar to a ...
1
Agree with the previous post, that it is very difficult to do, if not impossible. Having said that, I once saw a presentation on a (closed) project which was trying to use neural networks to train and form trading patterns. The group had access to a large lot of trading data and the profit (or losses) made from the trades over a certain time period (like, a ...
1
I do recommend to you the chapter 8 of the Ernest Chan book "Quantitative Trading: How to Build Your Own Algorithmic Trading Business"
The chapter's name is "Conclusion: Can Independent Traders Succeed? "
The conclusion is that yes but I now cant remember very well the chapter...
1
Well pattern recognition and image processing is so developed these days. This is cutting edge in CS now and if we could identify cancer or brain tumor on a hazy image or a suspect face on an industry cam then recognizing head and shoulders on a chart is really really easy.
Support Vector Machines or entropy come to mind but there is a myriad of ...
1
Regarding trading, it depends upon one's style and temperament. Don't rely solely on Aronson's book and his views and a phrase quoted by Andrew Lo in his study. The formula posted by Tal Fishman of Head and Shoulders as quoted by Lo, Mamaysky and Wang (2000) is not exhaustive. There is a lot of scope for further improvement.
However, there are many studies ...
Only top voted, non community-wiki answers of a minimum length are eligible
