Algorithmic and Mechanical Forex Strategies | OneStepRemoved

  • Articles
  • Sophisticated Web Sites
  • Automated Trading
  • Testimonials
  • Contact

Live demo testing a new strategy with limit orders

November 24, 2015 by Shaun Overton 17 Comments

I come up with amazing looking backtests all the time. This is the latest example using the SB score.

backtested equity curve

The equity curve of the new strategy without trading costs.

The free and hypothetical version of the strategy yielded $79,618.82 for an uncompounded return of 796.19% over a period of 3 years. The strategy trades all major FX crosses. As you can tell, the signal quality remains nearly constant across multiple market conditions. It looks great.

The problem is trading costs. It’s always trading costs that make life difficult.

Trading costs drop the profits by 98.22%

Trading costs drop the profits by 98.22%

I always take a heavily pessimistic view when it comes to assuming trading costs and slippage. It requires a lot of intellectual honesty, but making an effort to avoid rosy assumptions saves a lot of pain and disappointment down the road. The assumptions are really severe on cross currencies where we assume spreads and slippage north of 5 pips.

Performance with pessimistic trading cost assumptions drops to only making $1,000 in profit. The strategy doesn’t need to go in the rubbish bin, but it’s far from ready for prime time. There’s no scenario where it makes sense to trade with market orders.

General characteristics

Average trades per day: 39
Currency pairs traded: 27
Percent accuracy: 66.52%
Style: Mean reversion
Charts: Hourly

How to trade on the cheap

I’m notoriously frugal. One of my fraternity brothers in college still tells stories about me counting loose change and tracking it in MS Money.

That kind of mentality drives my wife crazy… but it’s a real asset for a trader! Traders make their money on the margins like every other business person.

I spent yesterday afternoon coding this new strategy with a slight twist. Instead of paying the spread on every single trade, what if I use limit orders to try and earn the spread?

The current raw spread on EURUSD is 0.3 pips, which is worth $0.03 per microlot. The trading commissions are $0.03 per microlot. If I earn an extra $0.03 per microlot, that at least covers the trading costs. On pairs like NZDCHF where the raw spread is 1 pip, that adds an extra $0.04 ($0.10 – $0.03) per side. I.e., the entry signal makes an extra $0.04 and the exit also makes an extra $0.04 on every single trade.

Even quiet pairs on NZDCHF still exhibit a degree of noise on every bar. I haven’t done any research to back it up, but my subjective experience says that the wicks of 90% or more of bars will be at least as long as the spread is wide.

Traders make their money on the margins like every other business person.

Said another way, if the spread on EURUSD is 0.3 pips, then the difference between the open and low price on 90% of bars should be at least 0.3 pips, too. That’s my assumption, anyway.

An example of twisting the strategy to use limit orders

Say that my signal to enter the market just popped up. The current price for EURUSD is 1.06457 x 1.06462, which is 0.5 pips. The backtests assume that I’ll hit the 1.06462 asking price and pay the spread.

The idea for my test is to set my limit order at 1.06457. Since I’m a retail trader, that means I’m asking the market to move down half a pip before I’ll get to have a position. Requiring a small move in my favor theoretically earns more than jumping into the market with both feet.

Live demo testing begins

I could theoretically model the idea in a backtest, but there are critical assumptions that make it pointless.

1) The average spreads available in my 2009-2011 backtest period were far wider than they are today
2) The spread varies significantly throughout the day. EURUSD is routinely as low as 0.2 pips in the European sesssion, but can easily hit over 1.0 pips in the dullest portions of Asian trading.

The second item could be completely detrimental in a backtest. It’s better to test the idea on a live demo and get something closer to real trading data.

Demo testing

The first 15 hours of live demo testing.

I’m only 15 hours into the test, but at least everything is off to a good start.

The goal for the test is simple: place at least 300 trades in the account. That should only take about 2 weeks since the strategy is so hyperactive.

The criterion for success is equally simple: does the real-time demo trading performance meet or exceed the backtesting performance over the same time period?

I started trading in the evening of November 23, which means that I should hit my 300 trade threshold around the 10th day of trading. The trading frequency does fluctuate, but that should occur sometime around December 4th.

Even though I have live demo data, I’m going to run a market entry backtest from November 23 to December 4. If the demo trading, which uses limit orders, exceeds the market entry backtest, then I have a reasonable basis for assuming that the strategy is ready to trade on a small live account.

comparison scale

