Opportunity Cost Ticker
A strategy tester equity curve only ever shows trades that were taken. It says nothing about the signals a trader hesitated on, or the ones an EA's filters rejected - the actual cost of second-guessing a system is invisible in every normal report. Opportunity Cost Ticker makes it visible by running a plain, well-known fast/slow SMA crossover on the chart's own symbol as a fixed, reproducible trigger, then for each crossover checking the order history (both open and closed orders) for a real trade opened on the same symbol, same direction, within a configurable time window. Crossovers with no matching trade are tracked forward for a fixed number of bars and shown in a scrolling ticker: direction, whether the outcome is still live or has frozen, and the running pip result had the signal actually been taken. The crossover is not presented as a recommendation - it exists purely so "skipped" has one fixed, auditable definition instead of being whatever the user remembers hesitating on. The matching logic (order pool scanned back to front, tickets never acted on, only read) is the reusable part: swap in any other signal source later and the same "was this actually traded, and if not what happened next" tracking applies unchanged. Notes and limitations Matching is by symbol, direction and open-time proximity only - it cannot prove a given real order was actually caused by this specific crossover signal rather than something else, only that a plausible trade exists nearby in time. On a very active account with frequent trades this can under-count skipped signals (a coincidental order suppresses a row that should have shown as skipped). The crossover itself is a simple, generic reference and carries no claim of edge - it is a fixed yardstick for "was this trigger acted on", not a trading recommendation.
Indicator · MT4 · v1.0 · Free
About Opportunity Cost Ticker
Opportunity Cost Ticker is an indicator for MetaTrader 4 based on Moving Average. It has 12 settings, such as Fast ma period, Slow ma period and Match window minutes. MQL source code included.
Files in the download: OpportunityCostTicker.mq4, OpportunityCostTicker.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Fast ma period | 10 | Fast SMA period |
| Slow ma period | 30 | Slow SMA period |
| Match window minutes | 30 | A real order opened within this many minutes of the signal, same direction, counts as "taken" |
| Track bars | 20 | Bars to track a skipped signal's outcome before freezing it |
| Max ticked | 8 | Rows shown in the ticker panel |
| Refresh seconds | 5 | Panel refresh interval |
| Corner | CORNER_LEFT_LOWER | Panel corner (ENUM_BASE_CORNER) |
| X offset | 12 | |
| Y offset | 12 | |
| Gain color | clrLimeGreen | Colour on the chart |
| Loss color | clrTomato | Colour on the chart |
| Header color | clrWhiteSmoke | Colour on the chart |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Indicators.
- Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
- Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the indicator from the Navigator onto a chart and adjust the settings.
Tags: Moving Average · Buy/Sell Arrows · MT4 Indicator · MQL4 Source Code