OrrnnScript (//@orrnn=1) vs MQL5: Side-by-Side Quant Language Guide
Compare concise Pine-ergonomic time-series primitives, native order/risk blocks, and OBC1 packaging against imperative C++-style MQL5 boilerplate.
OrrnnScript (//@orrnn=1) — 6 lines
//@orrnn=1
algo("XAUUSD Fast EMA", overlay=true)
fast = ta.ema(close, 12)
slow = ta.ema(close, 34)
if ta.crossover(fast, slow)
order.buy(lots=0.25, sl=close - 8.5, tp=close + 14.0)
plot(fast, color=color.cyan)Equivalent MQL5 — Handle + CopyBuffer
#include <Trade\Trade.mqh>
CTrade trade;
int fastHandle, slowHandle;
int OnInit() {
fastHandle = iMA(_Symbol, _Period, 12, 0, MODE_EMA, PRICE_CLOSE);
slowHandle = iMA(_Symbol, _Period, 34, 0, MODE_EMA, PRICE_CLOSE);
return(INIT_SUCCEEDED);
}
void OnTick() {
double f[2], s[2];
CopyBuffer(fastHandle, 0, 0, 2, f);
CopyBuffer(slowHandle, 0, 0, 2, s);
if(f[1] <= s[1] && f[0] > s[0]) trade.Buy(0.25);
}Frequently Asked Questions
Deterministic ring buffers managed by the Orrnn VM guarantee bounds-checked historical series access without manual ArraySetAsSeries or CopyBuffer calls.
Yes. Switch between indicator(...), strategy(...), algo(...), and library(...) declarations while targeting the exact same OBC1 bytecode format.