アルゴリズムと機械の外国為替戦略 | OneStepRemoved

  • Articles
  • Sophisticated Web Sites
  • Automated Trading
  • お客様の声
  • お問い合わせ

取引システムのドローダウンと感情

1 月 28, 2013 によって ショーンオバートン 13 コメント

What do baseball and trading system drawdowns have in common? A lot more than I ever realized.

If you haven’t read the book or seen the movie Moneyball (which I highly recommend), professional baseball adopted a statistical approach to recruitment and gameplay around 2000.

The Oakland Athletics adopted the approach before any team. They experienced tremendous success in their first system-driven season, despite countless expert predictions of imminent failure.

I started reading The Signal and the Noise by Nate Silver last night. The baseball chapter picks up where Moneyball left off. Dustin Pedroia, a star second baseman for the Boston Red Sox, enters the scene as an unlikely success story.

Most scouts overlooked him. He is short. He has a paunch and bowed legs. Nobody looks at the guy and thinks “professional athlete”.

Dustin Pedroia held strong through a trading system drawdown of his own

Dustin Pedroia held strong through a trading system drawdown of his own – an unexpectedly low batting average.

Sticking with the system

Pedroia batted a lackluster .198 when the Red Sox brought him to the major leagues in August of 2006. The first month of the 2007 season started off even worse at .172.

 

A team like the Cubs, who until recently were notorious for their haphazard decision-making process, might have cut Pedroia at this point. For many clubs, every action is met by an equal and opposite overreaction. The Red Sox, 一方、, are disciplined by their more systematic approach. And when the Red Sox looked at Pedroia at that point in the season, James told me, they actually saw a lot to like. Pedroia was making plenty of contact with the baseball – it just hadn’t been falling for hits. The numbers, most likely, would start to trend his way.

“We all have moments of losing confidence in the data,” James told me. “You probably know this, but if you look back at the previous year, when Dustin hit .180 or something, if you go back and look at his swing-and-miss percentage, it was maybe about 8 パーセント, maybe 9 パーセント. It was the same during that period in the spring when he was struggling. It was always logically apparent – when you swing as hard as he does, there’s no way in the world that you make that much contact and keep hitting .180.”1

Trading System Drawdown

Every trader goes through a slump – even the best of them. When your trading system drawdown reaches uncomfortable levels, how do you cope?

I had the opportunity to lead managed fund sales at one of the largest forex brokerages in the world. The product was the Sentiment Fund and it was AWESOME. When the fund took off and upper management suddenly got involved, the fund had $40 million under management and nearly 1,000 investors.

If there’s one thing that you can count on with forex traders, it’s that they are going to lose. All the time. No doubt about it.

The firm received real time information on the positions of all clients. Whenever too many traders held positions long or short, the fund did the exact opposite.

それはそれ. 、 automated strategy was stupid simple, but the returns were amazing. The aggressive fund kept the leverage at 2:1, yet was on track to earn 40% 毎年.

Bad luck

Two months before the hand off, the fund experienced a sharp drawdown of -8%. Like most people, investors thought of 40% returns as 40/12 = 3.3% profit per month. They don’t think about the natural slumps that happen – just like the one Pedroia experienced.

こと “surprise” drawdown caused a mass herding effect. It didn’t matter that the fundamentals of the strategy were unchanged. Forex traders didn’t wake up smart last month and know how to game the system. Bad luck happens to the best strategies. それにもかかわらず, investors ran for the exits from a world class strategy.

Were the guys on the systems desk worried about the strategy that they built? No way! When Pedroia went through his slump, he could have overreacted and start messing with his batting stance. He could have adjusted his distance to the plate or any number of things.

Pedroia knew that his system was good. The systems guys knew their strategy was phenomenal. In spite of all the pressure, they held firm and blew past the drawdown by the time I handed off the sales effort.

What element of trading matches the “swing-and-miss percentage”? The Red Sox clearly used it to justify sticking with their system. In Sentiment Fund’s case, it was knowledge of the underlying system.

How can quantitative traders with less obvious fundamental theories know that their system is sound? I’d love to hear your comments.

1. Excerpted from The Signal and the Noise by Nate Silver, ページ 104.

以下の下でファイルさ: 戦略の取引のアイデア タグが付いて: ドローダウン, Dustin Pedroia, 外国為替, system, 取引システム

お金の管理モデリング

4 月 2, 2012 によって ショーンオバートン 4 コメント

We recently developed software to model the affects of random chance on money management. Although computers are capable of generating pseudo-random numbers, the pseudo-random process introduces bias into the random distribution.

We opted to source our random numbers from random.org. The web site generates purely random streams of bits taken from atmospheric noise. We then use binary mathematics to change those bits into numbers ranging from 1-10,000. 言う, たとえば, that we want to model a trading system with a winning percentage of 50%. Whenever a number comes out between 1-5,000, we consider that a winner. Anything above 5,000 marks a loser.

