How to get length of enum and item in MQL4/MQL5 ? For example, there has an enum definition: enum ENUM_FRUIT {APPLE, BANANA, GRAPE}; Next, I want to use it in loop: for ( int i = 0 ; i < length_of_enum; i++) { Print ( EnumToString (get_enum_item(i))); } How to implement this requirement? I've
Hello, I have created an expert advisor which should draw a line if a certain condition is reached (MT5). When I simulate it in strategy tester, it works. But when I attach it to a live chart, it does not draw the line. Is this on purpose? is there a difference between strategy tester and live chart
Hi guys, I'm new member here. I made a EA using RSI indicator. But my EA is operated only on a chart. I want to use EA on 2,3 pair, please help me
Expert Coders, I have a breakout EA. I need your help so It won't place order when the spread is higher than predefined value..Say if spread it higher than 1.2 pips, it must not place any order. Thank you in advance
MT5, how to use OrderCalcProfit( ) ? I read the help book, understand. o=OrderCalcProfit( ) ? please give me an example
I've been looking for a script or ea that would close all buy or sell stop positions immediately and at once without having to go through each manually and clicking on the confirmation pop-up. This is tremendous time killer and loss of profit is huge at time. Anyone familiar with any solutions? Most
(Written by deepl translation below so please forgive the strange English) I am writing a library to store EA test results as csv. To analyze it in detail by comparing and graphing it. now, I can save deal records for both single tests and tests under optimization! foo! So next I need to get the EA
Hi, I have an EA which shows 9 warning errorslike 'declaration of 'xxxxxxx' hides global variable' while compiling. Can someone help me: 1. At least fixing one warning error with exact code I need to add or remove 2. This EA works in testing with all graph but not working in real account. Can you
Hello, I am using a MQL5 VPS to run my Expert Advisor. Every time I shut down my laptop I get the below messages in the journal. (see screenshot) It appears the VPS gets disconnected from the terminal. Is this normal? Is my VPS still running? And sSInce I have started the VPS I am unable to see any
EDIT : Ignore this , my mistake on the sessions times , the question is if SymbolInfoSessionTrade will adapt sessions to holidays of that week. When i run this code on MT4 to get whether or not trading will be possible on monday (tested on AUDUSD) it returns false : MqlDateTime mqt; mqt.day= 2 ;
void OnTick () { if ( (myMovingAverageArray20[ 0 ]>MyMovingAverageArray50[ 0 ]) && (myMovingAverageArray20[ 1 ]<MyMovingAverageArray50[ 1 ]) ) if (CountBuyPositions()== 0 && CountSellPositions()== 1 ) { trade.Buy( 2 *Lot, NULL ,Ask, 0 , 0 , NULL ); } if
mt5 ea can not mount.........do not tell me import any indicators into the folder or any VPS solution~it's can not slove the problem
//+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void Indicator_2() { Indicator_2_Buy= 0 ; Indicator_2_Sell= 0 ;
I have found a lot but do not understand how to create a button to close the command like this, but in my opinion to manage the trade easier. Help me
I need an EA that will close all open positions if a % drawdown is reached, the drawdown is calculated in relation to closed and floating traders the max drawdown is 10% of the initial capital, as soon as it is reached all the trades are automatically closed and disable trading in this account for
Hello, I have written a scalping EA, however I am new to mql5 programming and not 100% on how to implement the following. I would like to add a time filter, thought this would be simple but everything i've tried for this still opens some trades outside of the hours I set. I would also like to add a
hello, I have more than 20 years programming experience, but now I make my first steps in MQL5 framework, so far I made a simple Expert Advisor , and I read a lot of articles and passed thoroughly through the reference but I still straggle with the following: I am hanging on OnTick() event handler
hello can someone help me pleas i want set a time betwen closed a position and new open trade
//+------------------------------------------------------------------+ //| Keltner_Channel_Counter.mq5 | //| Copyright 2022, MetaQuotes Ltd. | //| https://www.mql5.com |
Please help me code a multi-symbol Deriv DBot that buys when the 5 EMA crosses above the 10 EMA and sells when the 10 EMA crosses above the 5 EMA. Moreover, the buy contract is opened when at Bar[0], the 5 EMA is above the 10 EMA by more than 3 pips. At Bar[1] the 5 EMA is greater than the 10 EMA
Can some please help me with this issue. I purchased a workstation with two 22 Core Xeon processors( total 88 individual agents) to speed up my MT5 EA testing. I usually do a backtest + forward optimization. I have noticed that during the backtest, all the 88 agents are used but during the forward
I'm trying to get values from a custom indicator into my Ea but i'm getting errors. I've compiled the indicator with name "tmp" saved in the path MQL5\indicators. Here is the Ea source. //+------------------------------------------------------------------+ //|
Hello everybody, I'm a beginner in MQL5 and programmation in general. I started developing my EA last month following examples online and in the documentation and I have been able to implement custom indicators, buy and sells following conditions but I am now facing a problem that I don't know how
Hi All, If I run the onTick function to tell me CurrentTime, how can I filter the EA to do actions only when the time is :00 seconds? Thanks for the answers
If Orders set by market, also. It's possible to do? I have problem with high price change at new day begun ... It' PYTHON
Hi Guys,i have been doing a bit of coding and have encountered a bit of a problem i would like you to help me on,how do i change the time format to read "15:30:50" instead of showing "15:30" as shown below(i would like the seconds to show as well); if (PositionsTotal()==0 && OrdersTotal()==0 &&
While working on an EA in mql5, I encountered a problem that I don't know how to solve. I have no problem opening a position. When closing in the debugger everything works fine. In real life, however, I have a lot of problems and sometimes a new opposite position is created, i.e. when it is sell, it
Hi friends, I'm trying a function to close trades by time, but I'm not sure it's working 100% times, due the backtest results. Somebody is looking bad code? Thanks in advantage //+------------------------------------------------------------------+ //| Include |
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
If you do not have an account, please register
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.