Expert Advisors and Automated Trading - page 3

gidday. i want my script to work on forex pairs, all trades, from all forec symbols. My script below is working on both usd and aud deposit accounts, but only on BUY TRADES. help! I want all my trades have an sl that is equivalent of $350
I want to get the position ID of a trade right after opening it, but it always returns 0 . Here is the code I’m using: if (trade.Sell(volume, symbol, 0 , sl, tp)) { ulong order_ticket = trade.ResultOrder(); // Trying to get the position ID ulong pos_id = HistoryDealGetInteger (order_ticket
Hello, I'm working on a multi‑symbol Expert Advisor that monitors trade events across several instruments. I know that OnTradeTransaction is triggered when a trade transaction occurs on the account, but I'm not entirely sure about its scope when used in an EA. If I have a single EA running on a
I am developng EA, I want to set max slippage in mql5, do anyone know how to set max slippage
Running 2 EAs on MT5 via VPS. Recently had one go quiet for about 3 days — no crash, no errors in Experts or Journal, smiley face still there, terminal connected. It just stopped taking trades. I only found out because I manually check the accounts every few days. Could easily have been longer
  EAs wont place trades  (14   1 2)
Hi I am new to MT4/MT5 and I'm trying to backtest some EAs. There are a couple EAs I've tested that will place trades like the <Deleted> bot but I tried 4-5 others and they all fail to place any trades. I noticed in the journal that the bots do not initiate any buy trades but has many sell trades
No further information, impossible to debug, since it happens with indicators when the profile is changed and when the indicator terminates. And it happens after everything is already shut down, like IPC connections etc. Next problem: It happens sometimes. Randomly. Any ideas? Source code is
my code below just prints best/worst equity when these are breached. And when equity hits X then closes all trades. This worked fine for oever 3 months til my lateest update 5833. i dont know if this is a bug or is my amateur coding. Here's my coding below. If you see anything that is wrong or can
Since I updated the platform, the strategy tester no longer works. Every time I run a test in the diary, it says "no history data." How can I fix this? Thanks
i wish to include this file TrailingMA.mph in my auto-trading how to initial its function
I found a solution for the many charts that the strategy tester opens automatically in MT5. Till now I closed them one by one with Ctrl F4 and than clicking on the next chart tab. But this goes faster: On your keyboard: Alt W ... this opens the Windows List. Now select the first of the charts you
how to fix this wrong closing prices problem ? i has many of that in my account random closing prices not the take profit price target ? what to do
  Tester mode  (7)
When using default settings modelling, every tick gives amazing results, but that doesn't exist in real market. Using for test the every tick based real tick give real sight about results. Most EA sold or free works on default set, but in real, it's wasting time and money
Hello All, I am working with a friend on an EA; I design & write the code (what could go wrong? 😂) and he investigates trading scenarios. Our two minds are very different and up to a point it works. However we have recently encountered a problem which I had handled badly in the code 😳 - and I am
Is the swap calculated during backtesting (by ontester section) in MetaTrader5 ? And does it calculate correctly? That is, does it calculate the swap for each day, or does it use a fixed swap rate? If Yes , I don't see it in the report. I tried it in both cases: Every tick and Every tick based on
Hi guys, Hope that you are well. I have 5 MT5 terminals running, but for some odd reason in the last two weeks 2 of the terminals with similar EA's have stopped working. I am not getting any bad report or anything...I installed a new Terminal and reinstalled the EA's, it is still not working...all
I might want to calculate the value of all closed positions within a given period. /* * Pick up profit so far today for all deals that have completed, for all EA's * for a specific magic # & symbol. * * Parameters: None * * Returns: profit as a double, 0 on none found or error. * */ double
  Loss recovery  (1)
Hello, Can I copy the next trades with double the volume to compensate for the first trade that was a loss in the signal channel, using any Telegram copier? Does it have this feature? Which tolls?? What is website address
Hello wondering if there is a profitable EA on the MQL market or have they all got a alternative motive. I mean lets face it, if someone had a EA that was profitable, why would they sell it. Very basic discussion but funny enough it may raise some concerns. I have had many EA's from over a period of
Environment: - MetaTrader 5 for macOS (native MetaQuotes Wine wrapper) - Wrapper build 5.0.5834, terminal build 5833 - Wine 11.1, winemac driver - macOS 26.5.2 (build 25F84), Apple Silicon (arm64) Bug: After a Strategy Tester backtest in Visual mode finishes, the MAIN terminal window is
Hi, Just as the title says is it possible to create an MQL5 file of an expert, I only have ex5 file which is also account restricted. The guy who gave it to me is no longer accessible. I know all the parameters on which the EA works, I want to try it on different accounts with different capital size
Dear all, This function in my EA work in tester but not in demo and live, please help. It return the deal of 2 hours before divided by minimun lots allowed. e.g. 2 hours before the deal in was 0.05 lot, then it should return 5. Use the CODE button (Alt-S) when inserting code. A moderator
I was testing an EA that a developer put on the codebase for trading Gold ( based on Keltner channel and EMAs) . Here is how the backtest looked on "Real Ticks" modelling: Here is how the backtest looked on "Every Tick" modelling for the exact same setting, same leverage, and same time range (same
Hi everyone, I'm currently working on a trend-following EA, and like many of you, I'm struggling with false breakouts during market consolidation (flat markets). To solve this, I coded a simple filter that checks the dynamic spread between two Moving Averages and ensures the current candle body size
Hello everyone! I am developing a trend-following strategy. The working principle is quite simple: there is a base moving average (indicating the trend direction) and additional filters - moving averages on several timeframes - the price closes above the filters on the working timeframe - it opens
Hi guys, I've created my first ever EA. I saw the red color message about bad description. Can anyone give me some advise how to fix it and tips for boost the ranking ? Appreciate your time and advise
  Emulate Slippage  (6)
Hello, When I click on "Emulate Slippage" at MT5 backtest, I dont find setting relate to slippage emulating, can someone shed light on how to set this
Hello everyone, I've been trying for a year now to develop an automatic trading algo using a neural network as a model and level 1 data (open, close, high, low candlestick prices) and several technical indicators (14). I retrieved this data in a 1-minute timeframe using mql5 scripts that I devised
What is MQL5 Wizard : The MetaTrader 5 Trading Platform includes the MQL5 Wizard , which allows to quickly generate code of an Expert Advisor (Expert Advisor builder). With MQL5 Wizard, knowledge of programming languages is no longer a prerequisite for creating trading robots . In the past, it
Dear Members, Microsoft recently launched its own Linux distribution (Azure Linux) after recognizing that Linux has become the dominant operating system on its Azure platform, far surpassing Windows itself. This suggests the beginning of a long-term strategic shift toward Linux. Some may argue that