Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

  • Welcome Guests

    Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

Br88dy

Forex Backtesting

Recommended Posts

I'm trying to take the initial steps in creating a rough draft of a trading strategy and I decided to start looking for patterns. However, I have no idea how to backtest a theory. For example: many people believe the highest range of trading happens within the first couple hours that the market is open, or for the FX, the first couple hours of the London/NYC market hours overlay.

 

I have no idea how to begin testing and searching for patterns. I thought that MT5 might have had a feature that allows you to enter an equation and spits out results, but even then I wouldn't know how to write the equation to get results. If anyone knows anything about backtesting theories, I would be extremely grateful for any amount of help! Thank you!

Share this post


Link to post
Share on other sites

Learning how to program fluently enough to perform accurate backtests, and also learning about all the pitfalls of backtesting (there are very many indeed), will require quite a bit of time and effort.

 

The good news is that it will probably be the most profitable and worthwhile thing you'll ever do in your development as a trader, and it can also be great fun (as well as tremendously frustrating!).

 

Good luck!

Share this post


Link to post
Share on other sites

Learning how to program is less time consuming than doing things manually.

Think that you are testing a strategy on 10 years data, every tiny modification of your strategy will make you spend more time on it...

Share this post


Link to post
Share on other sites
Think that you are testing a strategy on 10 years data, every tiny modification of your strategy will make you spend more time on it...

 

Could you elaborate Obsidian? I didn't really understand this part of your reply

Share this post


Link to post
Share on other sites

for example you are testing a candlestick strategy, you are going to buy when a bullish candle appears and sell when a bearish candle appears. you can do it spending a day on it. but when you want to see the results on different time frame or on a different pair (or if you change buy-sell conditions, sl/tp levels), you will have to start over.

Share this post


Link to post
Share on other sites

My advice is to not waste your time back testing at all. The article referenced above on dailyfx, while a good guide, shows the main problem with back testing -- "Where would you place your stop?" "Where would you look to take profits?" Even the primary point of 'stop when you find a trade that meets your criteria.' Do you think you will actually do what you do in a back testing environment?

 

Back testing ignores context, news reports, unscheduled news releases, the bigger picture, the mood of the market that day or week or month, and other things, but perhaps most of all market momentum.

 

If you think you can see all of these things by looking at static charts you are deluding yourself. Either that, or you have been trading for long enough that you recognize certain things and thus dint need to worry about back testing at all.

 

Back testing is simply another attempt to shortcut one's way to profitability. Sure, we all want to cut our learning time to some degree, but by removing time from the trading equation, back testing removes the part that's actually the hardest -- sitting there in a trade, or waiting for a trade.

 

There is benefit in looking at past charts and drawing conclusions, but this bar by bar or mechanical back testing simply is not representative of what trading is like.

 

This will.go against much of what is said on this subject and as always, it's simply my view and you may find your experience different. I suppose much of what we spend our time on in trading g turns out to be fruitless, but it's in the doing and rejecting that we find the gems.

Share this post


Link to post
Share on other sites

Josh.. interesting views

 

As both a discretionary trader with a high degree of ability and someone who has built profitable trading systems AND traded them: I feel I'm well informed on both sides of the coin.

 

I've always felt that the really great trader needs to understand more then what can be gained from "backtesting". However, having said, it is certainly possible to create profitable trading systems.. I view a trading system as another profit center. It is a great feeling to know I can "hand off" the trading to my systems when they signal and after I'm too tired to trade.It is no wonder then that most professional trading firms do use simulations and systems.

 

Now to the second aspect.. it sounds like you are trying to find how to build worthwhile trading systems. This is not a trivial task. Building trading systems is a craft that blends objective tests, ideas with subjective decision making.

 

It takes a huge amount of work to build a worthwhile system and there really are no short cuts to it. You should be able to find a good deal of information on building trading systems if you do a search on Amazon or go to your local library.

 

As Josh relates, the most difficult aspect is to know how the system will perform in the future.. There are a number of ways that have been developed that can aide in this but there is really no sure way to know.

 

Search for backtesting, building trading systems, etc.. that should give you a start.

 

