Forex VPS
Automated traders frequently ask my opinion on VPS hosting and trading. Although I’ve written about this in the past, I’ll say it again: if you’re trading any kind of serious money, then you need to run your strategy from a data center. They come with backup everything. The connections are redundant, the power supply is redundant, etc. Plus, they have a full time tech team sitting around waiting for something to break so they can fix it. It’s definitely in your best interest.
I always refer clients to TradersColo for forex VPS hosting. Nash Waddud is a former colleague from my time at FXCM. I know him personally from working together in their Dallas office. He’s an upstanding guy that works very hard to take care of his customers. The prices are also right in line with industry standards.
I rented a VPS from him for testing software last month. The data center was unable to open a port that we needed, making the VPS unusable as a testing environment. Instead of walking away with the $25 hosting fee, Nash offered a full refund. I never asked for it. He just offered it up. That’s the kind of person that I’m happy to refer my customers to.
All of the hosting plans are sufficient for running generic expert advisors. If you’re unsure which plan to use, I recommend calling Nash directly. He can help you pick the appropriate package.
Breakeven Trailing Stop
The trailing stop that we build in most of our custom expert advisors varies somewhat from the generic trailing stops out there. The code uses two inputs. An input is basically a variable that pops up on the screen when you load the expert advisor. You can change the input value without the need for additional programming.
The unique aspect of our trailing stop is that it does not trail until the trade reaches a certain amount of profit. Delaying the adjustment allows the user to treat the stop order as a take profit tool instead of simply exiting at a loss. Most traders feel that once a runner appears, only then does it make sense to adjust the initial rules for exiting at a loss. Acting defensively about the trade only when a decent amount of profit is on the table avoids early stop outs, or at least so the theory goes.
TrailStart is the input which controls when the stop moves from losing to breakeven. It is only at this point of profit that the EA adjusts the exit conditions to avoid a loss.
Say, for example, that the TrailStart is set to activate at 20 pips. That means when your buy trade goes up 20 pips from the entry price, the EA automatically adjusts the stop loss to equal the entry price. The EA cannot lose from that point forward, not counting the effects of slippage.
TrailAmount kicks in only after the stop already adjusted to breakeven. This input controls the distance to increments at which the stop loss should update favorably. If TrailAmount equals 5, it means that the stop loss should adjust in your favor 5 pips for every 5 pips of extra profit beyond the TrailStart at 20 pips.
If the stop loss already moved to breakeven at 20 pips, it means that the stop loss is currently at 0 pips. The trade neither wins nor loses if the market hits the stop. If the price advances another 5 pips (TrailAmount ), the expert advisor determines that it must trail the stop again by 5 pips. The price reaching +25 causes the stop to advance from 0 to +5. When the price moves another 5 pips to +30, the stop advances to +10.
Notice how the stop distance remains a consistent 20 pips in the example. It’s the exact same amount as the TrailStart input.
Market Depth
Moving from small time retail forex accounts to a serious account size comes with some bumps in the road. Most traders see the prices of forex pairs on the screen and assume that they can buy and sell unlimited quantities at any time. Although the forex market is the largest market of any in the world, making it the most liquid, there is still a limited size to what you can trade at any moment.
Reading Forex Market Depth
NinjaTrader and MB Trading both make market depth information available in their trading screens. It shows where all of the nearby liquidity lies. Say, for example, that you wanted to place a big order for EUR/USD. You can see in the screenshot from MB Trading’s platform that the liquidity gets bigger as you get further from the price. They call these “Level 2″ quotes, which is jargon taken from equities traders.

