High Low Close MT4
- Göstergeler
- Mariusz Franciszek Szczepanczyk
- Sürüm: 1.0
- Etkinleştirmeler: 5
High Low Close Open MT4 Indicator displays High, Low, and either Previous Close or Current Open levels from a selected timeframe as horizontal lines and historical segments on the chart. It works seamlessly on both netting and hedging account types in MetaTrader 4 platforms. All levels update dynamically via timer and chart events for real-time accuracy.
Key Features
- Current Period Lines: Draws infinite horizontal lines for the High, Low, and static level (Previous Close or Current Open by user choice) of the selected timeframe's current bar.
- Historical Segments: Shows High, Low, static, and optional Open levels for 1-5 previous periods as time-limited segments (up to InpBarsBack setting).
- Optional Open Line: Toggle display of current and historical Open levels.
- Labels: Customizable right-aligned labels (HIGH, LOW, CLOSE/OPEN) positioned vertically according to price levels.
- Visual Customization: Independent color, style (dot/solid), and width settings for each line type; labels use font, size, and color inputs.
How It Works
Drawing Logic (DrawAll()): Fetches OHLC data using iHigh/iLow/iOpen/iClose for current and historical bars on InpTimeframe. Current levels use infinite OBJ_HLINE; historical use finite OBJ_TREND segments spanning bar times. Static level dynamically labels as "CLOSE" or "OPEN". Labels calculate Y-position based on chart height and price scale for precise alignment. Objects are non-selectable, properly layered (back/front), and cleaned up beyond 5 periods.
Event Handling: OnInit(): Starts 1-second timer, draws initial lines. OnCalculate/OnTimer/OnChartEvent: Redraws on ticks, time, or chart changes (e.g., zoom/scroll). OnDeinit(): Kills timer, deletes all prefixed objects (HLPC_).
Error Handling: Skips invalid data (e.g., zero values); limits barsBack to prevent excess history.
Usage Notes
Ideal for session-based trading (e.g., daily High/Low breaks on lower timeframes). Compatible with netting (single position per symbol) and hedging (multiple positions) modes—no order-specific logic. Lines persist across timeframe changes but update only on redraw events. For performance, timer ensures responsiveness without buffer plots (indicator_plots 0).
InpTimeframe – sets the timeframe for High, Low, Close/Open levels (default PERIOD_D1).
InpBarsBack – sets number of historical periods to display (default 1, clamped 1-5).
InpStaticIsPrevClose – true uses Previous Close as static level, false uses Current Open (default true).
InpHighColor – sets color for High lines (default clrLime).
InpHighStyle – sets line style for High lines (default STYLE_DOT).
InpHighWidth – sets line width for High lines (default 1).
InpLowColor – sets color for Low lines (default clrCrimson).
InpLowStyle – sets line style for Low lines (default STYLE_DOT).
InpLowWidth – sets line width for Low lines (default 1).
InpStaticColor – sets color for Static level lines (default clrGold).
InpStaticStyle – sets line style for Static level lines (default STYLE_DOT).
InpStaticWidth – sets line width for Static level lines (default 1).
InpShowOpen – enables/disables display of Open price lines (default false).
InpOpenColor – sets color for Open lines (default clrDodgerBlue).
InpOpenStyle – sets line style for Open lines (default STYLE_DOT).
InpOpenWidth – sets line width for Open lines (default 1).
InpShowLabels – enables/disables price level labels (default true).
InpLabelColor – sets color for labels (default clrWhite).
InpLabelSize – sets font size for labels (default 8).
InpLabelFont – sets font family for labels (default "Arial").