I’m also ironing out bugs that appear during the live simulation. More than likely, these dates will be pushed back. I already found 2 issues that require investigation after only 22 trades. There’s no point in judging a strategy if it’s not performing exactly as specified.

Code the same strategy twice?

You probably noticed that the forward test equity curve is from MetaTrader. Why would I test in one platform but execute in another? All of my backtests were done in Seer.

If you have two people work on a problem and they both arrive at the same answer, then they probably answered the problem correctly. The same logic applies to programming. If I program a version of the strategy and Jingwei programs a version of the strategy, they’re supposed to place the exact same trades. Any discrepancies mean that someone’s programming is wrong.

I routinely use this method because the slightest errors in logic can lead to dramatically different trading outcomes. It’s the difference between making a lot of money and losing a lot of money. Yes, I’m sacrificing efficiency. The stakes for a strategy are so high that it’s better to make 2 people do the same work in exchange for the confidence of knowing that it was done properly.

MetaTrader is inferior to Seer by every measure. The only reason that I wrote my code in MetaTrader was that I’m anxious to test the idea. MQL4 is easy for me to code – programming for MetaTrader is one of our main services.

After Jingwei finishes programming the Seer version next week (she’s off for Thanksgiving), I’ll have the basis for comparing my MT4 version against hers. It’s terribly inefficient, but I also know how likely I am to waste weeks on analyzing trades placed according to rules that don’t exactly match my strategy. Better safe than sorry!!!

How to fatten the margins

One thing I hate about retail trading is that very few venues offer a true ECN. Trading on a traditional retail forex broker means that I have to wait for the spread come down to touch my order. In the example I gave using EURUSD, it requires that the market move 0.5 pips in my favor before I get a fill.

Trading on an ECN would significantly increase the probability of receiving a fill on the limit order. Using the EURUSD example where the current prices are 1.06457 x 1.06462, I would place a buy limit order on the bid at 1.06457. If anyone in the market sells at that time, it means that at least a portion of the order would be filled almost immediately.

In effect, trading on the retail spreads contains the worst case scenario for execution. The price has to adjust 0.5 pips in your favor in order to get filled. If you trade on an ECN and the price fell 0.5 pips, you would get filled every single time. But you also get the chance to get filled earlier and faster because if anyone comes in and goes short at market, the order sits on the book waiting for someone to hit it.

fat margin

Smart traders do everything in their power to fatten up the margins

I’m proceeding with the demo test now. If it meets or exceeds the backtest results, I’ll then know with the highest degree of confidence possible that the method is ready for live trading. I’ll probably start with a few thousand dollars for the first month. Then, if it succeeds, I’ll really start to scale it.

There’s no reason that all trades must occur on H1 charts. I can always shift the trading intervals by one minute, two minutes… fifty-nine minutes. And even there, it’s possible

My ideal scenario is to trade the strategy on an ECN venue, which requires a minimum balance of $250,000. That amount of money is far higher than I’m comfortable risking. The old rule of trading is that you never risk more than you’re comfortable losing.

That means I’ll likely be looking for a partner to make sure the strategy runs in the best environment possible (an ECN). Are you possibly that partner? If so, send an email to info@onestepremoved.com and introduce yourself. Nothing will happen for several months, but it always takes awhile to build relationships and feel comfortable with a project.

Filed Under: Dominari, Test your concepts historically, Trading strategy ideas Tagged With: backtest, limit, spread

