Expert Advisors and Automated Trading - page 104

Hi, I have an issue with file opening during optimization, if the test is ran on visual mode or EA is attached to a chart, the file opening always succeeds, if the file is less than 1.3MB out of 100 passes, the file opening may fail less than 7 times during optimization, with a file greater than
Hi, recently I observed the issue that the MQL method PositionGetTicket() failed. It returned 0 for many, many trials. If this error comes up I still can place orders. But it would be interesting for me to know what a reason might be. Broker error, broker blocks something, merket closed, delay
Hello, As I said in the title, I'm new in automated trading and I don't understand how works the script Multi_BuyStopOrder : https://www.mql5.com/en/code/44035 I know TP should be upper than the price asked and vice versa for SL but, I would like to trade immediately (and not wait for an asking
When using the Python Integration functions history_orders_get() and history_deals_get() , I've noticed that the returned orders and deals always seem to be sorted by their execution timestamp in chronological order. If I can rely on this ordering, it would simplify my logic and enhance the
When it comes to cryptographic algorithms in MQL there is a lot of scattered information and it is difficult to put it together, especially if you want to implement an analogous function in another programming language. I thought it was worth starting a thread where we can share implementations. I'm
I wrote a list of strings. String cell1= "cell1"; String cell2 ="cell2"; About 50 cells For some reasons the cells doesn't run past cell 20. I used the print statement to confirm but the code doesn't print anything past cell 20
I've observed while trading with an Expert Advisor (EA) and utilizing a Virtual Private Server (VPS) on MT5 that some of my trades aren't reaching their Take Profit (TP) or Stop Loss (SL) levels. These trades appear to be closing unexpectedly and have been negatively impacting my trading account. It
Hello everyone, I converted this code from MT4 to MT5 but in the MT5 backtest the EA is unable to open any positions even if no errors are detected during compilation. I can't understand why. Is there any error in the logic of the code? Thanks to anyone who is willing to help me. input double TP =
Hi all, I am trying to collect the day open equity so I can control my daily drawdown and close all trade if it gets reached. However I don't understand why it is not working. Here is the following code I am testing: double EquityOpenDay; int OnInit () { EventSetTimer ( 15 ); return (
Hello guys, I have an expert advisor running in the market from an hedge account of Icmarkets. I am struggling with a situation which I can not solve, despite the research I have already made online: During an open position, at some point I move my stop loss to break-even and try to partially close
Dear all, I would like to know if it is possible to figure out if any copy trading EA or copy trading service is used for the current account. Basically, this "check" shall be included in an existing EA in order to prevent any copy trading service. In other words, it should not be allowed to use any
It is necessary to transfer the total profit for the week on all transactions to the Telegram channel. Counting should be done every week. I am currently sending the signal and the result of the signal to the telegram channel, but I still need the total result. Perhaps someone has materials or
Hi, usually I use _point for calculating my risk and lot sizing here's an example: //initialize Scaling Lot double balance = AccountInfoDouble ( ACCOUNT_BALANCE ); //get account balance double percentlot = balance*RiskPerDay/Stoploss* _Point ; //math for risk calculation percentlot =
Dear experienced traders. Do you know how to change the default pass maximum of optimization test? Backgrounds: 1. The default pass maximum number seems like is 10,496. 2. Not matter the pass is over 100,000 or 1,000,000 the maximum number shows as 10,496. I need it test as 100,000 or more. 3. At
  Order types  (13   1 2)
Hello, I am trying to place a buy limit order for XNGUSD. Suppose, it is trading at 7.140 and I want to place an order when it crosses previous candle high of 7.155, it is not letting me place a buy limit order. It says price has to be 36 points above the current price which would be 7.176. So how
I'm trying to code an EA which needs to asses the value of upcoming swap in order to decide if it is feasible to open a trade in the evening. I was able to get calculations for some of the swap modes working correctly, however SYMBOL_SWAP_MODE_INTEREST_OPEN swap mode calculation fails for me
Hello Friends I've been trying to get the commission of opened positions but it's not working. I used P.Commission(), but it's returning 0
I'm trying to upload my EA to the market, but something's failing, and I can't see the reason for the failures as none of my Print() statements are coming out in the test report I'm calling testerstop() so I can know which method is failing, which I have, it fails on opening a new position, but the
Hello everyone, I'm quite new to the mql5 world, I have a problem. I would like to output the number of parameters of my tests with the tester to a csv file, appending each new string from time to time for each single test that is launched. The problem is that every time I start a single test (I
Hello friends, I'm working on a trailing stop that closes the trade if the profit decreases by 10 percent. However, I don't know how to implement it. I would appreciate it if you could help or if you have a similar code, please introduce it to me. Thank you
Hi guys, I'm new and still starting out, I'm trying to launch this EA code in MQL5, but although I don't have any type of error, when I try to test this EA in my strategy tester, it doesn't open any orders. Can some good soul help me? thank you very much. Below I share my code Improperly formatted
I'm trying to implement a strategy that trades on the daily timeframe based on the daily close. The problem, of course, is that the instant the daily candle closes, the market is closed. So I need to catch the next open (not necessarily NYC - in fact, don't want to wait on that). It seems to me in
What metrics do you use to objectively measure performance of your EAs? And what do you consider good enough to put into production ? At the moment, I'm focused on prop trading, and using that as a good reason to focus more on minimizing drawdown and maximizing consistency, more so than maximizing
  Syntax  (2)
Hello, On the below code CTrade :: CTrade( void ) : m_async_mode ( false ) , m_magic( 0 ), m_deviation ( 10 ) , m_type_filling( ORDER_FILLING_FOK ), m_log_level( LOG_LEVEL_ERRORS) { SetMarginMode(); //---
Are EA advisors profitable in the long term and have a high win rate? Is it worth the time
I found some but they are only for demo account and some works on only limited pairs, Any free ? Thanks
I found it strange that my EA cannot read volume during tests, although, the Strategy Tester is showing it. That means I have good data. Is this expected? I am implementing inside the OnTick() event. I am having all attributes of the tick, except the volume. I am using MT5. In the images is the
When I automatically generate an MT5 EA, optimize it, and backtest it, there are periods when there are "invalid stops" errors and periods when there are not. Is the stop level not set in the auto-generation? What code should I add or modify after auto-generation and where
Hi, Is it possible to build an ea, using the arguments in a push message of another EA in MT5? For exemple, on a MT5 terminal, i have 2 EAs: the first do its work, and then when it feels a signal send a push message, for exemple "eurusd M5 trend up, possible buy" then i need to build the second EA
Hi all, Why EA terminal hangs during some news time. Due to this my trades are not managed correctly even if I set my SL and TP