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

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

Too Many Charts

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

A million charts on the screen. It looks like a blob of every known currency pair with a mix of every time frame added for good measure. You, 私の友達, suffer a nightmare juggling the EA settings on all these charts.

The idea of running a single Expert Advisor that trades all charts and multiple time frames stands out as an obvious solution. It’s not a good one, しかし. The way that MetaTrader 4 is designed prevents this setup from working smoothly.

The start() function in MQL4

MQL4 Expert Advisors only run in one of three different ways. The init() function is called when you load the EA onto a chart. The deinit() function operates whenever you remove the EA. That leaves the start() 関数. It’s like the beating heart of all MQL4 programs.

Incoming ticks tell the chart to notify an attached expert advisor about the updated price. When that occurs, the expert advisor runs the start() 関数. That function contains all of the code that traders associate with expert advisors: placing trades, implementing trailing stops, など. All of those actions depend on incoming ticks.

、 organization of MQL4 creates a problem for the goal of creating an EA that places trades for all charts. Expert advisors only update when a tick comes in. If I wanted to trade the GBP/JPY from a chart attached to the EUR/USD, any delay in EUR/USD ticks causes a delay in executing GBP/JPY trades.

This probably does not seem like a big deal. It isn’t a big deal – ほとんどの時間. It can, しかし, create a nagging problem of wondering why a noticeable percentage of trades seem to execute late. Traders on one minute charts would even notice missed signals. Although it’s not frequent, even the major pairs often go longer than one minute in between ticks.

Work-arounds

One idea to reduce the number of open charts while ignoring the incoming tick problem is to create an EA that trades on 複数の時間枠 for the currency pair where it’s attached. If I wanted to trade the AUDCAD on M30, H1, H4 and D1 charts, then I could place the EA on one of the those charts but have it look for trades on the selected time frames. This type of solution could decrease the number of open charts by 75% 以上.

The idea of controlling everything from a single chart is very similar to the market scanning indicator that we created several months ago. There is really no difference between that indicator and the expert advisor proposed here. I feel that missing an indicator signal is of far less consequence than missing trade signals. Expert advisors are more likely to perform extra, ongoing operations like trailing stops that indicators completely ignore. The consequence of delayed ticks is far less significant for an indicator than it is for an EA.

以下の下でファイルさ: メタト レーダーのヒント タグが付いて: EA, 専門家アドバイザー, インジケーター, メタト レーダー, mql, multiple time frame, scanner, スタート

MQL 組織

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

すべての MQL エキスパートアドバイザーと指標のいくつかの重要なコンポーネントが含まれて. The general organization of MQL programs does not vary too often.

Files usually start with a declaration of #defines (pronounced pound define) global variables and external variables, also known as an extern data type. They appear near the top of the code to help the read gain an understanding of the variables that will run in the program. 理想的には, the names of the variables and how they are organized should assist the programmer with form a general understanding of what the expert advisor or indicator might do.

The next section is usually the init() 関数, which is the word initialize abbreviated. This section of the code is particularly relevant to programming custom indicators. Most of the general indicator settings like declaring the indicator buffers, the colors to use and other basic features are set within this section. I use init() in every expert advisor that we build to convert the inputs into an appropriate setting for the broker’s pricing. If a client inputs a stop loss of 50 into an EA, I don’t need to do anything if it’s a 4 digit broker. I do, しかし, need to convert the input to work with a 5 digit broker. I run a quick check within init() to see if Digits == 3 || Digits == 5. もしそうなら, then I multiply inputs affected by that setting by 10.

deinit() is the least important section; it’s pretty easy to deinitialize an MQL file because it usually does not take up any system resources. It’s rarely used for anything important. The only uses that I ever have for deinit() are to close an open file handle or to make some sort of closing note. This is often done either on the chart directly through the Comment() function or more often by writing directly into the ログ ファイル.

The start() function is the real meat of an MQL expert advisor or indicator. Whenever MetaTrader detects an incoming tick, it alerts any MQL programs. Those programs then call the start function so that it can do whatever needs doing. All trading operations, calculations, account monitoring, など, occur within this section.

All of the other custom functions within the program appear below start(). I usually prefer to rank them in order of their importance or the frequency with which I call them throughout the program. The order of placement of functions does not affect performance in any way at all. It’s strictly a cosmetic practice that makes programming code more legible.

以下の下でファイルさ: MQL (オタクのため) タグが付いて: deinit, 専門家アドバイザー, インジケーター, init, mql, MQL4, スタート

メールで無料の取引戦略

トレンド分析

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

アーカイブ

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

翻訳


無料の取引戦略

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

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