無料でロボットをダウンロードする方法を見る
Telegram上で私たちを見つけてください。
私たちのファンページに参加してください
興味深いスクリプト?
それではリンクにそれを投稿してください。-
他の人にそれを評価してもらいます
記事を気に入りましたか?MetaTrader 5ターミナルの中でそれを試してみてください。
ビュー:
16
評価:
(3)
パブリッシュ済み:
candel 2.mq5 (10.74 KB) ビュー
MQL5フリーランス このコードに基づいたロボットまたはインジケーターが必要なら、フリーランスでご注文ください フリーランスに移動

強気スパイクパターン検出

  • 3バーパターン

    • 1本目のローソク足: 緑色の大きなボディ(強気スパイク)。

    • 2本目のローソク足: 赤(プルバック)。

    • 3本目のローソク足: 大きなボディを持つ緑(強気スパイク)。

  • このパターンが現れると、ゾーンが形成される

ゾーンの作成

  • 3本のローソク足の高値・安値の範囲から青い長方形を 描く。

  • 真ん中(2本目)のローソク足の始値にライムグリーンの水平エントリーラインを 引く。

  • このラインは、価格が戻ってくるまで、はるか先まで伸びます。


インプットの説明

mq5
input color BoxColor = clrBlue;              // 3キャンドル・パターン・ボックスの色
input color EntryLineColor = clrLime;        // エントリーラインの色
input ENUM_LINE_STYLE EntryLineStyle = STYLE_SOLID; // エントリーラインのスタイル
input int BoxWidth = 2;                      // ボックスのボーダーの幅
input int EntryLineWidth = 2;                // エントリー行の幅
input int EntryLineLength = 200;             // 緩和ラインがどこまで伸びているか
```
These inputs let you fully control the style of the box and entry line.


コア・アイディア

3本のローソク足の強気パターンを探す。

1.最初のローソク足-強い強気(スパイク)

2.2本目のローソク足 - 弱気のリトレースメント

3.3番目のローソク足 - 再び強気スパイク


これが表示されたら、我々は描画します:

- パターンを囲むボックス

- 2本目のローソク足の始点に水平線を引く(エントリーポイント

価格がそのラインまで戻ったら(「緩和」)、ラインを短く切り、再描画を避ける。


データ構造

struct PatternInfo {
  datetime time;   // パターンの時間
  double entry;    // エントリー価格(ローソク足2本目の始値)
  double high;     // 3本のローソク足の最高値
  double low;      // 3本のローソク足の安値
  bool mitigated;  // 価格はエントリーレベルに戻ったか?
};

CArrayObj activePatterns;
```
We use a struct `PatternInfo` to track each valid pattern and store it in an array. This helps avoid repeated processing.

開始関数

int OnInit() {
  IndicatorSetInteger(INDICATOR_DIGITS, _Digits);
  ArrayInitialize(activePatterns, 0);
  return INIT_SUCCEEDED;
}
```
We set the indicator precision and prepare our array.


パターン検出(各ティック)

```mq5
for (int i = limit - 3; i >= 0; i--) {
```
We loop through candles and look 3 bars back.

```mq5
if (isBullish(i+2) && isBearish(i+1) && isBullish(i))
```
We check if the last 3 candles fit the spike pattern: Green-Red-Green.

```mq5
double high = MathMax(MathMax(High[i], High[i+1]), High[i+2]);
double low = MathMin(MathMin(Low[i], Low[i+1]), Low[i+2]);
double entry = Open[i+1];
```
We extract high/low for box and the entry level from the 2 nd (middle) candle.

```mq5
PatternInfo *pattern = new PatternInfo;
pattern.time = Time[i];
pattern.entry = entry;
pattern.high = high;
pattern.low = low;
pattern.mitigated = false;
```
Create and add this pattern to our list.
ボックスとラインの描画
```mq5
string boxName = "Box_" + IntegerToString(Time[i]);
ObjectCreate(0, boxName, OBJ_RECTANGLE, 0, Time[i+2], high, Time[i], low);
```
Draw the rectangle (box) from the 3-candle pattern.

```mq5
string lineName = "EntryLine_" + IntegerToString(Time[i]);
ObjectCreate(0, lineName, OBJ_TREND, 0, Time[i], entry, Time[i] + PeriodSeconds() * EntryLineLength, entry);
```
Draw the entry line from the 2 nd candle’s open forward in time.

緩和チェック(各ティック毎)

Loop through all patterns:
```mq5
for (int p = 0; p < activePatterns.Total(); p++) {
  PatternInfo *pt = (PatternInfo*)activePatterns.At(p);
```
If not already mitigated, check:
```mq5
if (!pt.mitigated && Low[0] <= pt.entry)
```
If current price hits the entry level:
```mq5
pt.mitigated = true;
ObjectDelete("EntryLine_" + IntegerToString(pt.time));
```
Delete original long line.

```mq5
ObjectCreate(0, "MitigatedLine_" + IntegerToString(pt.time), OBJ_TREND, 0,
pt.time, pt.entry,
Time[0], pt.entry);
```
Create a short line showing where mitigation happened.
HELPER FUNCTIONS

###  Check Bullish/Bearish:
```mq5
bool isBullish(int i) {
  return Close[i] > Open[i];
}

bool isBearish(int i) {
  return Close[i] < Open[i];
}

このインジケータはシンプルかつ強力です

  • ブームにおける実際のスパイク動作を検出
  • スマートマネーのエントリーを可視化
  • 自動的に緩和を検出

Boom 500またはBoom 1000でライブテストできます。


質問または共有したい場合は、コメントありがとうございます。


MetaQuotes Ltdによって英語から翻訳されました。
元のコード: https://www.mql5.com/en/code/61749

Moving Price Line Indicator MT5 Moving Price Line Indicator MT5

このシンプルなインジケーターは、価格がローソク足や時間枠の特定の時間に達したことを簡単に知るためのものです。

Creat Button Close BuySell On Chart Creat Button Close BuySell On Chart

MetaTrader5用のMQL5スクリプトで、現在のシンボルのすべての買いまたは売りポジションをクローズする2つのボタンを追加します。

CBitBuffer Class - Data Serialization in MQL5 CBitBuffer Class - Data Serialization in MQL5

個々のビットやビット列をバッファに読み書きするためのクラス。

Accelerator Oscillator (AC) Accelerator Oscillator (AC)

アクセルレーション/デセレレーションインジケーター(AC)は現在の市場を動かす力の加速と減速を測ります。