NexusFi: Find Your Edge


Home Menu

 





How I Backtest


Discussion in Traders Hideout

Updated
      Top Posters
    1. looks_one Quick Summary with 1 posts (0 thanks)
    2. looks_two GaryD with 1 posts (14 thanks)
    3. looks_3 Rrrracer with 1 posts (2 thanks)
    4. looks_4 Big Mike with 1 posts (1 thanks)
      Best Posters
    1. looks_one GaryD with 14 thanks per post
    2. looks_two Bermudan Option with 3 thanks per post
    3. looks_3 Rrrracer with 2 thanks per post
    4. looks_4 gain247 with 1 thanks per post
    1. trending_up 4,605 views
    2. thumb_up 21 thanks given
    3. group 10 followers
    1. forum 5 posts
    2. attach_file 0 attachments




 
Search this Thread

How I Backtest

  #1 (permalink)
 
GaryD's Avatar
 GaryD 
Orlando, Florida
 
Experience: None
Platform: shoes
Trading: happy
Posts: 6,462 since May 2011

Backtesting can be a valuable source of information. It also leads a lot of traders headed down the wrong path. I have read some posts lately regarding automation and backtesting and decided to share some of the process of how I approach it. This will not be a "how to trade" example, or show an exact trade system, but just offer a view into another trader's head of how to use backtesting.

I am a purely discretionary trader. I do not use any sort of automation. I do not have buy/sell signals that I believe should be taken every time they trigger. The way I approach backtesting is it allows me to know more about market movement. I digest the information, take indicators that keep me aware of the information I have learned, and then combine that with other information and experience to decide when to take a trade.

Now that I have lost the interest of possibly the majority of readers...

I trade mostly crude oil, and I like to watch 6 and 9 range charts in addition to time based. I find that when I use range charts, certain patterns re-appear that moving averages can help identify. I like T3 moving averages on range charts because, in addition to having backtested well, they respond very well visually.

When I backtest, my initial run is based on Maximum Net Profit, and I am looking for 50-60 results to go through. I use very wide range settings, like 30 though 300 at intervals of 30, to just try to locate a "sweet spot" in each of the moving averages. I use "Genetic" testing on initial passes to keep the backtest time limited in the initial broad passes. After I have found some tighter criteria, I then limit the range of optimizing and switch to standard backtesting.

As the testing continues, I shift the backtest priority to issues other than maximum profitability. Some personal favorites are Maximum Profit Factor and Minimum Drawdown, but there are several things to consider depending on what the initial runs showed.


[IMG]https://nexusfi.com/v/w8kjgn.jpg[/IMG]

The image above shows a test of 7 different T3 moving averages. Some of them work together to provide a trade entry, two work together to show an optimized reversal point, two work to create an alternate trade exit (the exit can also be a setup in the reverse direction or a stop loss). The settings shown above are what I determined were the most beneficial to me after running through the entire backtest process. Again, this started with a very broad sweep.


Below is what this set of averages looks like on a 6-range chart, labeled to show how they work together. I have shown two possible trade triggers, one short and one long, noted by red/green arrows

[IMG]https://nexusfi.com/v/agghn4.jpg[/IMG]




The way I ultimately decided on those exact settings;


1) I took the information from my initial passes, distilled it down to much tighter ranges per moving average, and exported to MS Excel. I use excel to sort by Win Loss Ratio and Profit Factor and Max Drawdown until I find what I am looking for. The Excel image as I was finishing my work there is shown below.

[IMG]https://nexusfi.com/v/s79gbe.jpg[/IMG]


2) I went back into Ninja Trader and ran the standard backtesting on the selections I had focused on in Excel, and looked at the following 3 priorities;


PERFORMANCE REPORT
[IMG]https://nexusfi.com/v/4k6qn5.jpg[/IMG]


EQUITY CURVE
[IMG]https://nexusfi.com/v/vwuk5h.jpg[/IMG]


MONTHLY PERFORMANCE
[IMG]https://nexusfi.com/v/xqs5sa.jpg[/IMG]



All looked good to me, based on what I was wanting to know. You may have already noticed that the Percentage Profitable is not what you might agree with for acceptable criteria. I look for profit that is at a minimum 2x loss. I pay attention to Win Percentage, but do not necessarily prioritize it. I want to know what a 2x win or better looks like. I'll explain further down.


3) I then drill down to see if there is anything else to be learned from the backtest. What I saw was, when viewing the Day of Week, it shows Wednesdays showed the worst performance. That seemed logical to me immediately, EIA Report is often a trend changer for crude oil (typically 10:30am EST on Wednesdays).

[IMG]https://nexusfi.com/v/5j4f3h.jpg[/IMG]


I also wanted to see if market open, news reports, after hours, 2:30pm EST close, 5:15pm EST close had any affect on performance.

[IMG]https://nexusfi.com/v/p4je5d.jpg[/IMG]



Now, back to the 6-range chart. Should I have taken both the long and the short trades? Should I have chosen one over the other? Having put all of the effort into backtesting, optimizing, color-coding, should I have felt confident about taking those trades based on reward to risk?

[IMG]https://nexusfi.com/v/absn8n.jpg[/IMG]


The answer is, I took neither.


That is where the discretionary part takes over. I wound up taking a long trade but passing on the earlier two.

1) Crude had taken a massive nosedive the day before, the overall mood was down. There is a lot of potential profit built up in the market on the short side.

2) The chart shown is on a Friday. Futiures stay open 23 hours a day, EXCEPT at the Friday close, they don't re-open until 6pm Sunday night EST. Nearly all traders have some version of fear.