Changing the winning percentage to 65% works the same way. Any number less than 6,500 represents a winning trade. Numbers above 6,500 signal a loss. The modeling quality is accurate to the thousandth decimal place. That type of accuracy is way more accurate than the “known” accuracy of your trading system, which can only be known within a few whole percentage points.

Most traders fall into the trap of thinking about their trades as individual outcomes. The more appropriate way to view returns is as the sum of all individual outcomes. Losing on any given trade does not matter. It only matters whether the sum of all your winners is greater than all of the losers.

It gets more complicated, 残念なことに. A system with 50% wins and a 1:1 payout will almost never come out at exactly breakeven. The mathematical expectation is that we expect to see a degree of drift in the returns solely due to random chance. I suggest reading more in the random trade outcomes and dollar profits section to get a better understanding of drift.

最後に, we must define a sampling period for evaluating the final result. I arbitrarily set the default value to 200. That means that the software tells us the range of outcomes after 200 合計取引. That may take more than a year for some traders. Daytraders may reach that benchmark in several weeks of trading. The question that we are answering is “what is my account balance likely to be after placing 200 取引?”

Coin Toss Trading Experiment

The first experiment is to analyze how dollar returns vary with a coin toss game and the most basic お金の管理 method. A starting balance of $100,000 is used with a risk of 1%. The risk will not change as in the fixed fractional method. 代わりに, we will leave the lots fixed in order to strictly understand random chance. Wins always earn $1,000. Losses always lose $1,000. The odds of a coin toss are 50% wins with 50% losses and a 1:1 reward risk ratio.

The average trade comes out to $99,868.36, almost exactly $100,000. It’s what we expect for a 50-50 game with a 1:1 reward risk ratio. What I find interesting is the standard deviation of $14,377 and how it changes. I don’t want to cover scary math topics. The layman’s explanation is that the standard deviation is the “normal” range from the average that you might expect. 、 $100,000 バランス, ほとんどの場合, would either lose $14,000 or make $14,000.

Everything beyond those standard deviation boundaries represent the less likely wild scenarios. The minimum outcome comes out to $58,o00, a massive 42% 損失. This had a 0.54% chance of occurring. The maximum outcome shows as $158,000, a monster 58% 戻り値. This had an even smaller chance of occurring, のみ 0.1% (1 in every 1,000 試験).

Changing the account risk dramatically affects the standard deviation. 1% strikes most traders as sane and reasonable. まだ, there is a small chance of losing half the account to drawdown strictly because of terrible luck. Decreasing the overall risk by a fourth to 0.25% drops the standard deviation by exactly one fourth. The worst case scenario shrinks to a highly tolerable $11,500 ドローダウン (11.5%). Most traders would find a number between 10%-20% reasonable. The consequence of the reduced risk is that the best case scenario drops correspondingly down to a 14.5% ゲイン.

Stretching the risk out to 2%, a normal industry practice, turns out to be risking accounting suicide with the coin toss game. The worst case scenario drops the final account balance down to $8,000, a staggering 92% 損失.

The goal is to help you define risk from a gut feeling matter into something more tangible and calculated. Too many traders enter the market day dreaming about profits. Risk enters the picture, but too few traders actually understand the relationship between risk and reward. うまくいけば、, the picture of best, worst and average scenarios is starting to become more clear for you.

以下の下でファイルさ: お金を失うことを停止します。, 戦略の取引のアイデア タグが付いて: ドローダウン, money managment, 精度が 95 パーセント, リスク報酬の比率, 取引, wins

専門家アドバイザーを最適化します。

2 月 20, 2012 によって ショーンオバートン 1 コメント

One of the lesser known features of the メタト レーダー backtester is the optimization feature. It’s so small that you could be forgiven for overlooking it.

Optimization is the process to maximize a certain outcome. この場合, it’s profit. Any EA developer wants to maximize the amount of profit made over a given period of time. The MetaTrader optimizer allows the trader to search for the combination of inputs that yielded the maximum profit over a given period of time.

The process is identical to running a バックテスト, except that MT4 runs multiple backtests at the same time. It then organizes the results and offers up the best combination.

Telling the backtester to run in optimization mode is easy. Simply put a check next to the word 最適化. MetaTrader will then sort through the combinations that you tell it to consider.

MetaTrader EA Optimization option

Place a check in the box next to Optimization in the MT4 backtester

The next step is to click on the Expert properties button to the right. A new window appears that contains three tabs: テスト, Inputs and Optimization. These screens allow the trader to inform MetaTrader which variables to consider for testing and how to weight the results.

テスト

The top of the testing section applies to every type of バックテスト. Here you can select the starting balance. MetaTrader defaults the option to $10,000, although you can make this any amount of your choosing.

The second default option allows the trader to restrict the direction of trades. It’s a frequent expert advisor programming request. It’s also one that is unnecessary. Both the backtester and expert advisor options screen allow the trader the option of restricting trades to long only or short only without additional programming. If the EA is not well programmed, this setting may cause errors 4110 または 4100 to appear all over the trading journal. It’s harmless. The only effect should be that the backtester slows down. It’s the result of writing to the journal hundreds of times or more.

The testing tab of the MetaTrader backtester

The testing tab of the MetaTrader backtester

A groupbox appears underneath these options that inexplicably relates to the optimization process. You’d think it would make more sense to place it in its namesake tab. That’s typical MetaQuotes logic at work.

The first line contains numerous parameters for choosing the best option. User overwhelmingly select for the largest account balance, but other options include the profit factor, expected payoff, maximum drawdown and drawdown percent.

The last line automatically uses a genetic algorithm. Optimization processes use either brute force methods or genetic algorithms. Brute force strikes most people as intuitive although obviously exhausting. The software tests every combination possible. Genetic algorithm’s attempt to make the process more intelligent. When the software sees that certain parameters almost inevitably lead to a losing performance, the algorithm skips similar tests where it expects to lose.

This is a great idea if you have a quality genetic algorithm. My opinion of the メタト レーダー backtester is less than stellar. I don’t feel very confident about the algorithm at all. If you don’t mind spending extra time waiting for test results then I suggest unchecking this option. You don’t want to miss a potentially important combination.

Inputs

Most people find this screen confusing. The first column, called 値, strictly controls inputs for simple backtests. 、 値 column is totally ignored during an optimization run.

The inputs tab of the MT4 backtester expert settings

The inputs tab of the MT4 backtester expert settings

The important columns for this task are Start, ステップ と 停止. Start is the lowest number that the MT4 backtester will consider. Step refers to the interval between the lowest value and the highest value. Tightly controlling this setting allows the user to gain quick insights into how changing the variable values affects performance without dragging the tests out for a full week. 停止 is the highest number that the expert advisor will use.

The most obvious candidate for testing in this example is the Take Profit value. The default setting is listed at 50. If you trade the majors, you might want to consider settings ranging between 10 pips and 200 ピップ. That means that you set Take Profit row to 10 ため、 Start column and 200 ため、 停止 column. The real trick here is selecting the ステップ. If you choose ステップ = 1, then MetaTrader will run a separate test for every value between 10 と 200. That’s 190 テスト, which is overkill. A step of 10 cuts the total number of tests down to 19.

最適化

This section is the nit-picky part. If a trader feels it’s unacceptable to have 10 consecutive losses in a row, he can place a check next the the Consecutive wins box. MT4 automatically discards any tests which yield a result that contains anything checked off.

The optimization tab in the MT4 backtester expert properties

The optimization tab in the MT4 backtester allows users to discard tests with undesirable traits.

When you finish going through each of the tabs, push OK in the bottom right corner. It’s time to launch the tests.

Curve fitting in the MT4 Optimizer

A word of warning: my personal opinion is that optimizing an expert advisor is usually a very bad idea. The unique settings that yield the most profit in 2012 are unlikely to yield the most profit in 2013. If you don’t control for random chance, there’s a good probability that the 2012 best combination may result in catastrophic losses in 2013.

I recommend that traders pursue any strategy development work in NinjaTrader. I don’t like the idea of optimizing at all. 代わりに, I always focus on testing strategies for 入口と出口の効率. I know from years of experience that these values never fundamentally change on instruments of the charts traded. Entry and exit efficiencies make wonderful metrics for automated trading because they are so stable.

以下の下でファイルさ: メタト レーダーのヒント, あなたの概念を歴史的にテストします。, 戦略の取引のアイデア タグが付いて: バックテスト, backtester, brute force, カーブフィッティング, ドローダウン, EA, 専門家アドバイザー, 遺伝的アルゴリズム, inputs, MetaQuotes, メタト レーダー, mt4, 最適化, optimizer, プロフィットファクター, 利益を取る, testing

  • « Previous Page
  • 1
  • 2
メールで無料の取引戦略

トレンド分析

申し訳ありませんが. No data so far.

アーカイブ

  • ルール
  • 外国為替市場のしくみ?
  • インジケーター
  • メタト レーダーのヒント
  • MQL (オタクのため)
  • NinjaTrader ヒント
  • Pilum
  • QB プロ
  • お金を失うことを停止します。
  • あなたの概念を歴史的にテストします。
  • 戦略の取引のアイデア
  • 未分類
  • What's happening in the current markets?

翻訳


無料の取引戦略

プライバシー ポリシーRisk Disclosure

著作権 © 2022 OneStepRemoved.com, (株). すべての権利予約.