Curtis

The Market Predictor

Share this post


Link to post
Share on other sites

The results we get by backtesting are different than live trading because of gaps, slippage etc. But it still gives a general idea about how your system performs. You can see its advantages, disadvantages.

Yes, backtesting ignores data releases and market momentum due to lack of our programming skills. Of course there are some events that is impossible to predict, S&P-Moody's downgrades for example. However, backtesting may give you a clue about how your system (you) will perform when unexpected things happen.

Share this post


Link to post
Share on other sites

As I said, MOST professionals.. that is the guys managing the most money/making a living, I do believe are using programming, automated, and partially automated strategies. However, I also know that it is possible to get to a high level of competence using discretion. I think both methodologies offer something.

 

As Dr. Steenbarger wrote to the effect, it is possible to trade in a way such that one weighs historically what the market has tended to do with what the market is doing in real time, in order to capitalize on that or push it. There are really a lot of combinations when using the mixed approach.. see my blog entry on systematic methods.

 

But really I can't help you with your question. Its too general. Its like if I were to ask "how do you make a game?" There really is no simple answer as the number of methods are multitude.

 

The key thing I think that helped me is to understand that trading building trading systems is NOT a science but a craft that blends both objective and scientific measures with subjective and intuitive ideas. This is the first thing you have to understand and the most critical because once you understand that then you'll understand there is no one "right way" to build a system. As with building any model, we simplify "reality" in order to build a model that we can understand.. obviously the model is not the reality but that doesn't take away the benefit that can come from having a model.

 

Thanks,

Curtis

The Market Predictor

Share this post


Link to post
Share on other sites
The key thing I think that helped me is to understand that trading building trading systems is NOT a science but a craft that blends both objective and scientific measures with subjective and intuitive ideas. This is the first thing you have to understand and the most critical because once you understand that then you'll understand there is no one "right way" to build a system.The Market Predictor

 

I do understand that concept, completely. I'm not trying to build a system that is fail proof and one that I can "set and forget." I find joy in watching charts and have found I have a knack for predicting market sentiment, mainly on the small time frames.

 

But more importantly, I think, is that I'm aware that there are scientific patterns that the markets have followed ever since the beginning of time. Strategies don't account for the general mood of society during that day, week, month, or year, but there are patterns out there one should be aware of. Like what days of the week the markets are most liquid, what hours of each day I should avoid trading, etc. Those are the things I'm looking for.

 

I was just wondering if there was a more efficient way of getting numbers like that, rather than manually looking at everything day by day. For example: I found a great article on developing a trading strategy on the Trade 2 Win forums, but the guy never explained how he got his numbers. I wanna know how he got these numbers is all.

 

This link below is the great article I read:

Developing a Trading Strategy

Share this post


Link to post
Share on other sites

There are many sorts of edges (or repeatable patterns) that traders attempt to take advantage of including: technical, fundamental, seasonal, and various relational ideas. I'm sorry but there is no easy way to develop these sorts of ideas. You're first step is to get some professional backtesting software such as Tradestation and start programming out your ideas. I recommend Tradestation for the beginner because of the integrated data. But, there are many other competent applications out there. You might want to take some statistics courses.

 

Typically building trading systems involves programming buy/sell rules and then evaluating their performance. You should ask the author if you have a specific question.

 

Curtis

The Market Predictor

 

PS: As I said, building trading systems is not a science. This is the first thing you have to get around.

 

I do understand that concept, completely. I'm not trying to build a system that is fail proof and one that I can "set and forget." I find joy in watching charts and have found I have a knack for predicting market sentiment, mainly on the small time frames.

 

But more importantly, I think, is that I'm aware that there are scientific patterns that the markets have followed ever since the beginning of time. Strategies don't account for the general mood of society during that day, week, month, or year, but there are patterns out there one should be aware of. Like what days of the week the markets are most liquid, what hours of each day I should avoid trading, etc. Those are the things I'm looking for.

 

I was just wondering if there was a more efficient way of getting numbers like that, rather than manually looking at everything day by day. For example: I found a great article on developing a trading strategy on the Trade 2 Win forums, but the guy never explained how he got his numbers. I wanna know how he got these numbers is all.

 