MB Trading's Navigator shows the market depth of the EUR/USD. Light colors show the best prices, darker prices indicate distance from the best price.
I took this screenshot in the late afternoon when liquidity is at its worst. The best bid shows a depth of 200, which is measured in mini lots of 10,000. You could sell up to 2 million EUR/USD and get filled at that price. Notice, however, that most of the liquidity is further away. 3 million sits at the next best price and another 3 million even further from that. The net available liquidity is 8 million on the short side and 6 million on the long side for a total of 14 million.
The FX Pro screen in NinjaTrader makes it even clearer. I took this screenshot several minutes later, which is why liquidity numbers are different. One thing I really like about this screen is that NinjaTrader converts the liquidity depth into more tangible numbers. The formatting makes more sense to me. Plus, it’s much easier to keep track of the varying spread.
What you learned in economics doesn’t apply to trading. Dealing in bulk actually leads to worse pricing instead of improved pricing. The reason is that forex instruments are so standardized that there’s effectively never a lack of customers. It’s really an issue of getting how much much you want at a certain speed.
Only a fool would hit the market with 20M EURUSD instantaneously unless you’re desperate to exit a position. If you push a market order judging solely from the quote on the screen, you may get 2-8 million filled at the displayed price. But, the rest of the order will get filled at progressively worse prices. The traders making a market want their pound of flesh for letting someone into the market so quickly.
Traders cannot see the liquidity depth of most brokers because they elect not to show it. Their platforms encourage the buy this, buy that psychology. The more information that they broadcast, the more bandwidth that’s required, which means that better servers are required.
The EURUSD is the most liquid forex pair in the world. This varies largely by broker, but at any given time you should be able to trade 20-30 million EUR/USD. That doesn’t mean that you’ll get filled at the price on the screen. What that means is that that is the sum quantity available at any given moment.
Some brokers hide their quantity. It’s not like the stock market where if there are 15,000 shares of Microsoft ready to trade at any given moment, you can see 100% of the liquidity available. In forex, as an OTC market, the broker may wish to restrict the viewable book for a few reasons.
If you offer markets from say 5 banks, it’s very rare for the broker to feed the best competitive price and to let the banks fight it out? Why? Because the broker also needs the banks to stick around when nobody wants to trade.
It’s an informal agreement that if I’m retail broker A and UBS is my main liquidity feed, I go out of my way to give UBS the good flow. My customers expect to trade during NFP and other volatile markets (although they really shouldn’t!). If the brokerage simply lets the banks fight it out, then the banks have every reason to let the brokerage rot on the vine when their customers want to trade but it’s bad for the banks. The banks certainly don’t want to take positions in volatile markets. Their only incentive for doing so is if the “good flow” that the forex broker sends during normal markets incentivizes them to accept the risk of losing more than they care to during NFP.
News traders are the most likely to try trading during a thin market. They are also the most likely to complain about not being able to trade. These are the arguments to which I’m least sympathetic. If you’re trading the news, you are overwhelmingly likely to have less than one year of trading experience. The decision has nothing to do with researching systems or evaluating whether or not it’s a good idea. It has everything to do with gambling.
Retail traders are the most likely to trade during volatile events, not just news but really any type of momentum. Almost everyone follows a breakout or momentum strategy. It has everything to do with what traders perceive as the most likely outcome. When the market explodes in one direction, it takes nerves of steel to stand in front of the freight train. Therefore, it’s probably a good idea because it’s counter-intuitive.
Trends happen so slowly that they don’t excite the gambling buzz that most retail forex traders are after. My friend Afshin in Dublin fell victim to this last week. He saw the EUR/USD rising day after day after day. He felt like it was simply overdue for a correction. The urge to participate, rather than coming from a desire for a quick hit, instead came from a desire to be right before there was any clear indication of the opportunity to be right. The point is that what feels natural to do is often precisely the wrong thing to do. It feels natural to every other trader, too.
Market Depth and Direction
One research project that I’d eventually love to do is to study how market depth on any given side of a market affects direction. Some traders run simple liquidity businesses where they receive trading rebates in exchange for accepting the risk of holding a position over the short run. These entities are less likely to concern themselves with picking the direction of the market.
Trading desks that make markets, however, often want the flow so that they can establish a position and earn the spread while doing so. These entities are picking direction – and they are backed by very intelligent math geeks with PhDs and a lot of time on their hands. If those desks make a visibly deep market and it’s sufficiently one sided, then it’s probably safe to assume that they expect to the market to move in the opposite direction.
When you’re buying a forex pair, the bank is selling it to you. So if everyone stacks the liquidity so that you can buy but the liquidity is thin on the short side, it should be telling you that the smart money wants to go short right now.
High Frequency Forex Seminar
One exciting opportunity popped up while I’m in Dublin next week. Best of all, it’s free and open to the public. If you’re in the neighborhood and would like to discuss trading in person, I’d love to meet you.
Trinity College Dublin invited me to present a graduate level seminar to MSc students in Finance and Alternative Investments on Wednesday, February 8, at 6 pm. The seminar will be hosted in the MBA room, which is on the second floor of the business school. The topic will be high frequency market making in forex.
Topics for the high frequency forex trading seminar (about 10 minutes per subject):
- Market making versus price taking
- Comparing frequency to expectation. The more you trade, the more you make
- Liquidity risks and self-feedback loops
- Technical approaches and limitations
Donchian Channel
A Donchian channel measures the highs and lows of the price over a certain period in time. A lot of traders use this concept in their trading, although they are not familiar with the name Donchian.
Most Donchian channel expert advisors attempt to catch breakouts. I almost never see people use it with a ranging approach. Most traders want to ride the excitement of an ever-increasing market. The price, especially with the forex majors, often strikes the previous high or low. The price surges for a minute, only to retrace to well within the previous channel.
The hazard of using Donchian channels as breakout strategies is if you jump too early, you risk making a big fuss over nothing. If you jump too late, then you miss the move. I have not found any method for predicting when these moves will happen. My experience with fractal markets is that the period of a new movement, big or small, is totally random. The condensed trading time and low liquidity make it extremely difficult to try catching a move as it happens, at least on an intraday basis.
I have not done any testing on this, but I suspect that a ranging approach might work better. Most momentum traders are weak hands. They only play when there’s action. As soon as the action disappears or reverses itself, they all tend to leave the party. The dominance of retail traders favors a contrarian approach.
Most traders look at similar points to decide when momentum is truly occurring. They use Donchian channels, although different traders tend to use different periods. The important take-away is that the precise price that they care about tends to vary ever-so-slightly based on the period selected. The Donchian price is more or less the same, regardless of the period.
As an example, you might choose a lookback period of 55. The Donchian channel would consist of the highest high that occurred within the past 55 bars. The high could have occurred on the 55th previous bar or 10 bars ago. Time is ignored. The channel’s low corresponds to the lowest low in 55 bars or periods.
Turtle Traders
The most famous Donchian channel method comes from Richard Dennis and his Turtle traders. Dennis and friend argued over whether good traders were made or born. As wildly successful traders, they had several million dollars at their disposal to settle the bet.
The system used the 55 period high and low to determine the entry. When today’s price strikes the highest daily high in the past 55 trading days plus one tick, the trader enters at market. The system focused on commodity futures.
Most people tend to focus on the methodology that they used to pick the market direction. The original turtles argued that their success came from the unique money management and portfolio selection methodology that they used.
As a winning trade increased in value, the Turtle Trader added a second trade to his floating winner. They used recent volatility and their own risk variable, called N, to determine how far or near the second entry should occur from the original. They would do this up to 4 times, eventually letting their massive winners ride for months.
The system worked extremely well through the 1980s. My understanding is that the performance degraded towards the end of the decade.
If you’d like to read through the entire list of the Turtle rules, I suggest that you read through the Turtle Trader PDF that’s been floating around the web for years.
Forex Money Management
The vast majority of traders obsess over the percent accuracy of their expert advisors. Intuition makes it seem like that the more often a trader wins, the greater the chances or turning a profit. Alas, such an approach ignores a critical variable.
The average win-loss ratio plays an equally vital role in determining the net outcome. I meet a lot of would be scalpers. High frequency trading is incredibly popular, but a lot of traders involved with it only do so because it puts easy points on the board. They don’t pursue a strategy because it has any positive expectation. In other words, they are gambling and not trading.
One of the reasons that I love trading so much, and why I generally dislike gambling, is that you are always in control of the potential payout and the payout ratio. When I play blackjack, I only control the risk and payout. I do not control the ratio of the payout at all. It’s always 1:1.
My decisions in blackjack can only realistically improve the odds to 50%. More than likely, my game play will lower the odds below that threshold. Making decisions repeatedly will overwhelmingly result in human error. It’s our nature.
When I open my forex account, each trade commences a new round in the game. The critical difference between trading and blackjack is that I control the ratio of the payout, plus I still control the risk and quantity of the payout. The net outcome can still move against me due to random chance. The key distinction is that the typical outcome should shift in my favor with an algorithmic trading system.
One of my favorite trading books is Van Tharp’s Trade Your Way To Financial Freedom. We’ll be talking about this one soon; it’s the next item on Jon Rackley’s reading list. One of my favorite aspects of the book is its emphasis on money management strategies and trade expectation.
The term money management connotes many things to many people. The more accurate phrase would be to describe it as a position sizing strategy. When entering a trade, you realistically need to know:
- What is expected loss as a percentage of the account?
- What is the expected gain as a percentage of the account?
- What is the percent accuracy of my trades?
Answering these questions accurately leads to the decision of how many lots, contracts or shares to trade. Controlling the size leads to controlling the outcomes. When you control the outcomes, you ideally earn a profit for your efforts.
Fixed fractional money management
Notice that I said percentage of the account in the bulleted items and not the dollar value of the trade. Thinking in terms of dollars is easier on the mind. The problems is that it ignores the wonderful benefits of exponential growth.
Every financial advisor on earth warns you that compound interest, which is a form of exponential growth, is the strongest force working for you with investments or against you with debts. Applying the same concept to trading, you want to put the power of compound growth on your side.
The fixed fractional formula is an ugly way to telling you to use exponential growth in your trading strategy. Say, for example, that you elect to risk 1% of the trading account based on the distance to the stop loss. If you have a $10,000 trading account, that’s only $100 of risk. Say that the trade works out and that you made $100. The next trade should risk $101.
Try not to roll your eyes at that one. Risking an extra dollar seems trivial and nit picky. I assure you that it is not.
I’m really not sure how to explain how all those little differences add up, but they do. I wrote a money management calculator a few years back that calculated how fixed fractional money management affects returns. The little things really do add up. With a very slight probability of winning and 50:50 odds, the returns were overwhelmingly larger when using a fixed fractional approach instead of a fixed lot approach. You should increase the position size after winners and decrease the position size after losers.
Percent accuracy is half important
If I paid you $1 for every win and you win 99% of the time, should you play my game?
You don’t have enough information to make a decision yet. You need to find out what happens when you lose.
If you lose $100 or more on the trade that only loses 1 time in 100, you should never play my game. You will lose if you play too often. And no, there is no such thing as just playing ten times and stopping. You have the same risk of losing on the first trade as you do on the 100th. It’s not safe to play at all.
The only way that you should decide to play the game is if the total payout is better than even. The total result of wins equals 99 trades * $1/trade = $99. The one loss must be less than $99 to give me the green light on playing.
If I lose $80 one time and make $99 on the remaining trials, then I will have an average win loss ratio of $99/$80 = 1.24. A system like this would be wildly in my favor.
A 60% winning accuracy is a lot more likely to happen in the trading world. Let’s say that I make $100 on every winning trade. My total winning value is 60 trades (out of 100) * $100/trade = $6,000. The maximum average loss that this system could tolerate is:
The maximum average loss that we can tolerate is $6,000 / 40 trades = $150. I should consider trading this system if the average loss comes in at $149 or less. The smaller the average loss, the greater the net outcome.
Kelly formula for Forex Trading
One problem we face with money management strategies is choosing the percentage of the account to risk. The difference between risking 1% or risking 2% of the account equity is simply one of proportion. One of the options either provides a risk-reward profile suitable to the trader or it doesn’t. The larger the appetite for risk and reward, the bigger the number involved.
The Kelly formula removes the proportionality for the question and takes a different approach: how do I make the absolute largest sum of money over time using my trading statistics. The goal is to make the maximum amount of money without getting margin called.
The formula to use is K = W – (1-W)/R where:
K = percentage of capital to be put into a single trade.
W = Historical winning percentage of a trading system.
R = Historical Average Win/Loss ratio.
The approach is most suitable for those trading small accounts, perhaps those with only a few thousand dollars, that they want to grow with maximum aggression. Losing a few dollars is thoroughly unpleasant (been there, done that!), but it’s not financially devastating, either.
It’s important to keep in mind that the Kelly formula attempts to push the trading system to its absolute maximum without busting. Knowing how close it is to the edge of busting, it’s critically important that you understate the good assumptions and overstate the bad ones. Drop the expected percent accuracy by several percentage points to accommodate the chance of error. Lower the win:loss ratio for the same reason.
The easiest way to reduce error and the chance of acting too aggressively is to make sure that you calculated the EA’s percent accuracy and its win loss ratio on a large enough sample size. I would consider 100 trades as the absolute bare minimum. 300-400 is sufficient. 1,000+ trades makes for an adequate sample for most expert advisors and trading robots.
Of course, you can always take the easier approach and simply cut the Kelly formula’s risk suggestion in half. It adds a bit of scientific flair to the strategy, while minding the fact that we are human. Watching an account drop near zero will break the heart of even the most battle tested trader. It’s impossible to stop caring about drawdown, which the Kelly formula totally ignores.





