Expert Advisors and Automated Trading - page 48

So I was experimenting to try and fully understand the way that Experts and Indicators work, especially for slow indicators. But when I did a base-case test, just an Expert with a fast indicator, I noticed that the OnTick (or at least the print inside the ontick) does not call sometimes, even though
Hello, i'm pretty new to automated trading and have a problem. I'm trying to programm a EA that open a trade (under specific conditions) at the high of the previous candle. My problem is that i try to set the stop loss at the low of the previous candle. I got the Low and the high of the previous
i am searching for a week and do not get the answer so i decide to ask you guys. i want to buitd ea which use renko chart. i ask my friend who have computer skill, and he replied that he cannot build it because he doesnt know how to make EA open offline chart. he cannot do because renko must use...
Hello community, i know this has been discussed already but not really solved so far. When i make a CopyRates request in onCalculate for a symbol, which is not the chart symbol, then CopyRates call SOMETIMES returns 4401. If i recompile my indictor or change timeframe and then back, then CopyRates
please can anyone support me to fix this code it showing that '-' - open parenthesis expected for (int i = 1; i < Bars - 1; i++)
Hi I've written a very simple code to buy if a cross between MAs occurs. But the error is "Invalid order type ". All the parameters could be found like ask and Bstl but it could not open position. this is m_Trade #include <Trade\Trade.mqh> CTrade m_Trade; can u help me please. void
Just a quick question for an EA, I know about the error " not enough money " that sometimes pops-up when trying to place a trade above certain limits. My question would be, is it any (maybe easy) formula to calculate the trade parameters so it will avoid, or at least alert the user, that the trade
Hello, I have been struggling for the past 2 days to understand what's wrong with my code. I am new to coding. I have done similar EA's, but this is the first time I encounter this issue. All seems good to me, I also used chatgpt to recheck the conditions and make sure to debug the errors and type
Dear Coders, I'm working on an MT5 Expert Advisor. I would like to use the OrderSelect() function, but it doesn't work for me. Every time I get "Order not fouund" error message. Here is my code: int ot = (int)OrderTicket();if ( OrderSelect(ot) ){   Print("OrderSelect done."); // pr() function is...
I couldn't get the trade bot to work, can you help me
  Python or MQL5 — Code Migration  (42   1 2 3 4 5)
Dear support team, I hope this message finds you well! My team is looking to migrate our highly profitable trading algo to another home and we are trying to find what platform will provide the most benefits. The following are some questions we still need answers to that we have been unable to find
Hi fellows coders, I tried to use Shared memory (through File Mapping), by first setting up the required space using CreateFileMapping. But i kept getting error 6 <=> INVALID_HANDLE ( the error is collected through the following function kernel32::GetLastError() ). Even tho i tried multiples
Do we have any recourse if I bought two Expert Advisors from a seller who then stops selling all products ? Of course I activated the products but after about 2 weeks of use, the seller stop selling all of their products because they do not want to sell lifetime licenses anymore. The EA's were
I've been working on an EA, and over time, I've added several libraries that depend on other libraries. Since I was collaborating with another programmer, the code has become quite extensive and difficult to manage. I know it wasn't the best way to organize it, but now I'm wondering if there's an
Hello, I'm having trouble solving a problem. A source code that initially didn't present any errors is now showing 102 errors during compilation !! Unable to find the source of the problem. I consulted ChatGPT4, and it provided the following response below. In your opinion, since I'm not a coder
Hi All, I have written a logic in MQL5 in Meta trader 5 but when I backtest this strategy I get this error: failed [Invalid request] Error opening order: 10013 I tried so many things but the error is not getting resolved. Need some help
// Input variables input double TradeVolume= 0.1 ; input int StopLoss= 1000 ; input int TakeProfit= 1000 ; input int MAPeriod= 10 ; // Global variables bool glBuyPlaced, glSellPlaced; // OnTick() event handler void OnTick () { // Trade structures MqlTradeRequest request; MqlTradeResult result;
#property copyright "FrostBite" #property link "orbilloalvin157@gmail.com" #property version "1.00" //+------------------------------------------------------------------+ //| Expert initialization function |
Hello guys, I have some advice for an error that I can't understand. I developed an EA on mql5, everything works precisely, I only have one problem that I can't solve, sometimes (it happened 3 times in about a month) the set take profit is not respected and the position is even closed negatively
Hi community, For somes EA which are a bit complicated, multi timeframe & multi currency, sometimes the queue of events which are pending to process (Onchartevent, etc...) could increase and maybe overflow. Is there any solutions to acess to this queue ? That could help to improve stability of
I am facing a strange behaviour of the visual tester agent in MT5 I do not understand. I have a custom (home made) expert system that I am developing by long time. The code looks to work good by the program point of view; i t is compiled without error and, for example, I can launch it in the
Hello everyone, I'm Abel Nicholas, based in Los Angeles, and I’ve been exploring automated trading for a while now. I’ve worked with some basic strategies but am eager to enhance my skills in MQL5. I’m particularly interested in developing custom indicators and optimizing Expert Advisors. I’m
[Deleted]
  Useful money management expert  (50   1 2 3 4 5)
Hi everyone, As any real trader knows money management is a key part to successful trading. I have spent many hours coding the expert below and have decided to share it with the forum as a thanks for all the knowledge I have obtained from it over the years. This is not an auto-trading expert, it...
Hi I'm in the process of implementing the calculation of the "secure f" but there is something I don't understand. I've already read the article explaining the algorithm and I understand it almost entirely. But there is still one part that is not entirely clear. The article I'm talking about is "
I would like to add a news filter to my EAs. My plan is to build a service that will pull data from the brokers economic calendar and populate a local database. EAs would then use this database to avoid trading during certain news events; both for live testing and back testing. Unfortunately, I
// Define the necessary global variables double monthlyProfit = 0.0 ; // Tracks monthly profit double ProfitTarget = 1000.0 ; // Monthly profit target bool allowNewTrade = true ; // Flag to allow new trades datetime monthStart; // Stores the
I copied the entire installation folder to a new computer, logged into my account, and started backtesting. In debugging, the value of any arithmetic operation became 0. See the figure below for details. Does anyone know what the cause of this error might be
So i want to code EA that will open 1 trade every time new candle opens, can anyone please tell me how to do it
HI, recently I noticed all my ifs works in code and when i set break points it does stop at them but in the watch list it shows them as false as i showed in picture below and here is the code that does print x=3 which is correct but if you set break point at the print you will see in watch list that
Hi everyone, help me please. When I ran the EA trading system(MT5), I found a message in the journal tab that said " take profit triggered #2 sell 0.02 XAUUSDm 2042.486 sl: 2058.181 tp: 2036.359 [#3 buy 0.02 XAUUSDm at 2036.359]" This event represents the automatic opening of an order. When the