Voir comment télécharger gratuitement des robots de trading
Retrouvez-nous sur Facebook !
Rejoignez notre page de fans
Un script intéressant ?
Poster un lien vers celui-ci -
laisser les autres l'évaluer
Vous avez aimé le script ? Essayez-le dans le terminal MetaTrader 5
Indicateurs

TradingView Style Chart Drag and Zoom for MT5 - indicateur pour MetaTrader 5

Sandro Begashvili
Sandro Begashvili
Sandro Begashvili - développeur MQL5, MQL4, Python et Pine Script
Je développe des programmes de trading pour MetaTrader 4 et MetaTrader 5 : conseillers experts, indicateurs personnalisés et panneaux de trading graphiques. Décrivez votre idée et je la transforme en code fonctionnel et documenté.
Vues:
150
Note:
(3)
Publié:
MQL5 Freelance Besoin d'un robot ou d'un indicateur basé sur ce code ? Commandez-le sur Freelance Aller sur Freelance

TradingView-style chart navigation for MetaTrader 5

If you move between TradingView and MetaTrader 5, you know the feeling: in TradingView you grab the chart and move it anywhere, up, down, left or right. In MetaTrader 5 the chart only scrolls sideways, and the price scale keeps fitting itself to the candles, so you cannot simply pull the candles to where you want to look.

This indicator brings that free movement to MetaTrader 5. Attach it to a chart and the left mouse button behaves the way TradingView users expect.


What it does

  • Drag the candles in any direction. Left and right scrolls through bars, up and down moves the price range.
  • Drag the price scale up or down to stretch or compress the prices.
  • Drag the time axis left or right to zoom the bars out or in.
  • Shift + mouse wheel over the chart zooms the price around the cursor.
  • Mouse wheel over the price scale zooms the price around the middle of the chart.
  • Optional: the plain mouse wheel zooms bars instead of scrolling them.
  • AUTO button in the bottom-right corner, or a double-click on the price scale, returns to the normal auto-fit scale.
  • ON/OFF button next to AUTO. OFF gives you the normal MetaTrader chart back right away, with every setting as it was. ON switches the TradingView-style navigation on again.

The AUTO button is blue while auto-fit is on and grey after you have moved or stretched the prices.

Safe with your trades and drawings

  • It is an indicator, not an Expert Advisor, so it can run on the same chart as your EA.
  • It never opens, changes or closes trades.
  • When you grab an entry, Stop Loss or Take Profit line, the chart does not move, so you can still drag those levels as usual.
  • When a drawing object is selected, the chart does not move, so you can still move your trend lines and other objects.
  • Indicator subwindows scroll left and right only.
  • When you remove the indicator, every chart setting it changed is put back exactly as it was.

Inputs

Dragging

  • Drag candles up/down: turn vertical movement on or off.
  • Drag price scale to stretch/compress: on or off.
  • Drag time axis to zoom bars: on or off.
  • Don't pan when grabbing an order/SL/TP line: keeps trade levels draggable.
  • Trade-level grab tolerance (px): how close to a line counts as grabbing it.

Zoom

  • Plain mouse wheel: Native MT5 (scroll bars) or Zoom bars (TradingView style).
  • Shift+wheel / wheel on price scale zooms price: on or off.
  • Price-scale drag sensitivity (per px): higher value = faster stretching.
  • Price zoom per wheel notch: 0.10 means 10 percent per notch.
  • Time-axis drag px per zoom step: how far to drag for one zoom step.

Behaviour

  • Don't snap to latest bar on new ticks: switches off chart auto-scroll so the chart stays where you put it.
  • Show AUTO scale button: on or off.
  • Double-click time (ms): maximum time between the two clicks of a double-click.

How to use

  1. Copy the file to the MQL5\Indicators folder and compile it in MetaEditor (or restart MetaTrader).
  2. Drag TradingView_Chart_Navigation from the Navigator onto a chart.
  3. Use the mouse as described above. Remove the indicator to get the normal MetaTrader behaviour back.

How it works

MetaTrader's own left-button scrolling is switched off and the indicator reads the mouse itself through chart events. Horizontal movement is turned into whole-bar steps with ChartNavigate. For vertical movement and price zoom, the chart is switched to a fixed scale starting from exactly what is visible, so nothing jumps, and the fixed maximum and minimum are then moved or scaled. Time zoom uses the normal MetaTrader zoom levels.

The code is a single file with no includes, commented throughout, so it is also a useful example of working with mouse events, chart coordinates and chart properties in MQL5.

Notes

  • MetaTrader has six zoom levels for bars, so time zoom moves in steps rather than smoothly.
  • MQL5 cannot block MetaTrader's own mouse wheel action. If you choose "Zoom bars" for the plain wheel, MetaTrader may still scroll a little at the same time.
  • Use one copy of the indicator per chart.
London Breakout: Asian Range Box London Breakout: Asian Range Box

Plots the range of the Asian session and marks breakouts during the London session with arrows, stop and target levels, and alerts

Tick Scalper Pro - tick chart and one-click trading panel for MetaTrader 5 Tick Scalper Pro - tick chart and one-click trading panel for MetaTrader 5

Tick Scalper Helper is a manual trading utility for traders who work on very short time frames and want to see every price change.

Prop News Countdown - news window timer for prop firm accounts Prop News Countdown - news window timer for prop firm accounts

Countdown to the next high-impact news from the MT5 economic calendar, with a red NEWS WINDOW warning for prop-firm news rules. Display and alerts only - it never trades.

VrDz Bot Scalp and Swing EA with Always ON Secure Layer Pro Panel VrDz Bot Scalp and Swing EA with Always ON Secure Layer Pro Panel

Lightweight Expert Advisor combining Scalp & Swing logic with an "Always-ON" position-securing layer. Includes a fully interactive on-chart panel with manual trade buttons, risk- based lot sizing, partial close, break-even, trailing stop, swing SL/TP switching, and a one-click "Secure All" tool.