MQR Language

Create strategies with MQR.

Write entry, exit, filter and management rules in a language designed for trading workflows.

MQR programmer manual.

Complete language documentation with syntax, functions, orders, indicators, debugging and examples.

Resources to create, test and improve strategies.

MQR brings programming closer to the trader workflow, with market commands, indicators and test parameters.

Market data

Candles, volume, time, price and multi-timeframe reading.

Orders

Entry, exit, stops, limits and position tracking.

Indicators

Moving averages, RSI, ATR, CCI, MACD, Bollinger and other studies.

Debug

Inspect rules, variables and execution during development.

Parameters

Optimizable inputs to test different strategy settings.

MQL5 export

Take the strategy to the native MetaTrader 5 environment when needed.

A language close to the trader workflow.

The code describes entry, exit, filters and optimizable parameters directly.

example.mqr
input int AveragePeriod = 20;
input double Lot = 1;

void OnBarOpen()
{
  double average = EMA(AveragePeriod, 0);

  if (PositionsTotal() == 0 && Close(0) > average)
    Buy(Lot, Low(1), Close(0) + ATR(14, 0));

  if (PositionsTotal() > 0 && Close(0) < average)
    CloseAllPositions();
}