This link below is the great article I read:

Developing a Trading Strategy

Share this post


Link to post
Share on other sites
I do understand that concept, completely. I'm not trying to build a system that is fail proof and one that I can "set and forget." I find joy in watching charts and have found I have a knack for predicting market sentiment, mainly on the small time frames.

 

But more importantly, I think, is that I'm aware that there are scientific patterns that the markets have followed ever since the beginning of time. Strategies don't account for the general mood of society during that day, week, month, or year, but there are patterns out there one should be aware of. Like what days of the week the markets are most liquid, what hours of each day I should avoid trading, etc. Those are the things I'm looking for.

 

I was just wondering if there was a more efficient way of getting numbers like that, rather than manually looking at everything day by day. For example: I found a great article on developing a trading strategy on the Trade 2 Win forums, but the guy never explained how he got his numbers. I wanna know how he got these numbers is all.

 

This link below is the great article I read:

Developing a Trading Strategy

 

if you have sufficient data and put it on excel, I think you can check those type of statistics

Share this post


Link to post
Share on other sites
I do understand that concept, completely. I'm not trying to build a system that is fail proof and one that I can "set and forget." I find joy in watching charts and have found I have a knack for predicting market sentiment, mainly on the small time frames.

 

The article you referenced is precisely a "set and forget" type of approach. You are not supposed to add discretion with this type of approach. No need to watch charts with this. You could always do a hybrid method of a mechanical signal as a guide, and then your discretion to actually trade.

 

But more importantly, I think, is that I'm aware that there are scientific patterns that the markets have followed ever since the beginning of time. Strategies don't account for the general mood of society during that day, week, month, or year, but there are patterns out there one should be aware of. Like what days of the week the markets are most liquid, what hours of each day I should avoid trading, etc. Those are the things I'm looking for.

 

There are NOT scientific patterns that the markets have followed since the "beginning of time." The market does not offer a scientifically-based approach that performs consistently (such would be relatively risk-free, a no-no for the market) for all eternity. The article you reference develops a system that back tests well for a year and a half, but fast forward 8 years from when it was written and I'll bet it has consistently lost money recently. I suppose you could stop at a max drawdown and have made some good money though. But it is not forever.

 

I was just wondering if there was a more efficient way of getting numbers like that, rather than manually looking at everything day by day. For example: I found a great article on developing a trading strategy on the Trade 2 Win forums, but the guy never explained how he got his numbers. I wanna know how he got these numbers is all.

 

The article was very solid by the way. Quite rare to find a methodical approach like that in an article on back testing.

 

From your first post on this thread it seems you are using metatrader. It does not, to my knowledge, offer any real tools for back testing. MT is sort of the "Yugo" of trading software. It's cheap, and you have charts, but other than that, it's very barebones and not particularly known as a platform that a serious trader will use. Tradestation, Ninjatrader, Investor R/T, and many others will have a pretty robust set of tools for backtesting. Ninjatrader is free to use without live trades, but you will have to get data. You will find a few data providers out there who provide a trial. This may be a good start for you.

Edited by joshdance

Share this post


Link to post
Share on other sites
There are NOT scientific patterns that the markets have followed since the "beginning of time." The market does not offer a scientifically-based approach that performs consistently (such would be relatively risk-free, a no-no for the market) for all eternity.

 

There are patterns. Elliot says so. :)

 

But yes, you're exactly right, I want to create a hybrid pattern of the "set it and forget it" strategy. I want to use my own discretion on most trades, but I'd like to use the technical approach to find setups easier. Just need to figure out the best/most efficient way of getting numbers like that guy did in his article.

Share this post


Link to post
Share on other sites
There are patterns. Elliot says so. :)

 

But yes, you're exactly right, I want to create a hybrid pattern of the "set it and forget it" strategy. I want to use my own discretion on most trades, but I'd like to use the technical approach to find setups easier. Just need to figure out the best/most efficient way of getting numbers like that guy did in his article.

 

