Re: MT4 Trading Utilities, Chart Tools & Add-ons

371
Fixed Chart Scale for MT5

Here's an MT5 version of the Fixed Chart Scale indicator. It was originally an MT4 indicator and I converted it to MT5. I don't know who made the original MT4 version. If you do, let me know and I'll add the name.

What it does: it keeps the chart scale fixed and fits it to the bars you can see on screen. Scroll or zoom and the scale adjusts, so candles never touch the edge of the window. It only redraws on chart events, so it doesn't add load on every tick.

Settings:
HeadMargin / TailMargin: free space above and below the visible range, as a % of the range. Default is 20 for both. HeadMargin goes on the side where price is leaning.
"Smart" Auto-Scroll: if you scroll back into history, auto-scroll turns off. It comes back on when you return to the latest bar.
ATR Range: uses the daily ATR(14) as a minimum range, so the chart doesn't zoom in too much when price is flat.

Install: put the .mq5 file in MQL5\Indicators, compile it in MetaEditor, and attach it to a chart. It doesn't draw anything. To go back to normal scaling, just remove it from the chart.

I only ported the code to MT5. The scaling logic is the same as the original. The original copyright line (MetaQuotes Software Corp., 2016) is still in the file header.

Hope someone finds it useful. Bug reports are welcome.