3-바 패턴:
첫 번째 캔들: 몸통이 큰 녹색(강세 스파이크).
두 번째 캔들: 빨간색(하락).
세 번째 캔들: 몸통이 큰 녹색(강세 스파이크).
이 패턴이 나타나면 영역이 생성됩니다.
3개의 캔들 고점/저점 범위에서 파란색 직사각형이 그려집니다.
중간(두 번째) 캔들의 시가에 라임 그린 수평 진입선이 그려집니다.
이 선은 가격이 회복될 때까지 미래로 확장됩니다.
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. 두 번째 캔들 - 약세 되돌림
3. 세 번째 캔들- 다시 강한 강세 스파이크
이것이 나타나면 그립니다:
- 패턴 주위의 박스
- 두 번째 캔들 오픈 시점의 수평선(진입점)
가격이 이 선으로 돌아오면("완화"), 이 선을 짧게 자르고 다시 그리지 않습니다.
struct PatternInfo { datetime time; // 패턴의 시간 double entry; // 진입가(두 번째 캔들 오픈) 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
DailyPivot Shift
DailyPivot_Shift 지표는 일반적인 DailyPivot 지표와 달리, 주요 수준이 하루의 시작 시간을 기준으로 오프셋을 적용하여 계산될 수 있다는 점이 다릅니다.
XCCX
평균화 알고리즘을 선택할 수 있고 과매도/과매수 수준이 동적으로 변경되는 상품 채널 지표.
CBitBuffer Class - Data Serialization in MQL5
버퍼에서 개별 비트 또는 비트 시퀀스를 읽고 쓰기 위한 클래스입니다.
ATR 채널
ATR Channels 지표는 ATR(Average True Range)을 고려하여 가격 변동 채널을 그립니다.