Expert Advisors and Automated Trading - page 26

  please help  (3)
hi, can someone please help me with this: I'm trying to get the correct account balance at the start of the month (1st), the code so far does give me the correct balance when the month changes to a new month, but the problem is when the EA is loaded the start balance of the month is reflected as
Hi, I am in the process of getting to know various Expert Advisors. When I install one for free, I can only test it using the 'start test' button. I cannot run it unless it's for testing purposes. What can I do? I have installed several, but I can only start them as a test, no matter which one
I am new to MT5 and I copy a code from https://www.youtube.com/watch?v=d9-_bb58PgE and https://www.youtube.com/watch?v=PgxhNRoe4AM and It says there are errors. //+------------------------------------------------------------------+ //|
Hi, I have this pc with 32gb RAM, during optimization truckloads of data are written to my Windows disk which affects my disk health. Now, I am aware of the fact that reducing agents will prevent this from happening but then the whole process takes much longer and it already takes ages with all
Hi there, I am very new to MQL5 and trying to create custom indicator //+------------------------------------------------------------------+ //| Hull_info.mq5 | //| Copyright 2024, MetaQuotes Ltd. | //|
I am quite new to coding in mql5 and have written my own EA. It seems to work fine in the strategy tester and places both long and short trades. But in live trading it only places long trades and has not placed any shorts. I suspect it has something to do with my code for calculation lot size based
I create my EA and use do while for get signal entry : ... Improperly formatted code removed by moderator. Please EDIT your post and use the CODE button (Alt-S) when inserting code. Hover your mouse over your post and select " edit " ... ... With this code, i got a problem freeze chart when i
  MT4 to MT5 code converter  (613   1 2 3 4 5 ... 61 62)
Rewrite MQL 4 to MQL 5 Script A script which converts MQL 4 code to MQL 5 code was developed by Keiji and Circlesquares on the MQL4 forum. First, download the following files and place them in your Metatrader 4 / experts / include folder - mt4accountinfo.mqh - mt4string.mqh - mt4datetime.mqh -...
hi, can someone please help me with this: I'm trying to get the correct account balance at the start of the month (1st), the code so far does give me the correct balance when the month changes to a new month, but the problem is when the EA is loaded the start balance of the month is reflected as
Hey guys, I'm currently working on an expert advisor, in which I use the OnTrade() function to trigger chart object creation functions. Basically, I want to manually draw arrows and lines on the chart, somewhat similar to how the native trade entry/exit arrows and sl/tp lines work. In order to do
Hi, I made some automation to create a new machine everyday, and everytime I install metatrader from my broker, however metatrader algo-trading is always disabled when it starts a new mt5. Consequently, my orders returns: 10027 - TRADE_RETCODE_CLIENT_DISABLES_AT - Autotrading disabled by client
hi i am trying to receive a message from python via Socket the message is "hi from python" , but in mt5 terminal i only receive character "h" please take a look at my mql5 codes and the images i attached please help me thanks bool HTTPRecv( int socket, uint timeout) { char rsp[]; string
  MQL5 Language: #define SWAP  (16   1 2)
Hi! In C programming language, one way to swap numbers is: #define swap(a,b) (a=a+b;b=a-b;a=a-b;) How can we write this in MQL5?
I have an error in the WebRequest section. Can anyone help me edit it // Define your Telegram bot token and chat ID input string BotToken = "YOUR_BOT_TOKEN" ; input string ChatID = "YOUR_CHAT_ID" ; //+------------------------------------------------------------------+ //| Expert initialization
How to correctly apply the weights of instruments in the portfolio to the position size? I have a portfolio with n instruments and strategy buy and hold (to next rebalance) each instrument has a specific weight (weights add up to 1) Please suggest ideas on how to correctly convert weights to the
Hey all, I would like to ask if anyone of you know how to get enum as an input variable in string. I tried this #define method and StringFind() function but it produce some error and warning as per this picture. Here I also attach the code I tried to write: #define Nonfarm_Payrolls "Nonfarm
Hello, Im developing an EA that uses some custom indicators, wich I load with the iCustom function, like: almaHandle = iCustom ( _Symbol , PERIOD_CURRENT , "name" ); Now, I have the problem that although I of course know what are the parameters of those indicators, becuase I can see them in the
  high low counter  (1)
if (IsNewBar()) max_contada = false; if (IsNewBar()) min_contada = false; if (contar_max_min == 1 ){ if (!max_contada && rates[ 0 ].close > rates[ 1 ].high){ rompeu_max++; max_contada = true; } if (!min_contada && rates[ 0 ].close > rates[ 1 ].low){
Hey all. Wonder if anyone can help. I have a python application that creates a batch file and an ini file for me for the purpose of batch processing tests with various test data. This works great and generates a batch file and an ini file for me. However when trying to use this via the batch file
I have read a number of articals in this forum but still don't have solution. Can someone tell me what OpenCL code to add into my EA in order to use GPU for backtest
Hi everyone, hope you're well I have a confusion between position ticket numbers and order numbers, Unless I'm mistaken, yesterday in my backtest I found myself with an identical ticket number for a position and an order? Is this possible? Should I use the unique Deal ticket numbers? Try to read all
Hi, i often test mql behaviour in a script. In this case I noticed that an array which is filled, is not initialized (and keeps old values) if executing the same script again. How can I force to have a clean environment when starting the script again? void OnStart () { int aSize = 6 ; int
yo guys, So there has been a new python integration version coming out I'm hearing and it is ok with new python version. Does it like numpy 3 now too, I need it for tensorflow to work well :) Thenks
How can I implement logic in my EA that it may work on demo accounts but not on live accounts without a license key
Hi everyone, Do you know why the RequestPosition method of the CTrade class always returns 0 ? In other words, what is the simplest solution for retrieving the ticket or identifier of the position that has just been opened using my CTrade class? I thought I saw in the forum a solution to compare the
  Error Martingale  (2)
Hello, I'm encountering an issue with my Martingale implementation in my EA. The lot size progression is inconsistent, even though I set the multiplier to 2.0 (or other values). Instead of the expected progression ( 0.1 , 0.2 , 0.4 , 0.8 , 1.6 for 2.0 multiplier), the lot sizes jump unexpectedly
I've loaded a previous optimization (opt file) that was stopped before it was finished - and I see all the results that was done , but when i click start the optimization, then it start all over from the beginning and doesn't continue from the last total passes. Does anyone know why and how to
I wanted to add commission for the EURUSD custom symbol I had downloaded from tickdatasuite but it didn't let me click "OK" to save and close the window
Please, what are the TradeTimeFlags? Where are the constant enumerated? I found no further information on documentation here. https://www.mql5.com/en/docs/standardlibrary/tradeclasses/csymbolinfo/csymbolinfotradetimeflags
Hello, i used to use CTrade class on Buy,Sell functions without any problems now i need to use BuyLimit,BuyLimit ,in the first of used i face error expedition time, I tried to fill the two inputs for the expiration code and I faced another error "CTrade::OrderTypeCheck: Invalid order type"