Expert Advisors and Automated Trading - page 21

  dpi reading not updating  (39   1 2 3 4)
how come the dpi reading is not changing even if i change screen resolutions ? im getting 96 at 1280x1024 and 96 down to 800x600 thanks Client Terminal Properties - Environment State - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for
Can someone help me with this ? double bidPrice = 0.0 , askPrice = 0.0 , spread = 0.0 , point = 0.0 ; if (! SymbolInfoDouble ( _Symbol , SYMBOL_BID , bidPrice) || ! SymbolInfoDouble ( _Symbol , SYMBOL_ASK , askPrice) || ! SymbolInfoDouble ( _Symbol , SYMBOL_SPREAD , spread) || ! SymbolInfoDouble (
why MathAbs ( iOpen ( _Symbol , PERIOD_CURRENT , 0 ) - iClose ( _Symbol , PERIOD_CURRENT , 0 )) always 0 ?? how to fix it
Great! Now before you come after me because of the title, please hear me out first. I got into programming EAs and when I heard the words "magic number", I was intrigued and wanted to know what they represented. So I looked up some codes on codebase and the forum and my conclusion so far is that it
I get compilation errors in MQL5 when trying to use methods on pointers via the -> operator (e.g. ptr->SayHello()). Errors: '>' - operand expected, 'SayHello' - undeclared identifier and others. MetaEditor build 4873 (February 2025) is used, file .mq5, code is entered manually without typos. The
Hi, I would like know if is possible to close a position (or invert it) with a limit order ( TRADE_ACTION_PENDING ) in HEDGING system? Even when I set the order.position to the position id (ticket) that I would like to close, I'm getting the error 10013 " invalid request ". Since this error is
Hi, i'm trying to read a bitmap file using the ResourceCreate() function. The file exists in the MQL5\\Files folder so that calling FileIsExist(ImageFileName) returns TRUE. In contrast, the “ResourceCreate” function returns error 5019 which means that the file does not exist. I have tried
I got stuck trying to BUY/SELL STOP LIMIT orders. When I send this type of order, it always comes back with error 10015 (Invalid price). I've been looking at this for a few hours now and still can't figure out where the problem is. The problem is not in the "normalization" of the prices, because I
Hello, I am looking for a trade manager that can handle orders made from EA as well as manually placed order. So if i buy from phone say EURUSD, and it goes in a drawdown and i open another order it can treat both orders as a basket of orders. I can then set a stop loss/take profit applicable for
  Auto Bots  (4)
Sorry I am new to this and simply testing different options on a demo account to tryto understand it better. When I drag one of the free bots to a trading window, it shows under all timeframes. Does this mean the bot should work the same regardless of which time frame I dragged it to
Good day I need help please . I'm still new to coding and is learning by watching you tube videos and reading the MQL5 Language REFERENCE. i want to create a EA that can trade with trend lines and found this code in the reference on page 399, but after i moved the #property and input variable's to
  onnx  (3)
Ive tried everything to get onnx installed. note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for onnx Failed to build onnx ERROR: Failed to build installable wheels for some pyproject.toml based projects (onnx) This is boring me and
  Validation Error  (5)
Hi could someone explain what this means exactly? test on EURUSD,H1 (netting) strategy tester report 4 total trades test on XAUUSD,D1 (netting) 2022.04.26 01:05:00 position stop out triggered at -51.93% [#2 buy 0.4 XAUUSD 1929.475 sl: 1859.53 tp: 2139.04] stop out occurred on 39% of testing interval
Hi team, The current Currentime() function is getting the time but in seconds not in milliseconds, can anyone help me if I want to get the current time in milliseconds using EA. Thanks
Is it possible to connect multiple trading accounts (with automated trading robots) with one VPS subscription from MQL5 ? If so, please explain how to do it. Thanks
Hi Sometimes I save optimization cache files for further investigation. They are saved in a specific format name. For example something like this: myEa.US30.M10.20240501.20250123.40.ACCAA534B30928EDC6465EBA51FB7A69.opt myEa = expert advisor name, M10 = time frame, 20240501.20250123 = test date range
Hi, When I call SocketTlsRead() function it returns -1 and the error code is 5273 and it terminates the websocket connection. I would appreciate any ideas on how to solve this problem. int OnInit (){ socket = SocketCreate ( SOCKET_DEFAULT ); if (socket != INVALID_HANDLE ){ if (
Hi, I need to read the cache optimization file (.opt - path: TerminalInfoString(TERMINAL_PATH)+ "\\Tester\\cache\\", "XXXXXX.opt") in order to get information about the optimization parameters of EA. So, this is a binary file and I dont know how read it using mql5 file functions. Does someone can
Hello, I have MetaTrader 5 installed. While poking around and trying to learn about cloud network, I also installed a standalone instance of MetaTrader 5 Strategy Tester. So, now it seems that I have 2 instances of the Strategy tester available, and they show/are using different resources. The
I know for the normal symbol, the time and day settings are broker/server related and cannot be changed, but what about custom symbols ? I already tried CustomSymbolSetSessionTrade and CustomSymbolSetSessionQuote, but not working
Hello , so i got a situation with my one of my EAs , so basically on the backtest everything works fine, trades are set to be when they should and closed when they should , but on live trading , the bot is not setting trades to be , and is not respecting the rule of not opening a new trade if the
Hello Everyone I have a problem in optimization passes. I've searched a lot but non of questions nor the answers in the forum was the one solving this problem. The problem is that i have some bool parameters in my inputs which when they are set as false there is no need to optimize some other
Hey all Does anyone know when I upload a new update version to my ea does it automatically update all the clients ea? And aware them the changes
Hi Folks, 6 hours later and I am done... to get the profit from an opened Position you can do this: if ( PositionSelectByTicket (ticket)) { return ( PositionGetDouble ( POSITION_PROFIT )); } Works like a charme... BUT, if I want to get the profit from an closed Position, nothing
Hi - happy New Year. In https://www.mql5.com/en/forum/383008#comment_26181711 I wondered why the strategy tester does not report any memory leaks if occurring in the MQL5 program. Look the following EA where I "forgot" to free the allocated memory: class A { private : string m_name; public : A(
CopyRates only 100000 Bars,for example,the earliest time of 1-minute Bar is 2024.11, i want data for 2027.10 and before, What should I do
Dear Community, I am reaching out for assistance in connecting my trade account with Visual Studio. Unfortunately, I consistently encounter the following error: (-10004, 'No IPC connection') . I have attempted various troubleshooting steps, but none have proven successful thus far. I would greatly
Title says it all, I'm not sure what the most efficient way of doing this is so I am asking here. For EAs that trade on hourly or daily it may try to place trades at 00:00 during/on market close so what is the most efficient way of making wait like 5 minutes before trying to place the same trade
  Help for an EA  (4)
Hi guys, just trying to make an EA that copy the signals from telegram to mt5. I have a doubt, for close the trade i need to reply to the original message signals on telegram, but in my case my texts are setted in this way: SELL LIMIT GBP/USD 1.27000 (reply to the previous message) TRADE OPENED
MQL5: Market - Can you sell an expert advisor that uses custom indicator? I want to sell an expert advisor but can't really understand how it will work/upload if its uses or calls a custom indicator.