MQL4

1 program Added 2026-02-07T13:22:10Z Agent: claude-codeModel: sonnetWebSearch: disabled Evidence Report issue View issues
Aliases: MetaQuotes Language 4
Provenance: commit 83fcecdb40 · authored 2026-02-07T14:23:05+01:00 · agent claude-code · model sonnet

Sources mentioning this language

4 sources · pl_id: pl/mql4
LLM (this repo) · 1LinguistPygmentsHyperpolyglot

Extensions claimed by this language

5 claims. Each row is one upstream assertion with its strength. SWH column shows file occurrences with that extension across the entire archive.
ExtensionSourceStrengthSWH
.mq4linguistprimary71.6K files
.mq4pygmentsprimary71.6K files
.mq5pygmentssecondary27.2K files
.mqhlinguistsecondary80.6K files
.mqhpygmentssecondary80.6K files

Related languages

MQL (0.74)MQL5 (0.65)ML (0.35)Metal (0.27)Metal Shading Language (0.27)

LLM-contributed programs

Simple Moving Average Expert Advisor

Provenance: commit 83fcecdb40 · authored 2026-02-07T14:23:05+01:00 · agent claude-code · model sonnet · WebSearch disabled
code.mq4 · added: 2026-02-07T13:22:10Z
//+------------------------------------------------------------------+
//|                                                  SimpleMA.mq4    |
//|                        Copyright 2024, MetaQuotes Software Corp. |
//|                                       https://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright 2024, MetaQuotes Software Corp."
#property link      "https://www.metaquotes.net"
#property version   "1.00"
#property strict

// Input parameters
input int MA_Period = 14;          // Moving Average period
input int MA_Shift = 0;             // Moving Average shift
input ENUM_MA_METHOD MA_Method = MODE_SMA;  // Moving Average method

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
   Print("Simple MA Expert Advisor initialized");
   return(INIT_SUCCEEDED);
  }

//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
   Print("Simple MA Expert Advisor deinitialized");
  }

//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
   double ma = iMA(NULL, 0, MA_Period, MA_Shift, MA_Method, PRICE_CLOSE, 0);
   double currentPrice = Close[0];

   if(currentPrice > ma)
     {
      Comment("Price is above MA(", MA_Period, "): ", DoubleToStr(ma, Digits));
     }
   else
     {
      Comment("Price is below MA(", MA_Period, "): ", DoubleToStr(ma, Digits));
     }
  }
//+------------------------------------------------------------------+

Real programs from Software Heritage

No SWH evidence indexed yet for this language. (Either the SWH mining hasn't reached this language's extensions, or no matching files exist in the archive.)

Contribute — propose a file extension

Tell us where to find evidence about MQL4 (mapped to pl/mql4). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/MQL4/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← MQL MQL5 →