Varun Maithani / Publications
Forum
MQL5 - Unclear about struct variable assignment and change within a function
Hi, in below code, struct LL { double price; } LL x; int OnInit () { x.price = 1 ; abc(1); } void abc( int a) { LL tmpLL; if (a == 1 ) tmpLL = x; tmpLL.price = 2 ; } Q1. In above code after calling abc(1) , inside the function abc, is a new object being created
MQL5 : Can we do late initialisation of array?
i want to do ENUM_TIMEFRAMES xTF; // some logic to set xTF bool listOfIsNewCandle[ 6 ] ; if (someBoolCondition) { if (xTF == PERIOD_M1 ) listOfIsNewCandle = {isNewCandle_6min,isNewCandle_5min,isNewCandle_4min,isNewCandle_3min,isNewCandle_2min, false };
Backtesting - early quiting of agents' run.
While performing optimization of input parameters via backtesting feature in metatrader 5, I wish to use some condition to stop the agents run of a particular combination of input parameter early. On reaching a certain condition while the agent is performing one such run, i wish to quit that run
MQL5 : Header (mqh) file unable to use parent mql file's struct variable
Hi, I have a EA which has a struct defined in it (because there are variables of its type in the EA mql file) and the struct type is being used to declare a variable in the header file too. // within mql EA file struct LLevel { ..... } // within mqh file LLevel expiredLLevel[]; After i include
Re: fetching trade info when position opens/closes, editing csv to update info, matching closed position with its corresponding limit order
Hi all, I want to do the following: -Step 1- catch information about a trade when a position (whether its direct market order or when price hits limit order) opens eg ticket, trade spread, slippage, price requested , price received attribute X value (eg X = 5, this is artificial attribute, not
Where to find source code for mobile (Android) MT5
I want to modify code to add my custom features on chart for risk management cuz no one has done it in last decade (surprised pikachu face). The UI of mobile mT5 to create new orders is highly non intuitive/ non user friendly as you may have realised already from using so many other alternate tools
Best practices for coding MQ5 Indicators
Hi, I just wanted to know if any experienced developer has made post / topic about best practices and patterns about creating I ndicators. Since information about EA/MQL5/Indicator is spread out across forum posts/articles/MQL5 documentation, I thought someone may already have created post about
ISsue with Creating an indicator buffer that stores values for different timeframe (than the chart) and should be accessed by EA
Hi, I was creating an indicator that has 2 buffers. double x_1hr[] , x_30min[]; This indicator has to be used on 4 hr chart (for convenience purpose). But it needs to also populate values in the x_1hr and x_30min buffer array after some calculation in the onCalculate function. The value in these
MT5 Indicator problem : How to only call Telgram message sending function on detecting latest condition only (Also not while getting tested in strategy tester)?
Hi everyone, I have built an indicator in MT5 (MQL5) which detects a condition and draws it out on chart for me to take a trade manually. I am planning to write a telegram message sending function too, which is supposed to send a message to telegram (to me) on detecting that condition (which i will
Issues with importing a indicator in an EA
Hi, I am trying to create a handle for a custom indicator in my EA. However the custom indicator has in its code used several #include statements to import many Enums which it uses in its input. When i initialize the inputs in the EA they require the definition of those enums. However if i import