Codes

How to Disable/Enable Auto/Algo-Trading in both MT5 and MT4. for MetaTrader 4

Just simple codes to Disable/Enable Auto/Algo-Trading in both MT5 and MT4. Of course, DLLs must be allowed, This cannot be done without DLLs

BreakEven Function for MetaTrader 4

Just a Basic Functions For BreakEven

Trailing Step Function for MetaTrader 4

This Is Just A Normal Trailing Step Function

Trailing Function for MetaTrader 4

This Is a Normal Trailing Function For All Open Order In MT4

Get Comma Separated Things From String for MetaTrader 4

Custom Function To Get Comma Separated Things From String

Get Last Round Time And Date Acc To TF for MetaTrader 4

This Custom Function Will Help To Get Round Time For Any Given Timeframe And Time

Articles

Custom Debugging and Profiling Tools for MQL5 Development (Part I): Advanced Logging for MetaTrader 5

Learn how to implement a powerful custom logging framework for MQL5 that goes beyond simple Print() statements by supporting severity levels, multiple output handlers, and automated file rotation—all configurable on‐the‐fly. Integrate the singleton CLogger with ConsoleLogHandler and FileLogHandler

Building a Custom Market Regime Detection System in MQL5 (Part 2): Expert Advisor for MetaTrader 5

This article details building an adaptive Expert Advisor (MarketRegimeEA) using the regime detector from Part 1. It automatically switches trading strategies and risk parameters for trending, ranging, or volatile markets. Practical optimization, transition handling, and a multi-timeframe indicator

Building a Custom Market Regime Detection System in MQL5 (Part 1): Indicator for MetaTrader 5

This article details creating an MQL5 Market Regime Detection System using statistical methods like autocorrelation and volatility. It provides code for classes to classify trending, ranging, and volatile conditions and a custom indicator

Advanced Memory Management and Optimization Techniques in MQL5 for MetaTrader 5

Discover practical techniques to optimize memory usage in MQL5 trading systems. Learn to build efficient, stable, and fast-performing Expert Advisors and indicators. We’ll explore how memory really works in MQL5, the common traps that slow your systems down or cause them to fail, and — most

Mastering JSON: Create Your Own JSON Reader from Scratch in MQL5 for MetaTrader 5

Experience a step-by-step guide on creating a custom JSON parser in MQL5, complete with object and array handling, error checking, and serialization. Gain practical insights into bridging your trading logic and structured data with this flexible solution for handling JSON in MetaTrader 5

Mastering File Operations in MQL5: From Basic I/O to Building a Custom CSV Reader for MetaTrader 5

This article focuses on essential MQL5 file-handling techniques, spanning trade logs, CSV processing, and external data integration. It offers both conceptual understanding and hands-on coding guidance. Readers will learn to build a custom CSV importer class step-by-step, gaining practical skills

Modified Grid-Hedge EA in MQL5 (Part IV): Optimizing Simple Grid Strategy (I) for MetaTrader 5

In this fourth part, we revisit the Simple Hedge and Simple Grid Expert Advisors (EAs) developed earlier. Our focus shifts to refining the Simple Grid EA through mathematical analysis and a brute force approach, aiming for optimal strategy usage. This article delves deep into the mathematical

Modified Grid-Hedge EA in MQL5 (Part III): Optimizing Simple Hedge Strategy (I) for MetaTrader 5

In this third part, we revisit the Simple Hedge and Simple Grid Expert Advisors (EAs) developed earlier. Our focus shifts to refining the Simple Hedge EA through mathematical analysis and a brute force approach, aiming for optimal strategy usage. This article delves deep into the mathematical

Modified Grid-Hedge EA in MQL5 (Part II): Making a Simple Grid EA for MetaTrader 5

In this article, we explored the classic grid strategy, detailing its automation using an Expert Advisor in MQL5 and analyzing initial backtest results. We highlighted the strategy's need for high holding capacity and outlined plans for optimizing key parameters like distance, takeProfit, and lot

Modified Grid-Hedge EA in MQL5 (Part I): Making a Simple Hedge EA for MetaTrader 5

We will be creating a simple hedge EA as a base for our more advanced Grid-Hedge EA, which will be a mixture of classic grid and classic hedge strategies. By the end of this article, you will know how to create a simple hedge strategy, and you will also get to know what people say about whether this

Forum

How to get price of ellipse points?

I think I have explained everything in image. OBJPROP_PRICE4 doesn't exist, I wrote that in image by mistake, sorry about that. Can someone help me with this problem of ellipse? Thanks for your time

Just a Small Queries About Declaring Classes Instances

//+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ void OnStart () { TestFunction(testClassInstance1); }

A quick help with functions.

I want to show my function's input like that. normally it is : [Variable Type][Space][Variable Name] I want : [Variable Type][Space][Whatever I Want (eg : flags=TIME_DATE|TIME_MINUTES)] A little Help Will Be Really Appreciated

Need Help In Opening a URL in Browser From MT5 (MQL5)

Currently I am Using the Below Code In MQL4, //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ bool openURL( string url){ int APPEND

How To Disable Algo trading in MT5?

I want to disable trading for a .ex5 file on a specified condition using EA. Can Someone please help Me in disabling Algo-Trading via Code? Help Will be really really appreciated and By helping me you will help many other peoples too because there is no previous forum of any detail about doing it on

Can Someone please Help me With This Arrow?

How To Draw These Arrow? I can't see them in wingdings or anywhere else. Can Someone Please help me

String Array Default value

What is the string default value? I want to use a if statement on a string array default value. It's not EMPTY_VALUE , 0, ""(Empty String). Then What It Is? example string Array[]; ArrayResize (Array, 10 ); for ( int i= 0 ; i< ArraySize (Array); i++) { if ( Array[i]==( default value(I don't know

Array out of range

This is my completed indicator code : //+------------------------------------------------------------------+ //| Smart Arrow.mq4 | //| Copyright 2021, MetaQuotes Software Corp. | //|

Cannot Get Value from iCustom Function

Hi Coders, I want to get value of ex4 indicator from iCustom. I am not new to coding and i have used iCustom a lot. But needed to change string input variable in iCustom brfore today. I have attached the Indicator. And this is the code I am using

API Request

Hi, I want to send GET and POST request to API. but i didn't know how to do it so i searched for it and found official documentation : WebRequest - Common Functions - MQL4 Reference And I tried it's examples code with some different API's but i don't know how to use JSON Header. Can some one please