# OrrnnScript (//@orrnn=1) vs MQL5: Complete Migration & Architecture Guide

- Canonical: https://rxm.orrnn.com/articles/orrnnscript-vs-mql5-migration-guide
- Author: Elena Vance | Updated: 2026-12-02T01:51:53.29203-08:00

> OrrnnScript (//@orrnn=1) replaces MQL5's imperative C++-like bar loops with deterministic Dec128 fixed-point execution inside RTX5's sandboxed OBC1 bytecode VM, eliminating broker-side rounding drift and compiling directly into Ed25519-signed .rx5 packages.

## Why Algorithmic Desks Migrate from MQL5 to OrrnnScript

Traditional MQL5 Expert Advisors depend on host-native `ex5` binaries and IEEE-754 floating-point arithmetic, creating subtle discrepancies between backtest and live broker execution. **OrrnnScript (`//@orrnn=1`)** compiles to a portable, deterministic **OBC1 bytecode** executed identically in the browser, desktop terminal, and RTX5 server.

## Syntax Comparison: Indicator Setup

```orrnn
//@orrnn=1
indicator("EMA Cross", overlay = true, max_bars_back = 500)
let fast = ta.ema(close, input.int(9, title = "Fast"))
let slow = ta.ema(close, input.int(21, title = "Slow"))
plot(fast, title = "Fast", color = color.info)
plot(slow, title = "Slow", color = color.warning)
```

## Key Architectural Differences

- **Capability Permissions**: Every `.rx5` package declares `place_orders`, `modify_orders`, `read_account`, and `gpu_compute` explicitly inside its CBOR manifest.
- **Fixed-Point Math (`Dec128`)**: Margin, swap, commission, and pip-value calculations match the Go broker engine bit-for-bit.
- **Multi-Fidelity Strategy Tester**: Supports `open_prices`, `ohlc_1m`, `every_tick_generated`, and `every_tick_real` plus WebGPU optimization.
