Fix MT5 Indicator “SyncCrosshair”: Multi-chart time-synced scroll/zoom (click-to-align same time)

MQL5 Indicadores

Tarea técnica

1) Background
I have a custom MT5 indicator: SyncCrosshair.mq5.
It already synchronizes a “crosshair” across multiple charts using Terminal Global Variables (broadcasting time/price).
However, the scroll/zoom synchronization is broken or unstable.

Goal:
Within the same layout / same sync group (charts can be different symbols and different timeframes),
when I interact with any one chart, all other charts should automatically move so they show the same time point
(or the same visible time position) — true time-linked navigation.

2) Current Issues (must be solved)
In the current code:
- On source chart: CHARTEVENT_CHART_CHANGE triggers BroadcastIfNeeded()
- On target chart: ApplyScrollSync() tries to sync via CHART_FIRST_VISIBLE_BAR

Real behavior:
- Not following scroll: dragging or zooming the source chart does not move other charts, or moves them incorrectly.
- Time misalignment: even when targets move, they do not reliably align to the same time point.
- Random “jump far back”: sometimes it jumps to very old history (e.g., 2014), which is clearly wrong.

3) Expected Correct Behavior (core requirements)

A. Click-to-align (MOST IMPORTANT)
When I click once on any chart (or move crosshair with mouse), I define a time t at that cursor position:
- All charts in the same sync group must auto-scroll so they can see the same time t.
- That time t must appear at the same horizontal screen position on every chart
  (e.g., 60% from the left, controlled by AnchorPosition).

B. Drag / Mouse wheel / Keyboard navigation sync
When I operate the “source chart”:
- drag/pan left-right
- mouse wheel zoom (changes visible bars)
- keyboard navigation (Home/End/PageUp/PageDown, etc.)

All “target charts” should sync to the same time window, or at minimum:
- keep the same anchor time aligned to the same AnchorPosition
- keep visible range as close as possible
  (different symbols/timeframes may not match bars exactly, but time alignment must be correct).

4) Constraints (please fix on top of this codebase)
- Communication must remain via Terminal Global Variables (existing g_key_* structure can be reused).
- Do NOT delete/recreate drawing objects frequently; reuse existing objects for the crosshair lines.
- Can add new input parameters if needed, but keep the architecture: OnChartEvent + OnTimer driven.
- Must support different symbols/timeframes:
  for times not exactly available on target chart, must use nearest-bar logic
  (iBarShift exact=false fallback, etc.).

5) Implementation notes (suggestions, not mandatory)
Currently the broadcast contains: t, price, left_time, right_time.
Potential root causes:
- Wrong interpretation of CHART_FIRST_VISIBLE_BAR direction / indexing.
- Converting left_time/right_time to bar shifts is too error-prone across different timeframes.
- CHART_FIRST_VISIBLE_BAR alone may be insufficient; may need:
  - CHART_VISIBLE_BARS
  - anchor_shift -> left_shift calculation
  - or ChartNavigate() if it is more stable
- A stronger “sync protocol” may be required:
  broadcast anchor_time + visible_bars (and/or scale info) so targets can derive their window reliably.

6) Acceptance Tests (delivery must pass)
1) Open 4 charts in the same sync group (different symbols + different timeframes), e.g.:
   EURUSD M15, XAUUSD H1, BTCUSD M5, USDJPY H4.
2) Click any historical point on the source chart (e.g. a day in 2020):
   - all other charts must scroll to show the same time point
   - that time must appear at the same horizontal position (AnchorPosition=60 -> 60% from left).
3) Drag/pan source chart far left into older history:
   - target charts must follow smoothly without drifting/misalignment and without random jumps.
4) Zoom with mouse wheel:
   - target charts should sync zoom / visible bars if possible
     OR at least maintain anchor_time alignment with similar visible range.
5) Must NOT have:
   - jumping to unrelated old history (e.g., 2014)
   - severe jitter / oscillation
   - infinite broadcast loop between charts

7) Materials Provided