Comments

  1. James says

    November 25, 2015 at 21:31

    Hey Shaun, interesting article as usual. I have some concerns over demo live trading compared to actual live trading. With demo trading I was of the understanding that it does not really reflect live trading as the broker’s demo platforms are just purely number based. By that, I mean you put an order in, whether that be a limit buy order or a stop loss, then that order will always be filled at that price no matter what. Whereas with actual live trading there are things like slippage, re-quotes, spread variations, and dare I say it, broker manipulations. Therefore in actual live trading, the fills are going to be way different compared to demo live trading. I may be wrong on this as I rarely demo trade when testing our new strategies as I tend to just go very small on an actual live account. This could be my problem 🙂 Anyways I’m looking forward to hearing about your future results, so please be kind enough to keep us informed. Thanks. Jim

    Reply
    • Shaun Overton says

      November 30, 2015 at 10:56

      Hey James,

      What you said is true of stops and market orders. It’s also potentially true of limit orders if you’re trading in size. But… because of
      1) I’ll be trading rinky-dink size to start and
      2) The limit orders require the opposite price to touch them (i.e., my limit long buys the ask and limit short sells the bid)

      then the demo ought to be a reasonable approximation of live performance. I’m also not hyper dependent on fills like a news trader or someone in a fast market. My trading is boring, which is the way I like it. Slow and steady wins the race.

      –Shaun

      Reply
  2. Derek Phelps says

    November 25, 2015 at 23:01

    Hello Shaun:
    Great article. I’m deeply interested in any results comparisons you may share using your limit entry method with live demo vs. live real over the same period (that is..simultaneously running the same strategy/same pairs with a demo and a real account). This is something I have always wanted to test but most of my strategy development invariably uses market entries.
    You mention the advantage of testing the strategy in two platforms (seer/metatrader). Would you be interested in a confidential development/real account test using microlots with a third platform, NinjaTrader? (similar to the workup i did on Bollinger%B strategy).
    Derek

    Reply
    • Shaun Overton says

      November 30, 2015 at 10:57

      You can count on an update. Ninja would be overkill for me at this point. 2 platforms is already a lot to track. I do appreciate the offer!

      Reply
  3. Evan says

    November 26, 2015 at 02:34

    Hi Shaun,

    Nice article about your methodical approach to testing. I’m in a similar situation whereby I’m looking at optimising my strategies and really want to know which ones in all market conditions perform the best. Using MT4 I believe doesn’t provide the best form of testing as the tick data used in testing will largely sway the results when analysing? Having spoken to a few robot traders I’ve been heavily advised to use trade station as a much better alternative to MT4 back testing. What are you thoughts on this?

    Cheers Evan

    Reply
    • Shaun Overton says

      November 30, 2015 at 10:58

      Never would I ever test anything in MT4 that requires tick data for the simulation. It’s just not dependable. This article is about running a real live market simulation, which obviates the need for using the backtester.

      Reply
  4. Thomas says

    November 26, 2015 at 14:37

    Shaun,

    Really interesting theory. I’m looking forward to your updates and results in this.
    /Thomas

    Reply
    • Shaun Overton says

      November 30, 2015 at 10:58

      You can count on them!

      Reply
  5. Dom says

    December 6, 2015 at 22:27

    Why don’t you just trade on higer time frames, surly the higher you go the less the spread matters !?
    I know you’d get less trades and thus not play out your edge as fast but slow and steady wins the race in trading ;o)

    Reply
    • Shaun Overton says

      December 11, 2015 at 13:24

      Great question. When I jump from H1 to the H4, I expected my average trade profit to jump 4x. Instead, it plummeted by 75%! The equity curve looks good, but the mean reversion effect of my philosophy dies off by the time it’s on the higher TF.

      Reply
  6. Scott says

    December 10, 2015 at 01:14

    Hi Shaun, I would like to get some information about having a strategy programmed for SEER.

    Reply
    • Shaun Overton says

      December 11, 2015 at 13:27

      Hey Scott,

      I’ll email you directly.

      –Shaun

      Reply
  7. lucky says

    December 20, 2015 at 02:35

    hey shaun , if u are a programmer u can skype me (swingdroid), we work some strategy together on mean reversion

    Reply
    • Shaun Overton says

      December 22, 2015 at 11:31

      Hi Lucky,

      I sent you a message.

      Reply
  8. Peter says

    March 2, 2016 at 11:41

    Why are you selling a signal like this, if it can make you a millionaire without anybody knows?

    Reply
    • Shaun Overton says

      March 2, 2016 at 12:05

      Hi Peter,

      It’s not going to make me a millionaire on my $10,000ish account balance. You can view my live trading results on Myfxbook. I’m doing well, but even a 100% return on $10,000 wouldn’t really affect my overall financial standing. I’d realistically need several million dollars in my portfolio before what you suggested would apply to my personal situation.

      –Shaun

      Reply
  9. Alexey says

    December 7, 2016 at 01:54

    very good article, do u have lessons for learning mt4, or all the stuff published on mt4 site?

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

FREE trading strategies by email

Trending

Sorry. No data so far.

Archives

  • Dominari
  • How does the forex market work?
  • Indicators
  • MetaTrader Tips
  • MQL (for nerds)
  • NinjaTrader Tips
  • Pilum
  • QB Pro
  • Stop losing money
  • Test your concepts historically
  • Trading strategy ideas
  • Uncategorized
  • What's happening in the current markets?

Translation


Free Trading Strategies

Privacy PolicyRisk Disclosure

Copyright © 2023 OneStepRemoved.com, Inc. All Rights Reserved.