당사 팬 페이지에 가입하십시오
- 조회수:
- 17
- 평가:
- 게시됨:
- 2025.05.20 11:38
-
이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동
CTsLogger는 MQL5에서 트레이딩 시스템을 생성하고 디버깅하기 위해 특별히 설계된 간단하고 유연한 로깅 시스템입니다. CTsLogger의 가장 큰 장점은 낮은 전역 로깅 수준을 유지하면서 특정 모듈 또는 코드 섹션에 대해 일시적으로 디버깅 모드를 활성화할 수 있다는 것입니다. 따라서 메시지 흐름에 "익사"하지 않고 특정 코드 섹션에 대한 자세한 로깅을 얻은 다음 하나의 명령으로 비활성화할 수 있습니다(
).
CTsLogger는 세부 사항의 오름차순에 따라 4단계 로깅을 지원합니다:
1. 로그_레벨_오류 - 오류 전용
2. LOG_LEVEL_WARNING - 경고 및 오류
3. LOG_LEVEL_INFO - 정보 메시지, 경고 및 오류
4. LOG_LEVEL_DEBUG - 디버그 메시지, 정보 메시지, 경고 및 오류
CTsLogger는 점으로 구분된 계층적 모듈 식별자를 지원하므로 모듈을 논리적 구조로 구성할 수 있습니다. 계층 구조는 중첩 깊이에 관계없이 사용할 수 있습니다.
전체 API
생성 및 초기화
- `CTsLogger()` - 생성자
- `~CTsLogger()` - 소멸자
- `Initialize(string logFileName, bool logToTerminal = true)` - 로거 초기화
- SetGlobalLogLevel(ENUM_LOG_LEVEL level)` - 글로벌 로깅 수준 설정
로깅메서드
- 오류(문자열 moduleId, 문자열 메시지)` - 오류 로깅
- 경고(문자열 moduleId, 문자열 메시지)` - 경고 로깅
- Info(string moduleId, string message)` - 정보 메시지 로깅
- 디버그(문자열 moduleId, 문자열 메시지)` - 디버그 메시지 로깅
기본 디버그 모드 제어
- EnableDebugMode(string moduleId)` - 모듈에 대한 디버그 모드 활성화
- `DisableDebugMode(string moduleId)` - 모듈 및 모든 자식 모듈에 대한 디버그 모드 비활성화
- IsInDebugMode(string moduleId)` - 디버그 모드 활성화 여부 확인
- EnableDebugModeAll()` - 모든 모듈에 디버그 모드 활성화
- `DisableDebugModeAll()` - 모듈 설정 저장과 함께 전역 디버그 모드 비활성화
고급 디버그 모드 제어
- PauseDebugMode()` - 모든 모듈에 대한 디버그 모드 일시 중단
- ResumeDebugMode()` - 이전에 구성된 모듈에 대한 디버그 모드 재개
- IsDebugModePaused()` - 디버그 모드 일시 중지 여부 확인
- ResetDebugModules()` - 모든 디버그 모듈을 완전히 리셋합니다.
- HasChildDebugModules(문자열 부모 모듈)` - 자식 모듈이 디버그 모드에 있는지 확인합니다.
MetaQuotes Ltd에서 러시아어로 번역함.
원본 코드: https://www.mql5.com/ru/code/58105

특정 모듈 또는 코드 섹션을 기록하는 기능이 있는 로거

캔들 서명 예시 | 연구 및 개발용

Butterfly Strategy Expert Advisor This Expert Advisor (EA) implements the Butterfly harmonic trading pattern across multiple timeframes (M2 to D1) for automated forex trading. It detects bullish and bearish Butterfly patterns using pivot points and executes trades with customizable risk management and multiple take-profit levels.

The Auto SL TP by Risk Reward Ratio script is a simple yet powerful tool designed for MetaTrader 5 traders who want to streamline their risk management process. This script automates the process of setting Stop Loss (SL) and Take Profit (TP) levels for open positions based on a user-defined Risk:Reward ratio and Stop Loss in pips. Whether you're a beginner or an experienced trader, this script saves time and ensures consistent risk management.