- Full source code of SyncCrosshair.mq5 (posted in this thread).

8) Deliverables
- Fixed SyncCrosshair.mq5 source code (compilable).
- Short explanation of what was changed and why the new scroll-sync logic is stable.
- Ideally, a brief description of key parameters (AnchorPosition, SyncMode behavior, etc.).

Archivos adjuntos:

Han respondido

1
Desarrollador 1
Evaluación
(70)
Proyectos
99
52%
Arbitraje
24
21% / 54%
Caducado
8
8%
Trabaja
2
Desarrollador 2
Evaluación
(15)
Proyectos
18
6%
Arbitraje
8
38% / 38%
Caducado
2
11%
Trabajando
3
Desarrollador 3
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
4
Desarrollador 4
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
5
Desarrollador 5
Evaluación
(62)
Proyectos
76
54%
Arbitraje
2
0% / 50%
Caducado
1
1%
Trabaja
Ha publicado: 6 ejemplos
Solicitudes similares
Fixed alert mt4 40+ USD
I’m looking for an experienced developer to help fix and improve an alert system in a trading project. Tasks Review and fix existing alert logic Ensure alerts work perfectly with no lag or delay Organize and optimize scattered alert code Check for missing files and improve overall structure Suggest and implement necessary improvements Dashboard (Optional but Preferred) Create a dashboard displaying: Brand name
Fix and optimize an existing Bybit trading bot so the profit target closes and reopens trades continuously (accumulation cycle) , while the withdrawal threshold pauses the bot, converts funds, withdraws profit, resets accumulation, and resumes trading . Current issue: the bot stops after hitting profit , which must be corrected. Demo video required after completion
Mt5 alert fix 40+ USD
i have a indicator on mt5 im using it right now , you can see the performance attached Am using the Ma filter to avoid false signals I developed this indicator myself But the signals are delaying in alerting Check if you can perfect and if you Can you work on it let me know Let me know if there anything you can do to make it perfect without lagging or delaying
Mt4 indicator 40+ USD
hello great developer Can you develop an MT4 indicator non repaint with accuracy of at least 70% for binary options trading, 1 minutes expiry time frame. Specifically on Quotex Something like this, check attached files Don't forget I trade 1Minutes expiry time frame on binary options Quotex
An Expert Advisor (EA) robot that uses market movement-based indicators is an automated program designed for platforms like MetaTrader 4 or 5 (MT4/MT5) that monitors price fluctuations and triggers trades based on predefined technical rules. These robots, often used for trend following, scalping, or breakout strategies, analyze price action, moving averages, or volatility to automatically enter and exit trades
FPi 50 - 60 USD
The main things are the Tradovate bridge to fee bid ask price as shown in the diagram Breaking news ( Not just economic releases) on vertical lines ( not necessarily from Twitter) Entries based on candle stick pattern( consecutive candle, hammer, engulfing shooting star and inside bar) and failed entry count email alert. Bid ratio, strength indicator and csi with alert from here
I hope, dear developers, that you are doing well. Recently, I have been looking for an indicator dedicated to institutional trading (Smart Money Concept) , but I could not find a suitable one. And when such indicators do exist, they are usually provided only as executables, which makes them impossible to modify or customize. For this reason, I developed the entire concept myself, including: Real-time labeling of
i need an expert to help join 3 model i have in ninjatrader into one, kindly message me and i will be expecting from you and i need this work done in maximum of 4 days, so i need expert that can get it done
So, all I need is for a horizontal line to follow the tip of the top of the Fl1 line and tip of the bottom fl1 line. I need to be able to change colors to the line and change size. The actual Fl1 lines should not show on chart. Default color for both lines are RED. I'll need the source code to the indicator. This indicator is the beginning of a more complex i will need done to the horizontal line
Hi developers, I need someone to help me create a simple EA with my indicators and trading plan... I will give you all parameters and you help me create... 2 moving averages, one candle pattern

Información sobre el proyecto

Presupuesto
30+ USD

Cliente

(2)
Encargos realizados15
Número de arbitrajes0