I think it starts with a premise, an idea. From there, see if the idea holds water. Probably the best free solution for you is ninjatrader, though I have not used it for back testing.

 

Elliott wave is not science; it is a way of viewing market movement, and is as subjective as the next thing. It is not objective, thus many people can identify different waves (and so many of them seem to do so well in hindsight, imagine that). Thus, no science there. I think you are being a little tongue in cheek so I'll leave it at that. What the guy did in his guide to back testing was more of a scientific approach, and his method is without subjectivity; the trade triggers, or it doesn't; no gray area. THAT is science. And because it is, the market does not allow it to be profitable long term. Of course there are patterns, but they cannot be objectively, programmatically, profited from forever. Maybe even for a few years, but the market will not allow risk-free profit (meaning that a system will always make profit). I would suspect that even for colo, super fast HFT type systems, who have a clear advantage of speed, that there are new systems developed which take advantage of the already super fast stuff and slowly but surely remove the edge there too.

Share this post


Link to post
Share on other sites

I wasn't meaning to sound lippy, I apologize for that. But as far as I understand from what you're saying, it's best not to have a strategy at all? Unless your strategy is strictly risk management? In other words, in your opinion what is the best way to trade a major trading pair like the EUR/USD?

 

I'm trying to come up with a strategy that fades breakouts on a 15min chart, probably with the EUR/USD. I wanna do what the profitable traders are doing, or the opposite of what every once else is doing. From what I understand, 95% of retail traders are losing money. So I want to watch the markets and for the most part, trade against the masses when false breakouts happen. I want to use a great deal of market sentiment in my strategy, but don't want to be naive and not use fundamental or technical analysis. And of course risk/money management and candlestick patterns are shoved in there somewhere.

 

Any thoughts on my approach? I really appreciate the feedback so far, so thank you to everyone.

Share this post


Link to post
Share on other sites
I wasn't meaning to sound lippy, I apologize for that. But as far as I understand from what you're saying, it's best not to have a strategy at all? Unless your strategy is strictly risk management? In other words, in your opinion what is the best way to trade a major trading pair like the EUR/USD?

 

In a nutshell, buy when it's going up and sell it when it's going down, when one side is more dominant than the other; when neither side is dominant, be flat. This is too general to be called a strategy, but it's at the root of everything it takes to make a profit. Put a similar way but with a slightly different intention, don't be short when the market is clearly going up, and vice versa.

 

Perhaps I conditioned myself early on from constant exposure to the words "strategy" and "system" to dislike the connotation that they evoke. I have a methodology, which implies an approach to the market, rather than a strategy, which implies things like always waiting 135 minutes from the open, and then buying one tick above it, and this kind of thing. Which again, may work very well for some period of time, for some people. In the end what's most important is that we find something that works FOR US, not for someone else. Trading is very personal, which is why I present my views but always with the caveat that I'm never trying to change people's minds, only present them with other perspectives, just as I appreciate them presenting me with different views than my own.

 

I use points of reference like the weekly highs and lows, prior day highs and lows, I use quite a bit of volume profiling, and I use volume, along with of course the market's price itself. And all together they serve as tools for my approach to discerning the market's immediate intention. All of those things give context to what the market is currently doing, and that's what separates my approach from one like an opening range breakout approach found in the article. Neither is better or worse, but they are quite different. One heavily considers the past, whereas the other places a rather limited need to know about what happened in the past.

 

I'm trying to come up with a strategy that fades breakouts on a 15min chart, probably with the EUR/USD. I wanna do what the profitable traders are doing, or the opposite of what every once else is doing. From what I understand, 95% of retail traders are losing money. So I want to watch the markets and for the most part, trade against the masses when false breakouts happen. I want to use a great deal of market sentiment in my strategy, but don't want to be naive and not use fundamental or technical analysis. And of course risk/money management and candlestick patterns are shoved in there somewhere.

 

Any thoughts on my approach? I really appreciate the feedback so far, so thank you to everyone.

 

