Ant Behavior and Trend Following

Watching ants go about their work is really fascinating. There usually is a line of workers going toward some food source and a separate line returning to the colony. However, the most fascinating aspect is how workers discover and communicate their discovery.

Each day worker ants leave the colony in search of food. They move randomly through their environment until discovering a food source. Once obtained they return to the colony with the food and mark the path with a pheromone. Here other workers find the trail and follow it to the food, leaving more pheromone, making the location easier to find.

More pheromone means more workers on the path. The random pattern of the founding worker’s path has now become a nearly straight line. This phenomena has been studied in depth by entomologist and other scientist. Including the development of Ant Colony Optimization or ACO, a probabilistic technique for locating the shortest path within a graph.

Trend following is a trading strategy made famous by Richard Dennis in the early 1980’s. Dennis turned an initial $5000 investment into over $100 million by following trends. However, his most famous feat was teaching 23 average persons how to trade using his Turtle method. So much so that his two groups earned a combined $175 million in 5 years.

These Turtle Traders wait for the market to move, then follow it. Trying to capture the majority of a trend in either direction. Dennis focused on rules rather than judgments, taking a more scientific approach than most others.

Despite its great successes, turtle trading has a rather unsettling downside. Since trends are hard to spot when they are starting and harder still to know when they are over, deep drawdowns are the norm. Meaning that many breakouts tend to be false moves, resulting in a large number of losing trades.

These traders are looking for long term success that comes often at the expense of the short term. However, they may be a way to soften the short term looses and actually improve upon this successful strategy.

A single worker ant has little importance to the overall profitability of the colony. Many of them die in the course of their job with little to no impact on the remaining ones. Their job is to continuously provide resources for the good of the group.

Finding food for the ants and spotting trends in a market are both hit or miss situations. Therefore it could be beneficial to develop a strategy based upon worker ant behavior, creating a kind of digital ant colony.

Go to the ant, thou sluggard; consider her ways, and be wise: Which having no guide, overseer, or ruler, Provideth her meat in the summer, and gathereth her food in the harvest. — Proverbs 6:6–8

A digital ant colony is a collection of trading bots, the digital ants, with small amounts of funds under their control. Each digital ant starts by continuously taking tiny random trades. When positions becoming profitable, they are communicated to the other digital ants. Allowing the others to join in the trend. Otherwise, the digital ant closes the position and takes another trade.

If multiple digital ants discover trends at the same time, the other workers not in a position decide who to follow based on the digital pheromone level. Determining which digital ant to follow is based on the weight of the signal.

This digital pheromone signal weight is increased for an individual worker each time they discover a successful trend and decreased over n time without one. Therefore the most successful digital ants are the ones followed the most. After n time of unprofitability, the digital ant dies with their funds transferred to a new ant.

Digital ants do not learn. They mimic natural worker ants in that they discover profitability at random, sharing the location of their prize with the others. All functioning for the good of the colony.

The benefit to this system is minimal loss and a higher probability of trend discovery. For example, consider a turtle trade made by an individual. If the trend never forms, one could lose a 10 to 50% of their investment. However, the bigger issue would be the opportunity loss from missing another trend due to being stuck in a bad position.

In contrast, the ant model would only trade a small amount to test the trend. The discovery portion only risks the minimum trade accepted for the asset. If a trend is spotted, other ants take the same positions within different points on the trend and continue to do so until it is over.

The cost to find the end of the trend is just one to two times the minimum investment for a single ant. This is because all digital ants close their positions once the trend starts to reverse.

To illustrate, consider a trend for Natural Gas Futures trading at $3.00. The first ant takes a position and risks $3.00. After n time, the trade is making a profit and looks as if a trend is starting. Thus other ants follow, taking $3.01, $3.011, $3.012…, $3.200, $3.250 positions and so on in turn. After hitting $3.305, the price drops to $3.185. This triggers all digital ants to close their positions.

Here, the last 1 to 3 positions taken by the ants are at a loss. However, the remaining positions are closed at a profit. How much profit is based on the number of ants. Say it was 10,000 ants and approximately $35,000 invested. With the profitability being highest toward the beginning and less so as the trend progresses, consider an average of 0.10 per ant. Meaning a total profit of $3500 or 10% return.

Problems and Alternatives

While on paper everything looks perfect, it is not likely that such a strategy will be without issues. This article is my open pondering of a new strategy and has yet to be fully architected.

For one, what is the contract or trade cost for making thousands of tiny trades? Options and Future brokers charge a fee for each contract while some stock, cryptocurrency, and FOREX brokers have small or inconsequential costs to such a strategy. However, they may change their policy after 10,000 or more tiny trades hits the system.

Next, there is the issue of network latency. Making so many trades at one time may eat into the returns or worse, result in the suspension of your trading account. It would definitely be worth a read of the Terms of Service for your broker platform before attempting it.

Digital ants could be used only as a means of testing the beginning and end of a trend while making a second trade of a larger amount to actually profit from it. This appears the most sensible solution as one could test a trend on one platform while taking advantage of it on another.

Conclusion

While I have played with the digital ant strategy for many years, it has never been put into production. The original version used tiny Raspberry Pi computers, with each representing an ant. However, as cloud prices dropped, it become unnecessary to handle hardware and the entire project was forgotten.

The first thoughts on a strategy are often ruled out due to unforeseen problems. Afterwards, they seem to evolve as more effort is put into them. For example, a simple arbitrage strategy sponsored by a client evolved into a machine learning system to pinpoint market inefficiencies. Here, a percent of inefficiency is calculated for all traded currencies every second and used to control the entry and exit points of a trade for near risk free returns.

As the Director of Engineering for a software company that builds financial applications, it is always fun to design new strategy ideas. Many of these ideas are presented to our clients and then turned into projects. Others, like the Ant Strategy, are left to collect dust.

Once a strategy is selected to pursue, it takes a few iterations of testing it to become viable for production. Then it takes some time in production to truly make it profitable. There are always network issues, broker issues, and slight changes to algorithms that need to be made before it’s full potential is seen.

With that said, I would love to hear your feedback or report of your experiments with this strategy. Thank you for reading.