개요
이 지표는 표준 스토캐스틱 오실레이터를 기반으로 매수 및 매도 신호를 제공합니다. 특히 과매수 및 과매도 구역 내에서 발생하는 교차 현상을 모니터링하여 잠재적인 반전 지점을 식별하도록 설계되었습니다.
작동 원리 (핵심 논리) 이 지표는 스토캐스틱 선(K선과 D선)을 분석하고, 엄격한 구간 조건을 바탕으로 교차 신호의 유효성을 검증합니다:
매수 신호 (파란색 화살표): 이전 K선 또는 D선이 과매도 수준(기본값 20) 이하에 위치했을 때, 이어서 K선이 D선을 위로 교차하면 발생합니다.
매도 신호 (빨간색 화살표): 이전 K선 또는 D선이 과매수 수준(기본값 80) 이상에 위치했을 때, 이어서 K선이 D선 아래로 교차할 때 발생합니다.
신호 필터: 이 지표는 교대 논리(연속 신호 방지 메커니즘)를 사용합니다. 지속적인 추세 중 불필요한 화살표가 표시되는 것을 방지하기 위해, 한 방향당 연속적으로 하나의 신호만 출력합니다(즉, 매수 신호 뒤에는 매도 신호가, 그 반대의 경우도 마찬가지).
실행: 모든 신호와 알림은 종가 봉을 기준으로 엄격하게 처리됩니다. 이를 통해 실시간 가격 변동 중 지표가 재그리기되거나 깜빡이는 현상이 발생하지 않습니다.
입력 매개변수
스토캐스틱 설정: K 기간, D 기간, 슬로잉, MA 방법 및 가격 필드를 포함한 오실레이터의 표준 매개변수입니다.
반전 경계: 과매도(기본값 20.0) 및 과매수(기본값 80.0) 구간의 조정 가능한 수준입니다.
알림 설정: 팝업 알림을 활성화하거나 비활성화하는 옵션입니다. 알림은 캔들 마감 시 신호당 한 번씩 트리거됩니다.
사용 참고 사항 이 도구는 모멘텀 반전 도구이므로, 단독 전략으로만 의존하기보다는 더 높은 시간대의 추세 필터, 이동평균, 지지/저항선과 같은 다른 기술적 분석 방법과 함께 사용하는 것이 권장됩니다.
MetaQuotes Ltd에서 영어로 번역함.
원본 코드: https://www.mql5.com/en/code/75859
Safe Logger: why your log lines vanish while FileOpen keeps returning success
Four EAs writing to the same file, all with FILE_SHARE_READ|FILE_SHARE_WRITE, FileSeek(SEEK_END), FileWrite, FileClose. Looks correct. Every FileOpen returns success. No error in the log. And the lines vanish. Reason: FILE_SHARE_WRITE lets all four open at the same time. All four call FileSeek(SEEK_END) and get THE SAME offset, because none has written yet. All four write at the same position. Whoever closes last wins. Three lines vanish silently. In my case: 12 events expected, 8 in the file. The fix is to open EXCLUSIVELY (no FILE_SHARE_WRITE) and retry while another EA holds the file. And to shout in the log when the retries run out: a log that fails silently is worse than no log at all, because you trust it. The demo script reproduces both modes. To see the loss, drag it onto four charts at the same time with safe mode off and count the lines in the CSV. On a single chart the defect does not show up - which is why it passes in testing and breaks in production.
Clock Diagnostic: TimeCurrent() freezes and steps backwards
TimeCurrent() is not a clock. It is the stamp of the LAST TICK. Two consequences break robots in production: 1. It freezes. With no tick it does not move: illiquid instrument, end of session, unstable connection - and any rule based on it stops with it. 2. It steps backwards: on a symbol switch, a reconnection or a tick from another instrument, the value can go back. The case that cost me a whole protection: I compared the date of a daily decision with TimeCurrent() to reject an expired one. The server clock stepped back to the previous day, the comparison matched, and four EAs accepted YESTERDAY's decision as valid. The gate that should have failed closed failed open - without a single error in the log. Rule: TimeLocal() for timestamps, dates, day changes, expiry - all that must always move forward; TimeCurrent() for session hours and market data. The script measures the divergence in your environment and reports both symptoms live. Run it with the market closed.
MT5 브로커 정보 추출하기
이 MT5용 EA는 거래를 실행하지 않고, 브로커 및 거래 환경의 기술적 사양을 수집하여 표시하는 진단 도구입니다. 코드는 4가지 주요 블록으로 구성되어 있습니다: 데이터 수집 (CollectAll): 계좌 정보(레버리지, 통화), 종목 정보(소수점 자리, 스프레드, 스왑, 거래량, 스탑 레벨), 지연 시간(핑), 시간대(서버-UTC 시차)를 추출합니다. 실제 통화로 스왑을 계산합니다. 샘플링(OnTick): 스프레드 통계(최소, 평균, 최대)를 실시간으로 업데이트합니다. 출력: 데이터를 “전문가” 로그에 기록하고, CSV 파일로 저장하며, 차트의 그래픽 패널(UpdatePanel)에 표시합니다. 헬퍼: CalcSwapInCurrency 및 다양한 *ToStr 함수는 브로커의 원시 수치 데이터를 가독성 있는 문자열로 변환합니다.
Trend Execution Planner - Regime and Risk Panel
현재 추세 상황을 평가하고 브로커별 표준화된 매수 및 매도 리스크 계획을 수립해 주는 무료 오픈소스 MT5 읽기 전용 차트 유틸리티입니다. 이 유틸리티는 이동평균의 방향과 기울기, ADX, 효율성 지수, ATR, 스프레드, 계좌 통화 및 종목 정보를 활용합니다. 이 유틸리티는 절대로 포지션을 개설, 수정 또는 청산하지 않습니다.