Expert Advisors and Automated Trading - page 47

Hi there due to my expert it's not getting profitable due to spend on commissions my question is the following: How to save on commissions by using PositionCloseBy? Made a test by using this code but it's not working the same as the original version (less profit): int OrdersCount= 0 ;
Hi everyone, I'm new in MQL5 and the following code is not working for me, what I want is that when it detects the crossing of the two H1 moving averages, I change the period with ChartSetSymbolPeriod to M5 and place the purchase order (orderSend) and close the purchase (orderClose or trade
  Memory Exception  (16   1 2)
Hello. I'm having a problem with my EA. I have the following message repeating: 2022.07.06 13:11:46.206 MemoryException 1228800 bytes not available, 0 heapmin result 2022.07.06 13:11:46.206 MemoryException 1228800 bytes not available, 0 heapmin result 2022.07.06 13:11:46.207 MemoryException 1228800
hi everyone I am looking for a free expert advisor who can open and close positions with keyboard shortcuts please? I would like to have a base so that I can modify it for keyboard shortcuts. Best Reguards, ZeroCafeine 😊
I keep running into this error at the automated validation testing: test on EURUSD,H1 (netting) strategy tester report 606 total trades test on XAUUSD,D1 (netting) 2018.06 . 25 01 : 34 : 00 failed exchange buy 0.20 XAUUSD at 1271.980 sl: 1271.480 tp: 1272.480 [Invalid stops] 2018.06 . 27 01 : 00
Hi, is there a way to log additional metrics during optimization? I would like to collect more information about an optimization run and to sort the results by these additional (non optimized) metrics. More precise: I woul like to have a nother column "MyMetric" after the "Sharp" Column. Is it
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
Hello Everyone I have a problem in optimization passes. I've searched a lot but none of questions nor the answers in the forum was the one solving this problem. The problem is that I have some Boolean parameters in my inputs which when they are set as false there is no need to optimize some other...
  RSI EA problem  (3)
HI everyone today I coded this ea and it works but I've a problem with the buy positions, when opening a buy positions, the ea close it at the next bar! please help me! #property copyright "Copyright 2023, MetaQuotes Ltd." #property link " https://www.mql5.com " #property version "1.00"
Hello Dears First of all, I must say that my English is very poor and I wrote this text with Google Translate. If you see any mistakes in my text, I apologize in advance. ----------------------------------------------------------------
Hello, good day programmers, I have tried to eliminate the arrows and trendlines from the autotrades but they are only removed from the current chart but not from the other charts opened by the strategy tester. and in the same way when I call the function in the OnDeinit() part they are not
  Symbol Equity  (4)
Hello, I want to calculate the equity for each symbol separately, but my current code calculates the overall account equity instead. For instance, if my trading bot handles multiple currency pairs, and I only want the equity for the EURUSD pair, what code should I use? Can someone assist me in
Below is a code that creates 2 bitmap object. These objects gets resized accordingly whenever there's changes to the chart ie slide, zoom. You will see those objects flickering when you slide & zoom. Thanks! #property copyright "Copyright 2023, MetaQuotes Ltd." #property link
I have a script letting user to customise the chart properties. I use ChartSetSymbolPeriod to change the chart timeframe. my last input in the script is to save the template. problem is ChartSetSymbolPeriod causing the script to be terminated and then I recieve error in applying template. How to fix
Hello everyone, I hope you're doing well! I am currently working on developing an Expert Advisor (EA) and facing a challenge. I need to obtain the ticket number of the last position immediately after opening it. I am using the following code for this purpose; however, I am encountering inconsistent
Hi all, is there any way to access the built-in economic calendar during backtest? I tried CalendarValueHistory and while it does give proper results when executing the code on a live chart, it returns no results during backtest. Thank you in advance
I love MT5 but there are some problems that does not allow me to switch from MT4. 1. The spread in the backtests comes from the data and we cannot define a value. We know that spreads change a lot from broker to broker and having a fixed predefined value does not allow to test certain strategies and...
Is there any way to check some open order when the user clicks the button to close the terminal and prevent the terminal from closing until the order is closed? I tried doing it in the OnDeinit event but it didn't work: void OnDeinit ( const int reason) { if ( PositionSelect ( _Symbol )) {
Assume I want to get data from page https://www.abc.com using web requests However in the Allowed URL user input https://abc.com because when copy pasting from browser the www gets neglected. The web-request fails in this case as the web request returns -1. My understanding is Allowed URLs list
My demo terminal is not setting a position identifier for positions ... and naturally it is absent also for deals and orders on the history tab. What can be the reason? Thanks.
[Deleted]
I have been facing some issues on testing OnTimer but it does not happen always only sometimes so hard to record the event, Timer stops and I also use time compare like if current bar timelocal is not syncing fast to last 2 bars time then alert ,so i may know when OnTimer function freezes and i can
the red and gray lines seems to be the line graph of the "open ask & close price "... my EA does not hay ANY indicator.. where tthose lines comes from ??? and how to disable them ??? the "help info" of the MT5 does not offer help
double array[ 10 ] = { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 }; double array2[ 10 ] = { 11 , 12 , 13 , 14 , 15 , 16 , 17 , 18 , 19 , 20 }; for ( int i = 0 ; i < 10 ; i++){ ArrayInsert (array,array2, 0 , 0 , 1 ); } ArrayPrint (array); To provide some background and a simple illustration using a 1 d
Help Me❗ How to connect 2 Forex Robots that do not have the same Magic Number? Hello Bro. Currently, I have 2 Forex Robots trading on the same account with the same currency pair. However, these 2 Robots do not have the same Magic Number (this is my own intention because if set up with the same
The product validation of my EA keeps failing, so I am unable to add it to the market it is an EA based on indices and should work on NY open till close. Due to the fact that no time constraint is allowed, I made the time constraint optional and the default time to be all through the day but it can
I am using MQL5 in Borsa Istanbul. I trade in futures markets. In our exchange, just like in cryptocurrency exchanges, buyers and sellers place market maker orders, and this is how the market is formed. There is no spread like the FX markets, instead the buyer and seller meet at the best price and
Hello everyone.I´ve been experiencing an issue, on my MT5, which seems to be a setting one, but can´t figure out why. I can´t execute a delete PENDING, non from a MQL5 bot, and from PYTHON API either.Both bots seem to be correctly coded, MQL5´s one compiles well, and works in Backtesting, but when I
Hi every one, Is it possible to find out from the asset description whether we can go long and short at the same time, or do we have to do the test ourselves and open 2 opposite positions? exemple on USDJPY here : Best Reguards, ZeroCafeine 😊
[Deleted]
Hello, I have an ea in my hand. but I don't have codes. When EA opens a transaction, is there something that will automatically reverse that transaction, disable the robot, and then activate EA again when the transaction is completed? Is this possible
#property copyright "Copyright 2023, MetaQuotes Ltd." #property link "https://www.mql5.com" #property version "1.00" #include <Trade/Trade.mqh> CTrade trade; int handlefastma, handlemiddlema, handleslowma; double Ask = SymbolInfoDouble ( _Symbol , SYMBOL_ASK ); double Bid = SymbolInfoDouble