Loading…

Animation Ticker

Moving a panel or updating a displayed number in one instant reads as a glitch, not a UI. Getting a smooth transition instead means tracking a start time, a duration, and an easing curve by hand for every value that needs to animate - tedious enough that most EAs just skip it and snap. This library centralises that bookkeeping: Start() records a from/to pair, a duration, and an easing function, Update() advances every running tween against GetTickCount() once per call, and GetValue() returns the current eased value for any caller (a panel's X position, a fading colour channel, an animated PnL counter) to read. Seven easing curves are included - linear, quad in/out/in-out, and cubic in/out/in-out - covering the common "ease out" (fast start, gentle stop, good for something arriving) and "ease in" (gentle start, fast finish, good for something leaving) feel most panel animations want, without pulling in a general animation-curve library. Tween slots come from a fixed 64-slot pool rather than a dynamic array that can grow without bound if a caller starts tweens faster than they finish. Start() simply returns -1 once the pool is full - a UI-driven utility like this realistically never needs more than a handful of concurrent transitions, and a hard cap is safer than silent unbounded growth. Notes and limitations - Fixed pool of 64 concurrent tweens (ANIM_MAX_TWEENS) - ample for a panel's worth of animated values, not meant for hundreds at once. - Timing is driven by GetTickCount(), a 32-bit millisecond counter that wraps roughly every 49 days; elapsed-time subtraction uses unsigned arithmetic specifically so a wrap mid-tween still computes correctly. - Update() must be called regularly (from OnTimer or OnTick) for GetValue() to advance - this library does not run its own timer. - No money is at risk. This library only computes numeric values; it never touches trading or chart objects itself.

Script · MT5 · v1.0 · Free

About Animation Ticker

Animation Ticker is a script for MetaTrader 5. MQL source code included.

Files in the download: AnimationTicker.mq5.mqh, AnimationTicker.txt, AnimationTickerDemo.ex5, AnimationTickerDemo.mq5.

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Scripts.
  3. Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
  4. Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the script onto a chart to run it once.

Download the PDF guide

Tags: MT5 Script · MQL5 Source Code

MQL4 & MQL5 scripts · PolyMaria