Your approach on the surface sounds very logical. This is only an observation, but it sounds like you have not really traded much before, or maybe more accurately, it sounds like you have not put in a lot of time in the chair sitting and watching. Am I right or not? Good ideas, yes, 95% lose, so fade them, so fade the breakout when it fails, etc... Did you also consider that those 95% (I have no idea if this is accurate or not and it's not important really) probably also do exactly what you're doing--namely, look for a strategy, back test it, and take every trade that presents itself? Do some candlestick study, money management, etc..? Maybe it's true, maybe not, just a thought. I know many who have no plan at all, and that's not a good thing of course.

 

Out of curiosity, what are you ideas for determining market sentiment, since you mentioned it?

 

I am pretty straightforward and I hope you know that I have the utmost respect for you or any trader's thoughts, strategies, and approach to the market. Differences of opinion and approaches are what make us unique, and able to have an interchange of useful ideas from all sides.

Share this post


Link to post
Share on other sites

Your approach on the surface sounds very logical. This is only an observation, but it sounds like you have not really traded much before, or maybe more accurately, it sounds like you have not put in a lot of time in the chair sitting and watching. Am I right or not? Good ideas, yes, 95% lose, so fade them, so fade the breakout when it fails, etc... Did you also consider that those 95% (I have no idea if this is accurate or not and it's not important really) probably also do exactly what you're doing--namely, look for a strategy, back test it, and take every trade that presents itself? Do some candlestick study, money management, etc..? Maybe it's true, maybe not, just a thought. I know many who have no plan at all, and that's not a good thing of course.

 

Yes, for a little over a month I've spent several hours a day watching the major trading pairs on Trading View's excellent online software. This isn't a lot of time, but I'm not burnt out yet, so the signs are good that I'm willing to learn. I'm definitely coachable, which is one reason I think I can eventually be good at this.

 

And I'm certain most people make an effort to build this "master plan" that will give them 90-100% certainty on every trade. But the difference between the 5% and the 95% is the ability to stick to the plan, without letting greed or any other emotional roadblock get in the way. That's what I need to learn how to do.

 

Out of curiosity, what are you ideas for determining market sentiment, since you mentioned it?

 

I plan on using recent highs and lows, candlestick lengths, maybe a Bollinger Band to see current volatility, maybe Fib levels. I'm an extremely intuitive person and have a good understanding of human nature, and I've noticed this skill comes in handy when predicting where prices will go when false breakouts occur. But also, just watching non-stop for over a month has given me a good idea of how volatile a pair can be, and even better- how the pair reacts at certain times of the day.

 

The reason I chose to start with the concept of fading breakouts was because, generally, breakouts occur when the pair is ranging. And pairs range 80% of the time, which would present me with more opportunities to trade each day since I want to trade on a 15 min chart. But of course, I don't plan on making 5+ trades a day. 2-3 well set up opportunities sounds more reasonable. My goal is to gain 25-30 pips a week and using a compound strategy of leaving everything in my trading account so I have more capital to work with. I don't plan on supporting myself through trading for a few years, so I'll have to have a job on the side. We'll see how that goes lol

Share this post


Link to post
Share on other sites
Yes, for a little over a month I've spent several hours a day watching the major trading pairs on Trading View's excellent online software. This isn't a lot of time, but I'm not burnt out yet, so the signs are good that I'm willing to learn. I'm definitely coachable, which is one reason I think I can eventually be good at this.

 

Yes this isn't a lot of time, but it's a good start. I'm guessing the charts you watch are real time, it looks like a pretty neat site. I'm sure you know this, but watching the market and trading the market are quite different ball games. I think you are going about it the right way though: observing first.

 

And I'm certain most people make an effort to build this "master plan" that will give them 90-100% certainty on every trade. But the difference between the 5% and the 95% is the ability to stick to the plan, without letting greed or any other emotional roadblock get in the way. That's what I need to learn how to do.

 

I respectfully but strongly disagree. This is what's promoted out there in vendor-land: that it's all about having a plan and sticking to it.. Well, I agree that discipline is 100% essential, as is sticking to a plan of some kind, and that not doing this will result in total failure. BUT it takes more than discipline and a plan, IMO. Some plans simply stink, and following them to the letter are just going to guarantee failure. Many plans will be superb, but IMO these are probably going to be based on your own experience in the market, formulating theories about how the market moves, and then trying to take advantage of that information.

 

There are many plans or systems that are sold for $200 and virtually guarantee wealth. Do you think that these plans, if followed with perfect discipline, will really achieve good results?

 

 

The reason I chose to start with the concept of fading breakouts was because, generally, breakouts occur when the pair is ranging. And pairs range 80% of the time, which would present me with more opportunities to trade each day since I want to trade on a 15 min chart.

 

Well, that depends a lot on how you define a range, and what your time frame in consideration is. Markets trend a lot if you consider intraday activity. It may be within the context of a larger period's range, but markets must move to some degree, or there is no market. There is a tradeable intraday trend probably 16-17 days out of every 20.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Topics

  • Posts

    • NFLX Netflix stock, watch for a top of range breakout at https://stockconsultant.com/?NFLX
    • SMCI Super Micro Computer stock watch, attempting to move higher off the 34.06 support area at https://stockconsultant.com/?SMCI        
    • UPST Upstart stock watch, pull back to 68.15 gap support area at https://stockconsultant.com/?UPST  
    • Why not to simply connect you account to myfxbook which will collect all this data automatically for you? The process you described looks tedious and a bit obsolete but may work for you though.
    • The big breakthrough with AI right now is “natural language computing.”   Meaning, you can speak in natural language to a computer and it can go through huge data sets, make sense out of them, and speak back to you in natural language.   That alone is a huge breakthrough.   The next leg? AI agents. Where they don’t just speak back to you.   They take action. Here’s the definition I like best: an AI agent is an autonomous system that uses tools, memory, and context to accomplish goals that require multiple steps.   Everything from simple tasks (analyzing web traffic) to more complex goals (building executive briefings or optimizing websites).   They can:   > Reason across multiple steps.   >Use tools like a real assistant (Excel spreadsheets, budgeting apps, search engines, etc.)   > Remember things.   And AI agents are not islands. They talk to other agents.   They can collaborate. Specialized agents that excel at narrow tasks can communicate and amplify one another’s strengths—whether it’s reasoning, data processing, or real-time monitoring.   What it Looks Like You wake up one morning, drink your coffee, and tell your AI agent, “I need to save $500 a month.”   It gets to work.   First, it finds all your recurring subscriptions. Turns out you’re paying $8.99 for a streaming service you forgot you had.   It cancels it. Then it calls your internet provider, negotiates a lower bill, and saves you another $40. Finally, it finds you car insurance that’s $200 cheaper per year.   What used to take you hours—digging through statements, talking to customer service reps on hold for an hour, comparing plans—is done while you’re scrolling Twitter.   Another example: one agent tracks your home maintenance needs and gets information from a local weather-monitoring agent. Result: "Rain forecast next week - should we schedule gutter cleaning now?"   Another: an AI agent will plan your vacations (“Book me a week in Italy for under $2,000”), find the cheapest flights, and sort out hotels with a view.   It’ll remind you to pay bills, schedule doctor’s appointments, and track expenses so you’re not wondering where your paycheck went every month.   The old world gave you tools—Excel spreadsheets, search engines, budgeting apps. The new world gives you agents who do the work for you.   Don’t Get Too Scared (or Excited) Yet William Gibson famously said: "The future is already here – it's just not evenly distributed."   AI agents will distribute it. For decades, the tools that billionaires and corporations used to get ahead—personal assistants, financial advisors, lawyers—were out of reach for regular people.   AI agents could change that.   BUT, remember…   We’re in inning one.   AI agents have a ways to go.   They’re imperfect. They mess up. They need more defenses to get ready for prime time.   To be sure, AI is powerful, but it’s not a miracle worker. It’s great at helping humans solve problems, but it’s not going to replace all jobs overnight.   Instead of fearing AI, think of it as a tool to A.] save you time on boring stuff and B.] amplify what you’re already good at. Right now is the BEST time to start experimenting. It’s also the best time to find investments that will “make AI work for you”. Author: Chris Campbell (AltucherConfidential)   Profits from free accurate cryptos signals: https://www.predictmag.com/     
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.