Expert Advisors and Automated Trading - page 59

Hello, I'm stuck with what should be an easy problem to solve, apparently, but I'm going in circle without finding the answer (read a lot of thread and MQL documentation). I want to check if a specific position is currently opened by using either the magic number or the order ticket of the
Hi I'm simply trying to create a button that prints "1" when I click it with the following code. However, after I added the EA to a chart and click the button nothing happens. Does this mean the OnChartEvent() function not being triggered? What's wrong in this case? Improperly formatted code
How to integrate Arrayfire library(https://arrayfire.org/docs/index.htm#gsc.tab=0)into MQL5
ulong ticket = OrderSend ( Symbol (), ORDER_TYPE_SELL , LotSize, ask, 0 , stopLoss, takeProfit, "Sell EURGBP" , 12345 , 0 , clrRed , 0 , 0 ); I wonder what's wrong in this code
Hi,  I need to deb an MQL5 EA using tick data that I would create on purpose, so to understand a strange behaviour i have noticed during real testing. If I use backtesting or real testing I may not find extreme situations that make the bug happen again. I know in 2012 it was not possible to backtest...
Hi! Today I experienced a freeze in my EA when updating a pending order's stop loss and I'd like to know what can I do to avoid this situation in the future. So, by what I noticed, when we send an order to update the stop loss of a pending order, the MT5-broker system sends 4 messages like this: DR
The values are: lot = 0.15 retracePrc = 1.23196 slPrc = 1.23409 tpPrc = 1.2277 Also current bid/ask = 1.22720 / 1.22726 This is the code where I try to open a position: myTradingControlPanel.PositionOpen( _Symbol , ORDER_TYPE_SELL_LIMIT , lot, retracePrc, slPrc, tpPrc, "Sell Trade. Magic Number #"
Hi guys! I am trying to track the high and low of the current 15min bar on a give chart. I have this script so far: //+------------------------------------------------------------------+ //| TrackHighLow_EA.mq5 | //|
[Deleted]
What of if i get the worst EAs and reverse them, would they produce me the best result considering commission , spread, swap and speed/frequency
Hi all I place an order and stoploss is beeing trigged no matter i change it to a different value. It´s not been reached. Any hint? MqlTradeRequest request={}; //https://www.mql5.com/en/docs/constants/structures/mqltraderequest MqlTradeResult result={}; ZeroMemory (request); ZeroMemory
Hi guys, I have created an EA and backtest satisfied my criteria. However, in terms of stability of the EA, I don't think it's quite reliable since I don't use deviation at the moment. Now I started a forward test but it will take me several months before I can compare results. So my questions for...
Hi, When day-trading, pulling orders each evening and reinserting them again in the morning is time consuming. Although I copy them into excel so that they can be pasted back into a new order ticket, this takes a while, particularly if there are a lot of orders. In MT5 would it be possible to...
  margin required  (2)
Good day everyone. Please how do I calculate margin required for MQL5 //I know the one for mql4 MarketInfo( Symbol (), MODE_MARGINREQUIRED) Thanks
  Trade Blocker EA  (6)
Hello, I'm trying to code a EA to block orders being opened once the max number of trades is opened on the terminal. But I'm keeping Autotrading enabled. Just trying to block Additional trades from Any charts or EAs. Here is the code so far: If there is a EA for this that exists or a way to Limit
//+------------------------------------------------------------------+ //| try17.mq5 | //| Copyright 2022, MetaQuotes Ltd. | //| https://www.mql5.com |
[Deleted]
Good Afternoon, As I increase the number of remote agents in my LAN, I am staring to get the "occupied by another terminal" message @ Diary tab when running Strategy Tester. Unfortunatelly the only way I see to unlock the port is rebooting the machine. Does anyone know the reason for this message...
It appears that I'm having some difficulty understanding MT5 optimization and forward testing, but for now, I'll focus on optimization. In certain situations, I've had highly profitable optimizations, which I can divide into two sections: optimizing over a large three-year historical data and
I'm trying to understand the Standard Library by working my way from top->down. I cannot make sense of what the following syntax is trying to accomplish. Its found within the Include\Object.mqh. It appears like its the highest Object from which all other objects have inheritance. Perhaps its a...
Hi, I am new to EA & MQL5 and learning this new system I have created my Code for Trailing Stoploss but it is not working during Testing. Please help me. ... Improperly formatted code removed by moderator. Please EDIT your post and use the CODE button (Alt-S) when inserting code. Hover your mouse
From your experience and research what advise would you give to someone trying to create an AI based expert advisor ,what to look out for what could be added ,what could be requirements in terms of computing power
  EA name search  (2)
Hi all, I'm looking for the name of an EA that has this settings (see image). It is supposed to be a scalping EA. Can someone help ? Thanks in advance
CPositionInfo ::Type() gives always 0, for Buy and Sell positions. double ask = NormalizeDouble ( SymbolInfoDouble ( _Symbol , SYMBOL_ASK ), _Digits ); double bid = NormalizeDouble ( SymbolInfoDouble ( _Symbol , SYMBOL_BID ), _Digits ); double P = NormalizeDouble (
Hello friends, Please can anyone help me resolve this issue? I have watched videos on how to install EAs on MT4 and MT5 Trading Terminals but I have installed 2 EAs on the MT4 and MT5 Trading Terminals and none of them is appearing even after the under listed actions: (1) Restarting the MT4 and MT5
Hi! I'm currently using two indicators in an EA (I'm novice) and would like to create a dependency between the two. More specifically, I'd like that the result of the first indicator be used as one of the arguments of the second. Indicators are however usually declared in OnInit (handles created
Hey I am trying to create a Macd EA that also has a stochastic and MA indicator integrated together in it. I'm currently working on the Macd portion of it and am confused on how i can make the EA publish a drawing/arrow on the chart when the condition to buy is met on the macd. I need to debug the
So i create a multidimensional array, 2 of them to be exact as an example. arrbuy[][3] arrsell[][3] these will store all my buy and sell positions that are open. I then populate the index with arrayresize and use the number of open positions as the size of the first dimension for both arrays. I then
Hi I'm quite a newbie when it comes to programming EA's and programming in general. I have a situation where I have been coding an EA for multiple symbols, and my global variable keep on changing to zero after I have assigned the value of 1 to it. The globally declared variable that keeps resetting
Good afternoon forum, As per the title of this thread, I want to limit my bot from firing in many, many positions into the market. I am happy to compound and build in to positions each time an order is triggered but I would like a maximum limit to be able to manage my maximum exposure. Is there a
Hi I'm confused about closing a trade. I am working on a multi symbol EA. So I have an array of symbols that the code works through. I also have a corresponding array of tickets for any trades that are opened. I'm trying to close trades when exit conditions are met, using their ticket number. Most
Hi! I'm aware that renkos have diminishing returns as timeframes go up. In fact in TradingView.com I use renkos on a 1 second chart and the results aren't bad! I'm new to Metatrader and I'm curious to know if renko bricks can be used with e.g. a 1 second timeframe, or even "faster" (more granular)