GGUF
conversational

license: apache-2.0 tags: - mql5 - metatrader - algorithmic-trading - xgboost - finance - quant - unsloth - code datasets: - custom-mql5-documentation-and-ml base_model: google/granite-3.0-3b-a800m-instruct # Ajuste se o modelo base exato for ligeiramente diferente pipeline_tag: text-generation

Granite-Claude-Fable-3B-MQL5-Quant

This is a fine-tuned version of the 3B parameter model, specifically optimized for modern MQL5 programming and Machine Learning integration (XGBoost, CatBoost, Random Forest) inside MetaTrader 5 Expert Advisors (EAs).

Most base models struggle with MQL5, often mixing it with outdated MQL4 syntax or pure C++. This model was trained on official documentation (with a strong focus on OOP/Classes) and high-complexity quantitative templates to ensure syntactic accuracy and robust architecture.

Key Enhancements

  • True MQL5 Syntax: Uses modern native libraries (<Trade/Trade.mqh>) instead of obsolete MQL4 functions (OrderSend, OrderSelect).
  • ML Integration: Tailored to structure data pipelines connecting Python ML scripts with MQL5 environments via DLLs or file handling.
  • Object-Oriented Programming: Deep understanding of MQL5 Classes, inheritance, and Standard Library components.
  • Lightweight Efficiency: At only 3B parameters, it runs extremely fast locally on consumer hardware (LM Studio, Ollama).

Performance Showdown (Base Model vs. This Fine-Tuned Model)

Prompt Tested

"Escreva a estrutura de um Expert Advisor (EA) em MQL5 que importa e consome as predições de um modelo XGBoost (salvo em formato arquivo ou consumido via DLL). Mostre a função OnTick() chamando o modelo para decidir uma compra ou venda"

🛑 Standard Base Models (Common Failure)

Standard models usually hallucinate a broken hybrid code that looks like this:

// BROKEN MQL4/MQL5 HYBRID - WILL NOT COMPILE
void OnTick() {
    double prediction = xgboostModel.Predict(1.0);
    if(prediction > 0.5) {
        int ticket = OrderSend(Symbol(), OP_BUY, 1, Ask, 2, 0, 0...); // ❌ MQL4 legacy code!
    }
}

✅ This Fine-Tuned Model (Correct Native MQL5)

Our model outputs structured, native MQL5 leveraging OOP and proper file/DLL bindings:

#property indicator_chart_window
#include <Trade/Trade.mqh>
#include <XGBoost.dll> // Correct DLL binding

CTrade trade;
CFile file;
double prediction;

void OnTick() {
    if (!file.Read("prediction.txt", prediction)) return;
    
    if (prediction > 0) {
        trade.SendOrder(ORDER_TYPE_BUY, 1, 100, 100, 0, "EURUSD", MAGIC_NUMBER); //  Correct MQL5 Trade
    }
}

How to Use Locally (LM Studio / GGUF)

  1. Download the Q4_K_M GGUF version of this model.
  2. Load it into LM Studio.
  3. Set your system prompt to prime the model for coding:
    You are an expert quantitative developer specializing in MetaTrader 5 and MQL5. Always write native MQL5 code using modern libraries and object-oriented programming.
    

Training Details

  • Framework: Trained using Unsloth for fast and stable LoRA fine-tuning.
  • Dataset: Curated high-complexity MQL5 source codes, official MQL5 documentation (OOP chapters), and quantitative Python scripts (XGBoost/CatBoost pipeline helpers).
  • Status: Converged successfully with stable gradient norms and balanced validation loss.
Downloads last month
-
GGUF
Model size
3B params
Architecture
granite
Hardware compatibility
Log In to add your hardware

4-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support