3) To the left and right of the green arrow on the 6-range, we have a minor inverted head and shoulders pattern, suggesting support had taken hold for the day, and shorts might get trapped.


I did eventually enter a long trade, towards the end of the day when I felt crude had told me all it was going to say. The entry location is shown in the chart below. Note that based on the moving averages, the entry still met all of the criteria. However, that entry location seemed like the less obvious point than the ones in the 6-range chart shown previously.

[IMG]https://nexusfi.com/v/hszzfq.jpg[/IMG]




Getting back to the Percentage Profitable of only 33%. That percentage is only if I traded that setup in a vacuum, without any additional information. If you want to increase your real world odds, you have to take the blinders off. No matter what the computer says, be aware. There was far more to the story.

It's Friday, with shorts most likely stuck at the end of the live pit, selling volume had dried up, pit close approaching, support looking ominous to short traders who were still hoping for more, potential double bottom with a prior support area, the prior high on a minor scale (6 range) after the H&S just was broken to the upside...

What were my percentage odds then? I couldn't tell you. But I knew, that was a darn good trade.


I took that trade live on nexusfi.com (formerly BMT) and posted my thoughts about it as it unfolded. Here is a link the approximately start of that trade as it occured.




If you follow that link you may think, "Now wait, where are all the moving averages? That chart looks nothing like the one that was backtested! This guy is full of it!" Well, I don't use the exact T3s from the backtest, but I use T3s that are close. Truthfully, I adjusted them visually based on typical movemtn rather than optimum conditions.

And yes, I did cherry pick that example, as that trade could have just as easliy failed. Trading comes with no guarantees.

But, anyway, that's how I backtest.


The example backtest that was run on moving averages was only a single piece to the puzzle. I use that in combination with analysis of several other timeframes, like what is shown below.


[IMG]https://nexusfi.com/v/chsxjs.jpg[/IMG]


On a 60 minute timeframe, we had a potential major (relative to 60 minute charts) double bottom. That was surely catching some attention at the end of day on Friday as well. If you are trying to trade range charts, tick charts, volume charts, that is a very good thing to do. It gives you a microscopic view, which helps minimize risk and spot opportunity faster. But what really improves your odds is only taking the microscopic signal when the macro view aligns with it.

What I believe; use backtesting to learn your market, use what you learn to complement something else you have learned. Backtest hundreds of things until it all starts to come together in a single understanding.

Optimize yourself and your understanding of the market you choose to trade.


Good Trading and STAY SAFE!!

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
NexusFi Journal Challenge - April 2024
Feedback and Announcements
Request for MACD with option to use different MAs for fa …
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Retail Trading As An Industry
62 thanks
NexusFi site changelog and issues/problem reporting
47 thanks
Battlestations: Show us your trading desks!
35 thanks
GFIs1 1 DAX trade per day journal
32 thanks
What percentage per day is possible? [Poll]
31 thanks

  #3 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,321 since Jun 2009
Thanks Given: 33,142
Thanks Received: 101,476


Just now had some time to read your post.

Thanks for sharing!

In fact, it is a similar idea to what I've been doing for a while myself and finally recently created a thread to try and document it and involve some members (many who posses math skills I lack) to try and help us all.



My thread is about taking concepts some of us think improve our trading (common risk and trade management ideas, some simple examples including moving stop to breakeven, or setting a risk/reward ratio, avoiding volatility, setting maximum risk limits, etc) and then backtesting those over large periods using a random signal generator so the focus is purely on the risk/trade management, and zero emphasis placed on the entry signal.

I hope you will continue posting in the thread, looking forward to more.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
The following user says Thank You to Big Mike for this post:
  #4 (permalink)
 
gain247's Avatar
 gain247 
Helsinki, Finland
 
Experience: Advanced
Platform: NT8
Broker: NTB
Trading: ES, CL
Posts: 131 since Apr 2010
Thanks Given: 125
Thanks Received: 123

Thanks again, Gary - that was an excellent, excellent post! I also thank you for continuosly sharing your vast experience and methods using 'regular' threads which can be read by anybody here at futures.io (formerly BMT), not only 'elite' members. I find some golden gems everyday from your posts eventhough my approach to market and CL trading method is quite different but I find myself gradually learning about a new dimension as how to better read the markets and take the opportunities with bigger trends.

-Tim

Reply With Quote
The following user says Thank You to gain247 for this post:
  #5 (permalink)
 
Bermudan Option's Avatar
 Bermudan Option 
Chicago, Illinois
1% better Daily
 
Experience: Beginner
Platform: TradingView
Broker: ThinkOrSwim
Trading: Forex, Stock & Options
Posts: 673 since May 2011
Thanks Given: 838
Thanks Received: 471

Late to the party but such a great breakdown on how to backtest. Saving this for later

Visit my NexusFi Trade Journal Reply With Quote
The following 3 users say Thank You to Bermudan Option for this post:
  #6 (permalink)
 
Rrrracer's Avatar
 Rrrracer 
On the road
Webinar Host
Trading Nomad
 
Experience: Intermediate
Platform: TradingView
Broker: Oanda
Trading: FX
Posts: 2,512 since Feb 2017
Thanks Given: 17,582
Thanks Received: 9,751

Thanks for dredging up this old post, @Bermudan Option, great info.

@GaryD has a couple of excellent threads here, missed this one somehow. Hope he's doing OK.

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
The following 2 users say Thank You to Rrrracer for this post:





Last Updated on December 3, 2020


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts