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

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

晴らしいマルチンゲール戦略

12 月 7, 2011 によって ショーンオバートン Leave a Comment

恐怖を構成するすべての外国為替トレーダーに直面して強い感情. 失うことの恐怖, 特に, 他の休息中にモニターに 1 つの目が付いているベッドの多くを保持します。. マルチンゲール戦略は理論的に戦略が上に出て常に確保することによってその問題を削除します。.

つまり、賭けに損失の後, 通常 2 回前の賭けの量. 勝ち、損失の値は同じ例をやってみましょう. 勝てるか $10 負けや $10.

最初の賭け金を置く $10 リスクで. 運が悪いの実行時に、まず, その結果、 $10 損失.
今、我々 は危険性を 2 倍します。. 我々 はどちらかに支払われること $20 または別の失うことになります。 $20.
我々 は再び失わ. これまでのところ我々 がダウン $30. 我々 は再びリスクを 2 倍します。, だから今我々 は作るつもりです。 $40 または別を失う $40.

これまでのところ戦略しない悪いことに思える. 3 行の損失にのみ発生します 12.5% 時間の (0.5 * 0.5 * 0.5). これは、時間の大半を取得します悪く. しかし, 例のために, 続けていきましょう.

我々 は再度失う. 今、私たちはダウンしています。 $70. するか、または失うリスクが 2 倍 $80.
別の損失. フローティング損失が大きくなります。 $150. リスクが大きくなります。 $160.

リスク数をもう少し不快になっていることに気付いて疑いがないです。. 明確などのように迅速にそれを作るために彼らは手に負えなくなることができます。, 下の小さな表を作成しました。.

連続した損失フローティング損失
6-$160
7-$320
8-$640
9-$1,280
10-$2,560

しかし, 10 取引アカウントを救う場合, あなたを失ったすべてを取り戻す, プラス、 $10 あなたはもともとを得るためにしようとしました。. 冷たい連勝中に弾丸を汗が, 時間の大半をトップに出てくる戦略.

ここで問題がロールするには. 私はすべての時間を言っていません。. 現実の世界で, お金の無限の供給を持っていません。. あなたが持っているかどうか、 $5,000 特定取引勘定とリスク $10 最初のトレードで, その後、のみの最大を耐えることができます。 10 連続した損失; 11 の損失にそれを作るのに十分な金を持っていません。.

晴らしいマルチンゲール戦略のペイアウトを測定

頭が勝利して尾を失うことを意味を意味コインフ リップのゲームを考える. オッズは、します。 1:1, 50%, あなたが勝つか、任意の特定のフリップを失う. 勝利の確率は一定に保ちますが 50%, それらの勝利および損失の実際の分布はホットとコールドの縞の形で来る. コイントス 10 回常には発生しません 5 受賞者と 5 敗者.

コインを投げる 10 倍になります 10 連勝 0.09% (0.510)時間の. 逆に, 0.09% 時間で結果も 10 連続した損失. だから, コインはランダムな結果のようなものに見える行動の結果を反転します。 0.18% 時間の. 夜くれるシナリオ – 外国為替取引のことで恐怖が消える – 不運な連勝は、します。 10 受賞者は実際に渡すために来る. 0.09% 1 回で発生時間のすべて 1,111 試験.

考慮すべき次の質問はこれが価値があるようにするために必要な勝利数です。. みんなのゴールポストが違います, 誰も幸せなキャンピングカーになりますアカウント残高の 2 倍と仮定しても安全ですが、. 獲得 $10 合計 $5,000 合計を持っている必要があることを意味 500 勝利マーチンゲールを設定します. 各セットは、それを獲得するために必要な取引のグループ $10. 時々, 勝ちトレードとする仕上げセット. かかる場合があります。 7 取引. 時々 (がぶ飲み), かかる 20.

500 組の勝利が必要です。 1,000 合計取引. 我々 はこれは番号受賞セットを割ることによって得る, 500, 勝利の確率, 0.5. 場合のしきい値は、恐ろしい数の近さ 1,111 あなたに飛び出し, それが必要.

悪の 10 連続負けトレードで生じる可能性があることを覚えています。 任意の点 以降で 10 合計取引. それは後に発生する可能性が 100 取引または, 非常にまれ, 後 10,000 取引. 全体的に, それが発生します 0.09% 時間の, それがランダムにクラスターが. どこを予測する方法はありません。.

視覚的に問題を考える. 私たちのハードル 1,000 アカウントを 2 倍にする取引が危険ゾーンを構成します。, または悪い宇宙. 安全地帯は危険に総取引のみ, 1,111, マイナスのベンチマーク 1,000, 安全地帯であります。 111.

A graphic of the area of danger and safety within a Martingale strategy

ゾーン緑安全ゾーンが基準となりますクリア赤、危険の海のよう, トップに出てくる確率は丁度あなたのおかげで. 具体的には, あなたの顔、 90% 発端で、わずかな反対 10% あなたのお金を 2 倍のチャンス.

肥沃な戦略戦略考えを捜すと お金の管理 テクニック. マーチンゲールの背後にある単純さが好き, しかし、それはそれについては. 単純な数学的な解析も、時間の大半を終了するじゃがわかります. マーチンゲールの取引戦略を継続したい場合, それはただこの時点からより悪くなります。.

他のマーチンゲールの問題

オッズではない本当に 50%. 我々 は価格では上下どちらか行くことを想定. スプレッドを考慮するを忘れた. EURUSD のようなペアの典型的なスプレッドを表示します。 1.0-1.5 ピップで最もリーズナブルな価格で証券会社. こと, 残念なことに, 確率に影響を与える. 価格はさらに移動する必要があります。 1.5 ピップの終了点に到達するには.

マルチンゲール システム トレード、 10 今 pip 間隔を獲得する必要があります。 11.5 ピップをカバーするため、 10 それリスクをピップします。. Wins のみ行われます 46.51% 理論的ではなく時間の 50%.

近い確率をもたらすため、pip の間隔のサイズを移動 50%. A 25 pip 間隔を実現します。 48.54% 精度, 一方、 50 pip 間隔利回り 49.46% 精度. はしごは近づくと近くにさらに詳細に行く 50%. それは決してかなりそこに取得します, しかし.

行った他の前提で市場をコイントスに似ているということです。. まあ, それは間違いなく事件ではないです。. 市場展示高程度のランダムさが, 彼らは表示期間、彼らがはっきりと非ランダム. 彼らは、します。, 実際, フラクタル. あらゆる機会を通じて市場のフラクタル性に関する遊説を楽しんだマンデルブロ. 我々 のアナロジーを投げコインで作られた前提条件は常に適用されません。. 読書をお勧めします (Mis)市場トピックの素人フレンドリーな説明に興味を持っている場合の動作.

以下の下でファイルさ: 未分類 タグが付いて: マルチンゲール, 戦略

堅牢なエキスパートアドバイザー

12 月 5, 2011 によって ショーンオバートン Leave a Comment

あなたがしたい場合 プログラム専門家アドバイザー, それはあなたがファイルを使用する可能性がある方法を検討することが重要です. 私は、新しい参照の最も一般的な間違い MQL プログラマ 作る彼らはメモリに過度に依存していることです. 電源障害などのイベント, エキスパートアドバイザーとの取引時にハードドライブのクラッシュまたは弱いインターネット接続が大混乱をもたらすことができます. EAは、理想的にピックアップし、あなたが正常に条件を復元することができますたびに実行することができる必要があります.

メモリの問題

問題は時々設定を変更するような日常的なものから生じます. クライアントが私たちに来たときに私はそのハードな方法を学びました ダラスオフィス 2週間の非常に複雑なEAを注文します. すべてがで完全に働きました backtester. 一晩テスト, しかし, 何かがゴチャゴチャ行く前に数時間以上続いたことはありません. 私は、設定を変更していないクライアントに指示; ちょうどそれをオンにして一人でそれを残します. 何らかの理由で, これらの命令の重要性がで沈没したことはありません. それは、彼の定義することを実現するために私に年齢を取りました “一人でそれを残します” かなり鉱山と噛合しませんでした. 彼は取引中に行われた少しの微調整は、私がメモリに保存されている設定で混乱しました.

私は特定の方法でソフトウェアを使用するようにクライアントに指示することができます. 多くの場合, 彼らはある程度の命令から外れます. それは人間の本性です. 私は、これらの課題から学びました, 任意のプロたいものです. 私たち プログラミング テンプレートには、特別な指示の必要性を最小限にするための構造に変更しました.

グローバル変数

グローバル変数はメモリに頼るの問題を回避するための一般的なツールです. EAをチャートから削除された場合, それが作成されたグローバル変数は、あなたのためにアクセス可能です, EAまたはその他のEAはメタトレーダーの内の任意の場所から読み取ります.

グローバル変数の使用は、洗練されたに聞こえますが, それは実際には非常に単純なアプローチです. メタトレーダーは、変数名とそのインストールディレクトリに非表示のテキストフ​​ァイルを管理, それが保存されている値と、それが最後に変更された時間. たび以上に 6 前回からの経過週 MQL グローバル変数を使用します, メタトレーダーは、自動的に削除されます.

A マルチンゲール このシステムは、単純な統計量を追跡するために、グローバル変数を使用することを選ぶかもしれません. マルチンゲール リスクへのアプローチとワイルドです, そうトレーダーは現実的に最大レベルが取引一目で知りたいことができ. グローバル変数は、その必要性から、簡単な作業を行います. 取引する次のレベルは、グローバル変数よりも大きい場合に, その後 MQLコード グローバル変数を更新する必要があります.

覚えておくべき唯一のアイテムは、グローバル変数は、6週間後に期限切れということです. EAは、その現在の値にグローバル値をリセットすることで情報をリフレッシュする必要がある場合があります. そうすることでメタトレーダーの観点から変数新鮮に保つだろう.

A screen shot of global variables in MetaTrader 4

代わりにそれを格納する情報を読みます

私はに頼ることを好みます MQL'S注文を選択() 私は必要な情報を再作成するためのコマンド. それはより複雑であるが, 利点は、EAはいつでも機能することができるということです, 任意の場所, 設計通り. ハードドライブがクラッシュした場合, それは回復の観点から問題ではありません. あなたはダウンタイムの間にトラブルにまだあります, しかし. あなたのMT4のアカウントに同じEAをロードすることができ、それがすぐに情報を再構築しています.

上記を取ります マルチンゲール シナリオ, 私たちは、取引の開閉時間を比較することにより、取引レベルの数を再構築することができ. 貿易場合 #1 のクローズ時間を持っています 2011 12月. 5 00:00 貿易 #2 またのクローズ時間を持っています 2011 12月. 5 00:00, それは、同じ貿易グループの一部であることを教えてくれる. これまでのところ, 我々は持っています 2 取引レベル. 貿易場合 #5 で閉鎖 2011 12月. 5 00:00 しかし、何の取引はその後なかったです, その後、私たちは取引ことを知っています 5 合計レベル. EAは、すべての可能な組み合わせをループしているから、最高数を選ぶことができます.

注文履歴からの読み込みのアプローチは、この単純な例のためにやり過ぎのビットです, あなたはより多くの複雑な情報を計算する必要がある場合、それは動的に、エラーのリスクが最小限に便利です.

以下の下でファイルさ: 外国為替市場のしくみ?, メタト レーダーのヒント, 未分類 タグが付いて: EA, 専門家アドバイザー, global variable, マルチンゲール, メモリ, メタト レーダー, mql, OrderSelect, power failure, テンプレート

正確なNinjaTraderのbacktests

12 月 2, 2011 によって ショーンオバートン 21 コメント

昨日, 私はどのようにについて少し書きました backtesterはダニをシミュレート. NinjaTrader停止とは、バーの範囲内で利益の秋を取るバーを検出した場合, それは常に停止が最初にヒットしたことを前提としてい.

私はこの問題は、制度のクライアントに彼の戦略を販売したいクライアントのために来ていました. 機関は戦略がより広範な市場の状況でどのように動作するかを理解するために、バックテストする能力を求めていました. ライブ結果のみがカバーされ 9 ヶ月, 投資家が情報に基づいた意思決定を行うためにためているが、それが困難になります. 信頼できます, 正確なバックテストは、私のクライアントは、販売を促進するためにできるようになります.

我々は最初の戦略をプログラムした場合, それはひどい失敗のように見えました. 結果から 45 すべての貿易の学位株式急落. 彼はで彼の停止を置きました 1/3 ATR の, そう自然に, NinjaTraderは、彼らがすべての時間をヒットされたことを想定.

我々は彼のために開発されたソリューションは、高を使用しました 時間枠 戦略は、実際に使用することをチャート, しかし、私たちはその後、何NinjaTraderのコールが含まれないようにコードを修正しました これは、粒度を入力しました. 基本的には, 我々はチック単位で目盛りに更新するために戦略を強制的にバックエンドでティックチャートを追加.

これは、実際にプログラムに非常に簡単です. 初期化関数で, あなたが入札を追加し、ダニ・チャートを依頼する必要があり.

保護されたオーバーライドボイドの初期化()
{
追加(文字列instrumentName, PeriodType.Tick, 1, MarketDataType.Bid);
追加(文字列instrumentName, PeriodType.Tick, 1, MarketDataType.Ask);
}

その後、, OnBarUpdateで() 関数, あなたは、コードは変更しません. あなたがする必要があるのは、単純なIF-THENドステートメントの中でそれを置くことです

保護されたオーバーライドボイドOnBarUpdate()
{
もし( BarsInProgress == 0 )
{
// ものを行います
}
}

バックテストの結果は、内来ました $5 の期間にわたって実際の取引結果の 9 ヶ月! 頻繁にバックテストは、不正確な結果につながるが、, 我々は、このような軽微なエラーで結果を再現するために興奮しました。.

この方法の主な欠点は、手動でソースコードの内部で楽器名を入力しなければならないということです, それをコンパイルします, 新しい機器のバックテストを実行するたびに. それは素晴らしい解決策ではありません, しかしNT7は、残念ながら、プログラムの初期化中からInstrumentNameを呼び出してサポートしていません。().

以下の下でファイルさ: NinjaTrader ヒント, あなたの概念を歴史的にテストします。, 未分類 タグが付いて: 加えます, バックテスト, 初期化します, ninjatrader, onbarupdate

メタト レーダーの価格データを Excel にエクスポートします。

11 月 29, 2011 によって ショーンオバートン 12 コメント

メタト レーダーのチャートから価格の履歴を Excel にエクスポートが簡単にできませんでした。. ちょうど次の手順に従ってください。:

1. グラフを開く
2. [ファイル] をクリックします。, その後、名前を付けてください。
3. 任意の名前にファイル名を変更します。. ASCII テキスト *.csv ファイル型を残すようにしてください。
4. 保存を押してください。
5. あなたの保存したファイルをダブルクリックします。.

MetaTrader price export to Excel

.csv はカンマで区切られた値として知られているファイル形式です。. Excel は、この形式をサポートしています, 価格をスプレッドシートにエクスポートするための最も簡単な方法になります。.

以下の下でファイルさ: メタト レーダーのヒント, 未分類 タグが付いて: データ, エクセル, エクスポート, メタト レーダー, mt4

MetaTrader is more popular than NinjaTrader

11 月 24, 2011 によって ショーンオバートン Leave a Comment

For all my gripes about MetaTrader, I must admit that they do the most important stuff very well. It’s very easy to download and install. Clicking on the desktop icon results in MT4 loading near instantaneously. When you log into the platform, charts immediately appear. The buttons at the top of the screen are obvious to anyone with trading experience. 要するに, it’s about as idiot proof as software gets.

Fumbling through NinjaTrader

All of the things that MetaTrader does well, NinjaTrader does very poorly. The first time that I downloaded the 42 MB installation file, NinjaTrader said that I couldn’t use it because I didn’t have the .NET 3.5 framework installed. That makes sense to me as a programmer. To people that do not program for a living (すなわち, the people reading this blog), that error message is next to worthless. NinjaTrader ought to handle this type of issue automatically.

Once I installed the program, I tried to open a chart. Nothing happened. I messed with it for about 5 minutes until I finally gave up and decided that the program wasn’t worth the effort.

I decided to try again a few months later, at which point I realized that NinjaTrader did not include a datafeed. So then I had to go through their list of 50+ vendors to figure out where I might find a decent forex feed to try using their platform. The feed that I happened to have, Interactive Brokers, required that I download a special version of their software. 当然のことながら, I did not figure this out until I got endless error messages and had to contact NinjaTrader suppport. An hour and several handfuls of hair later, I finally was able to do what MetaTrader allows me to do in seconds – look at a forex chart.

My Windows XP machine with 2 GB RAM, which is pretty typical of your average software user, takes about 20 seconds to load NinjaTrader. I have the nasty habit of closing and opening applications repeatedly. It gets on my nerves when I close NinjaTrader because it takes so long to get it back up again. I would consider leaving the application open, but I usually have 5-6 windows open within their platform. The taskbar always looks so cluttered. Call me crazy, but I find it very difficult to work on the computer with so many window tabs showing at the same time. It feels like there is too much going on visually.

Whenever you have a question about MetaTrader, you simply pick up the phone and call any MetaTrader broker. They answer your question immediately. NinjaTrader, in spite of its excellent online support, largely takes the help yourself approach. You can figure out most problems eventually, but it requires digging through forums and reading a few articles before you stumble upon the one with the answer. That type of self-help approach requires patience. Most people, especially us Americans that expect answers on the spot, are not blessed with that particular virtue.

Products and Add Ons

MetaTrader is like Google Android and NinjaTrader is like Apple. MetaQuotes takes the Android style, hands-off approach. Anything that does not interfere with the MetaTrader itself is allowed. “Allow” isn’t even the right word. MetaTrader is entirely removed from the process. The result is there are thousands of products available for sale that work exclusiely in MetaTrader. It’s an accidental ecosystem for trading products that relates directly to the approach so prevalent in social media and mobile phones.

NinjaTrader takes the Apple, big brother approach; all products are screened and vetted. This does come with some advantages. You’re a lot less likely to buy a total piece of garbage for NinjaTrader than you are for MetaTrader. ということで, the centralized also stifles the products on offer. Maybe it’s just because I’m Texan and resent anything that feels like authority making choices for me, but I think you see a lot more life and innovation when the people selling a related a product don’t have to ask permission to do so.

What does Ninjatrader do, とにかく?

You need to take a week’s worth of online training to really get a sense for how to use the product. NinjaTrader, for some odd reason, does not offer YouTube videos or any friendly beginners guides to get up and running. They require that you attend online webinars, which are always scheduled in the middle of the work day, in order to thoroughly learn each of the product’s main features.

When you open the software, it’s not at all apparent what exactly it’s supposed to do. Is it an automated trading platform? Is it a charting platform? Is it a tool for active traders? NinjaTrader does all of the above, but my opinion is that the software itself does a terrible job making this clear. Little things like a first-time walk after downloading through would help traders get over the steep learning curve and give the product a chance.

I actually love NinjaTrader, but it nearly takes a graduate degree to figure out how to use it. That’s the only reason that I’m so hesistant to recommend it to my メタトレーダープログラミング クライアント. Once you figure out how to use the tools, they are incredibly powerful. The built in trading analytics eliminate the need for MetaTrader related sites like MyFXBook and MT4Stats for viewing and studying my daily performance. Comparing MetaTrader and NinjaTrader in the backtester is not even worth doing: NinjaTrader is infinitely superior. It’s too bad that NinjaTrader gets in its own way.

The features that NinjaTrader offers should make it way more popular than MetaTrader. I just don’t see that happening any time soon with how long it takes to learn the software.

以下の下でファイルさ: メタト レーダーのヒント, NinjaTrader ヒント, 未分類 タグが付いて: メタト レーダー, ninjatrader

Calculate pip value

11 月 21, 2011 によって ショーンオバートン 3 コメント

One of the best trades of my life actually made extra because the appreciation of the same currency. I sold USD/JPY several years ago when it traded at 118.75. I knew there was an important G7 meeting over the weekend, so I placed an anticipatory sell stop on the expectation of a volatile weekend session.

Over the next several weeks, the yen gained on the dollar down to 112.00. When I took profit on the retracement at 113, I noticed that the pip values changed in the past two weeks. It started at $8.47 ピップあたり, but when I closed the trade, it was worth $8.84. The value of every pip jumped 4% in value while I held the trade. How did that happen?

How to calculate the value of a pip

Currencies are quoted in terms of the base currency と、 counter currency. When you say, “I bought 1 GBPUSD の標準ロット”, what that means is that you bought £100,000 in exchange for selling the equivalent amount of US dollars. GBP in this example is the base currency. USD is the counter currency.

If the current exchange rate of GBPUSD is 1.5500, then it takes £1 to buy $1.55. Buying £100,000 means that you sold $155,000.

Pip values come into play when the price changes. Say that the price increases by a single pip to 1.5501. You still own only £100,000. The dollar value, しかし, just increased.

The dollar cost of your trade was $155,000 (£100,000 * $1.5500 /£ = $155,000.)
The current dollar value of your trade is $155,010 (£100,000 * $1.5501 /£ = $155,010.)

You made $10 on a single pip trading a standard lot, meaning that the value of 1 pip is $10. The math is the same for mini lots and micro lots. The only difference is that the pip value is directly proportional to the money management and position size that you trade.

Calcualate pip values when USD is not the counter currency

That last example was as straight forward as it gets. The US dollar was the counter currency. All of the pip values stay in dollars, making it easy for American traders to keep a tally on their profits and losses. It gets more complicated when the counter currency, which is the second currency in a pair, does not use US dollars. That includes when the base currency includes dollars. USD/CAD and USD/JPY are good examples of this. The dollar is the base currency, but CAD and JPY are the counter currencies.

The current price of the USD/JPY is 76.90. Buying 1 standard lot means buying $100,000. That necessitates selling the equivalent amount of Japanese yen. $100,000 * ¥76.90 / $ = ¥7,690,000

When the price rises one pip to 76.91, the value of this investment just rose ¥1,000.
$100,000 * ¥76.91 / $1 = ¥7,691,000

The pip value is ¥1,000, which is where I left off with the example of the dollar acting as the counter currency. ¥1,000 sounds a lot more exciting than $10. 残念なことに, we must bring that number back into dollars for it to make any sense.

¥1,000 * $1/¥76.91 = $13.00 ピップあたり

Calculate pip values when USD isn’t in the forex pair

We can calculate the pip value in dollars, even when neither the base nor the counter currencies include US dollars. Let’s choose a cross pair to make the example a little more real.

NZDCAD trades at 0.77405. NZD $100,000 = CAD $77,405. When the price changes 1 pip to CAD $77,415, the trader earns $CAD 10. Now we have the same issue that we did when trading JPY. CAD $10 isn’t very useful to an American trader. 今のところ, we have to go grab the price of CAD in USD in order to determine the pip value.

USDCAD trades at 1.03612. $CAD 10 * $1 / CAD 1.03612 = $9.65. The US dollar value of one pip on NZDCAD is $9.65.

以下の下でファイルさ: 外国為替市場のしくみ?, 未分類 タグが付いて: pip, pip value

Forex Correlation

11 月 9, 2011 によって ショーンオバートン Leave a Comment

Correlation strategies appeal to forex traders because it removes the stress associated with picking market direction. When two correlated pairs diverge from one another, the idea is to simply buy one pair and sell the other.

What are correlated currency pairs?

Correlation offers a mathematical probability of two “time series” moving in the same direction. Applying the idea to forex, it means that we need to pick two currency pairs. EURUSD and USDCHF are two popular choices due to their extremely high correlation, so we’ll use those.

Now we ask a simple question: “If the EURUSD rises, what is the probability of that the USDCHF will also rise”? Our calculations will pump out a simple a number between -1 と +1. +1 means that that if Currency A rose in value, then it is 100% certain that Currency B rose in value. -1 means that if Currency A increased in value, then it is 100% certain that Currency B decreased in value. 値 0 means that the movement of Currency A exercises no effect at all on Currency B.

Traders generally consider a correlation significant whenever the number is greater than 70%. EURUSD and USDCHF are so popular because they hold the strongest correlation among the major currency pairs. When market volatility was very low a few years ago, it was around -93%. 今日, the correlation tends to hang around -80%. The European debt problems and Swiss National Bank’s intervention have a lot to do with the decrease in this number. Their trading relationships are far less stable.

Risks of correlation strategies

Let’s move back into familiar territory with my favorite example, the moving average. If you take the average over the past 20 バー, you know from experience that the average will differ if you study a 50 period versus a 200 period average. If you look at the average on a 5 minute chart versus an hourly chart, the number will vary yet again.

The take-away here is that the correlations work the same way. The correlation between EURUSD and USDCHF might even be positive if you look at a short enough time scale. As you back away in time, you will notice that the further out you go, the more steady the correlation numbers look. If the weekly correlation of the EURUSD and USDCHF is -80%, you would expect the numbers to get more wild and erratic as you scale all the way down to a tick chart.

The same problem with the moving average also appears. Studying the correlation over 50 periods provides a responsive number, but it is also far less consistent than the 200 period correlation. What a short period gains in responsiveness, it loses in stability.

You should also consider whether the correlation that you’re studying makes fundamental sense. Just because the temperature change in Mongolia predicted the direction of USDJPY for the past week does not make it a good idea to use in the future. The same goes with pair trading.

EURUSD and USDCHF should be highly correlated for two reasons. They both contain the same currency in the pair (米ドル), which half weights them with the same instrument. さらに, the EUR and CHF both have strong trading relationships with the US. You would expect both the Euro Zone and Switzerland to share a need for buying and selling US dollars. They need them for buying oil, importing and exporting to the US, など. Anyone with a cursory understanding of macroeconomics could explain why this relationship makes sense.

Correlation traders typically settle on pairs that share a common currency. The EURUSD and USDCHF trade both share the US dollar. When you buy EURUSD and buy USDCHF, you are really:
Buying EUR and selling USD
Buying USD and selling CHF

Notice that the USD cancels itself out. What you are really doing is buying EUR and selling CHF. This is commonly known as the EURCHF pair. Assuming that the spread is not outrageous, it makes more sense to simply buy or sell EURCHF directly rather than going through the convoluted process of managing two open trades.

If you decide to pursue the two pair approach, you must consider the need to balance the trade sizes against each other. Using standard lots as the example, 100,000 EUR is 137,500 米ドル. 100,000 USD is 90,900 スイス フラン. If you buy one standard lot of EURUSD, you are buying $137,500 of it. When you buy a standard lot of USDCHF, you are only buying $100,000.

$137,500 obviously does not equal $100,000. Unless you intentionally decided to trade different sizes, you may want to consider equalizing them.

Solve for x:
€100,000 / $137,500 = x * (₣90,900/$100,000)
x = €100,000 / ₣90,00 * $100,000 / $137,500 = 0.803
You would need your EURUSD trade to be 80% of the size of the USDCHF trade.

What correlation is not

Correlation only provides insight into the probability of direction. It says absolutely nothing about the strength of a particular move. A few months ago the USDCHF climbed 1,000 points in value within a single day. The EURUSD only moved a few hundred pips. The USDCHF moved dramatically further than the EURUSD both in terms of pips, but more importantly, as a percentage of price.

Consider if you were short EURUSD that day and short USDCHF. You lost a ton of money. 反対側に, if you were long EURUSD and long USDCHF, then you got lucky and earned the move. Regardless of what happened, correlation told you nothing about the outcome when they move in the same direction. For that reason, I prefer looking at a less intuitive method called cointegration.

共和分

Conintegration turns the problem on its head. Rather than asking whether or not two pairs move in the same direction, it asks how likely are they to remain a certain distance apart. 当然のことながら, that distance tends to vary with time. What you want the cointegration formula to tell you is how likely two pairs are to come back to a standard distance. If you see two pairs spread unusually far apart and the numbers tell you that they usually come back together, then it makes sense to consider a pair trade.

Ernest Chan has a friendly introduction to cointegration that I highly recommend. A much uglier, math intensive introduction to the subject, albeit one that is also far more thorough, is in the book Pairs Trading by Ganapathy Vidyamurthy.

以下の下でファイルさ: 外国為替市場のしくみ?, 未分類 タグが付いて: 共和分, 相関関係, 外国為替

メタト レーダー間の変換の問題 4 MT5

6 月 14, 2011 によって Chris ジマー 4 コメント

私は最近、プロジェクトを完了します。 変換後のコードを書いたメタト レーダーから 4 MT5 に. このポストは 2 つの言語間で前後の移動の難しさにいくつかの洞察力を提供する必要があります。.

1) MT5 オブジェクトについての学習; そのメソッドとメンバー

MT5 は MT4 からかなり違う. MT5 と比較してください。, MT4 は、むしろ古風な非オブジェクト指向の C’ プログラミング言語で、限られたのようなステートメントの設定します。. MT5 は、オブジェクト指向言語部分を追加します。. オブジェクトだけでなく, メソッド, メンバー, MT5 はまた様々 な構造を追加します。, 列挙型とその他の構造. このため私は MT4 の EA になるものを達成するために MT5 の方法を見つけなければならなかった. つまり、言語のドキュメントを読んでかなりの時間, ロジックの問題がトリミングされた構文に関連していない場合、ニュースレターの例、フォーラムの議論を熟読, コーディング, デバッグ. 特にトラブルの 1 つの領域は、アレイ内で過去のデータが返される方法です。.

2) MT5 を組み合わせた複数の取引は 1 つの貿易に.

複合取引同じストップロスを使用し、利益を取る場合、これはあまり問題ではないです。. しかし, この特定の EA で, 異なる使用同じ貿易信号上に配置 2 つの取引は、利益を取る. これは最初の貿易パラメーターと監視時のストレージを必要な入札か部分的なすぐ今の貿易を組み合わせて決定.

3) 、 戦略テスター 複数の通貨ペアをアクセスする EA の仕事をしていた; インジケーター ハンドルの作成.

この特定の EA を MT4 から MT5 に変換する主な理由は MT5 戦略テスターの活用、, 可能 backtests 複数の通貨ペアで. 初期構成で EA は、すべてのチェック作業し、アクセスし、多くの指標をテストする最も有利なペアを見つける様々 な通貨ペアをテストします。 (通貨ペア、チャート期間をに基づいてください。) 選択した通貨ペアの.

試行錯誤しながら古いインジケーター ハンドルの取り外しと新しいインジケーターの作成がすべての目盛り税金メモリと EA がこれらのリソースを使い果たすだろうポイントに CPU リソースを処理することがわかった。. これらのリソースの需要を減らすための様々 な調整を試みた後, 外部ソースからのアイデアを見えるようになり (メタト レーダー フォーラムや様々 なブログから). しようとするいくつかのアプローチのことを決めたいくつかのフォーラムやサポート チケットの交換の後, 再試行ループおよび必要なデータの存在をテストするメソッド呼び出しの使用を含む. これは程度にだけ働いた (通貨ペア数が減少).

最後に EA の初期化の部分ですべてのインジケーター ハンドルを事前に決定する前に、いくつかの他の方法を試してみました. 期間使用されるたびに、各通貨ペアと各通貨ペアの異なるインジケーター ハンドルを割り当てるならなかった. 実際戦略テストでこれは EA の初期ロード時間を長く大きくがだけ拡張性の高いソリューション.

4) 履歴データを取得いくつかの手動セットアップが必要です。.

1 つの最善の解決策の発見を一部遅延問題 3 (上記) 様々 な通貨ペアの過去のデータだった戦略テスターにアクセスしていたクライアント端末上に存在しないということです。. インジケーターのデータの読み込みに関係するエラーの多くはデータのこの不足のためされ試みられている他のソリューションとは無関係だった. プログラムでこのデータを要求するよりエレガントな方法がある気がしながら, 私はどのようにこれは、まだ時に来ていません。.

私は手動で各通貨ペアのチャートを読み込んでをしまった, グラフの自動スクロールをオフ, テスト中の時間の期間にわたって再度間隔. 各通貨ペアのチャートをロードする持っていただけではなく, グラフの期間を変更しなければならなかった、 4 または 5 さまざまな指標によって使用された別の期間. 私はそのインジケーターをチャートに追加することも. この方法でテストの戦略で必要な履歴データの読み込みを強制することができました. 私いないテストされていた小さなウィンドウ内でこれは非常に煩わしい作業をなるかもしれない時間の最近の時代に.

以下の下でファイルさ: メタト レーダーのヒント, MQL (オタクのため), 未分類

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

トレンド分析

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

アーカイブ

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

翻訳


無料の取引戦略

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

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