Expert Advisors and Automated Trading - page 67

Hi, traders and developers! I’ve wrote an EA code for a simple strategy but it has a problem related to the selected timeframe to open trades. Can someone helpme reviewing it to fix this problem? Thanks in advance. Olá, traders e programadores! Escrevi um código EA de uma estratégia simples, mas há
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(
After running a back test (MetaTester) on a demo account, if I select the History tab in the Toolbox, I can see all the orders/deals that have been processed. My question is, is there a way to print the contents of the History tab as I am not able to
For some odd reason my script is constantly requoting buy orders but never sell orders... here is the error I get 2023.08.12 06:38:38.484 2022.10.18 07:14:54 CTrade::OrderSend: instant buy 0.01 EURCAD at 1.34759 sl: 1.34509 tp: 1.35009 [requote (1.34759/1.34809)] As you can clearly see there is
Hello. Got: 2023.08.10 14:03:02.176 Trades '3008608544': failed sell stop 10 WINQ23 at 118810 sl: 118815 tp: 118805 [Invalid expiration] I did many searches, tried many things and nothing result in success for the sell stop pending order i am trying to place. I attached the image of my broker
I know this sounds weird since we have a built in strategy tester, but what i want is to have a program that we select for example our metatrader terminal and also select the robot we want to run and to seperate backtestings, at the start of each week or each month, and at the end of backtesting to
I'm running some optimizations on the MQL5 Cloud Network and many times it only utilizes 200-500 of the thousands of available agents. Is it possible to have it utilize more agents to get the work done faster? My guess is that the network only wants to allocate 5% or so of the agents so that other
Hey all! I'm starting a personal project, a custom copier that supports MT4 to MT5 (and viceversa) communication. I'm aware that on MT4's case the common folder can be used to store and read info between terminals, howeve I couldn't find anything too helpful about communicating between MT4 and MT5
as per my search through Wikipedia, i get this answer : Algorithmic trading is a method of executing orders using automated pre-programmed trading instructions accounting for variables such as time, price, and volume. [1] This type of trading attempts to leverage the speed and computational
Hi, I limited my EA to run every minute or at the open of a new bar. I also want to do a partial close for my strategy. Because my EA only runs at least for every minute, sometimes when the volatility is high the price moves touching the partial close level and reverse at the same minute leaving the
I am using python with Mt5 and testing with Demo account This is my Close Request Data- >> Req: {'action': 1, 'symbol': 'GOLD#', 'volume': 0.24, 'type': 0, 'position': 933862679, 'price': 1919.2, 'deviation': 20, 'magic': 234000, 'comment': 'DD', 'type_time': 0, 'type_filling': 1} And this is a
I am trying to read the buffer value of an mt5 indicator , which has 4 buffers and 2 input parameters and this is how i am using it in iCustom : iCustom ( NULL , 0 , "LTD by KDMfx" ,inp1,inp2, indbuffer , candshift ); where inp1 and inp2 are the 2 input parameters of the "LTD by KDMfx" indicators
No response in Questions from Beginners thread so I'll create a new one, sorry for that! Hi. Tell me, please, how is the distance between the borders and the regression line calculated in the default Regression Channel in Metatrader ? Yeah, I know, it is said clearly in the documentation : >The
Hello all. I have 3 objects instantiated from a class in OnInit and I need to use these Objects in OnTick too, However without instantiating them again in OnTick it is not possible. I have tried passing them by reference to OnTIck and that did not work either(in this case the OnTick function does
Greetings, I'm a bit puzzled by the following. The documentation recommends calling PositionSelect() before calling PositionGetInteger(), which I'm doing as follows: int sellPositionCount = 0 ; if ( PositionSelect ( _Symbol )) { for ( long i = 0 ; i < PositionsTotal () ; i++) { if (
Dear Coders, I'm working on an MT5 Expert Advisor. I would like to use the OrderSelect() function, but it doesn't work for me. Every time I get "Order not fouund" error message. Here is my code: int ot = (int)OrderTicket();if ( OrderSelect(ot) ){   Print("OrderSelect done."); // pr() function is...
Hi, Bid & Ask price always zero for most of the symbols using python symbol = "CAG" symbol_info = mt5.symbol_info(symbol) print(symbol_info.bid) print(symbol_info.ask) for below symbols price are available AAPL__188. 28 ADBE__495. 32 ADI__190. 6 ADM__78. 61 AES__21. 07 CFG__26. 75 DAL__48. 17 K__67
Hello, this position is sent with magic number -1. When i'm hover the position, MT5 shows me this ID, but the position have Magic -1. It's a MT5 bug? Thanks so much
I am backtesting an EA and for some reason whenever I open the backtest and select the option visual mode these two lines appear on my chart. One above the price and one very next to it. I tried using other experts but it didn't disappear. Can someone help me
Hello everyone Im struggling with getting the date out of mql5... ive read all that mql5 instructions... but im too stupid to get it right as it seems. I initiate these two functions: bool TradeDayOfWeek() { MqlDateTime tm; TimeCurrent (tm); int day = tm.day_of_week; return ((TradeMonday
Hello People I am just curious if EA can commnuicate with strategytester duing its optimizaiton process. I can see that with "ParameterGetRange" and "ParameterSetRange" you can freely get and set optimizaiton parameters on strategy tester from your EA. However I have not found the ways of...
Good afternoon forum, I have created a grid bot which trades in both directions (treated separately); the initial buy order and subsequent sell orders have their magic number set as: 1111. The initial sell order and subsequent buy orders have their magic number set as: 2222. Each time an opening
Can anyone help me to code this code correctly? I need a string variable and still don't quite understand how to do it. ... 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 "
Hello Everyone, I'm new here, long time ago I used to be a programmer - changed my mind but I restarted a few weeks ago to build my own trading script. I'm used to stock markets - not with Forex - but I did read a lot about it, and try to understand everything I've read. I've got good notions about
hi, Im writing a simple EA. this is my code: //+------------------------------------------------------------------+ //| ProjectName | //| Copyright 2020, CompanyName | //|
I open 5-6 positions from the MetaTrader 5 Terminal. Then, via Python-instruction ‘positions_get()‘ I download the open positions and put them in a pandas dataframe. After that I close all open positions with ‘order_send()‘. The problem is that I can never close all positions. Sometimes it only
  New Coder  (3)
Hi Guys, I am trying to code a mt5 EA. I am struggling with the TIME array. I have managed for my code to operate however it opens thousands of trades once conditions are met, to mitigate this I am trying to make it so it can either only trade 1 trade at a time (problems with EA seeming to stop
hi all, i am looking for help in understanding the differences in coding for mql5 EA , between forex and indices (example dax30) and commodities. The request is open-ended and not specific, because I guess there are various data to set. I am waiting for someone who works with EA on indexes like
request = { "action":mt5. TRADE_ACTION_PENDING , "symbol":symbol, "type" : mt5. ORDER_TYPE_BUY_LIMIT , "price": float (price), "volume": float (ORDER_UNIT), "comment":'Test_code'
What is the difference between Buy() method and PositionOpen() method in CTrade class? if they are the same, whats the point of having two different method that basically do the same thing in CTrade Class