Expert Advisors and Automated Trading - page 59

Hello everyone, I am trying to code a function to return the accumulated daily Profit/Loss, but I cant make the code work. Can any guru here be so kind to help me? I Appreciate! double ProfitAll( datetime & XHoraPrimeiroCandle, double & XProfit) { int err= 0 ; if (IsFirstBar()) {
Hi All, I want to to know if there some easy way to partial close automatically on the bases of total TP. For example Trade buy XAUUSD 1 lot @1800 with TP 1900. Then automatically partial close 50% 1850 ----> partial close 25 % more on 1875 and Then full close 1900 . I FOUND some EA does that but i
I have my EA which I have split into some files for readability. So I have one main .mq5 file and 2 secondary mqh files that I import into the main .mq5 file. While this is OK, in order to make this work, I need to have my main .mq5 file in the MQL5\Experts\Advisors folder, and the imported .mqh
I am working in a grid system where 1st position will open with current price of a pair, 2nd position will open if it gets down a certain pips and 3rd position will open again after a certain price.1st and 2nd position opens correctly but 3rd position opens but with the same value as the 2nd one
Hello, I have just noticed a discrepancy in the Strategy Tester when examining the spread for EURUSD on the M1 timeframe. In the chart, I have both the Bid and Ask lines displayed. I also have the Market Watch window and the Data Window open. Here’s the
I selected NZDUSD, AUDUSD and they cannot be backtested? I selected the date range from 2018 to 2024, but the results are showing only from 2024
Have I made my point? how can I do this and how does the 1 minute ohlc work? should I make it wait till second 59 or something like that? has any one have this solution? Thanks
I'm experiencing problems with WebSocket closure and EA deinitialization in my MetaTrader 5 Expert Advisor. The main issues are: When removing the EA from the chart or closing the chart: MT5 hangs briefly The Expert tab still shows the EA as connected The server-side still sees the EA as registered
Hi guys i am in MT5 i try to open inthe same time one order in NZDJPY in buy and one order SELL in NZDUSD i have create an expert i place over NZDJPY and push the button , the button call some function and open only a BUY NZDJPY and not openNZDUSD this is my part of code string _Apri_Correlato(
Hey all :) i'm an absolute newbie and barely grasping the basics, can anyone assist in recommending when building a bot for trading what 5 signals are recommended, free if possible due to having little capital to set up at this stage.. the struggle is real :'? any assistance is appreciated :) thank
First greetings to all fellow traders. I am interested in which robots from the market you recommend for long-term stable trading with funding capital (NextFunds or similar). I would like to diversify the portfolio with 5.6 quality low risk robots and aim for returns around 3,4% stable and go to a
Hello, I have this issue when i want to upload my EA for selling : Invalid version name format I don't understand why because my EA is on .ex5 Thank for your help
Example MA_Array[i]= iMA(Symbol(),0,5... ...i); crosses over MA_Array[a]=iMA(Symbol (),0,21....a); I receive 'MA_Array' - invalid array access 'MA_Array' - invalid array access
I have defined a few macros for constant values. Some macros are dependent to another for example #define x 14 #define y x+ 7 #define z y* 5 So I wonder these values are going to be calculated at the run time? or they are going to be calculated when compiling and the final values will be put to the
I am trying to create a code that will delete my orders as well as pending orders. Unfortunately I cannot get any results but only error like "UNKNOWN RETCODE 0" and "ERROR 4014". The code is : void ClosePendingOrders() { int total_orders = OrdersTotal (); // Ottieni il numero totale di ordini
Below in the coded section, I have a CGraphicalPanel class representing my Panel . But I see when minimized the panel in X dimension, bit too narrow. How would I change the the size of the panel when minimized? Would like the panel to be large in X dimension when minimized. All I know that
My EA measurng the max DD every tick, and saving the highest drawdown. But it is usually a bit higher than what the backtest reports claims. I am testing with Every Tick Real Ticks. The MT5 backtest report claimed the Max DD is 969.58 USD, while my EA claimed that it was a bit above thousand. To
Hi all, after optimizing several strategies, what is the best/easiest way to load them up on to an expert advisor in another computer? I copy and pasted them to google sheets and the settings for each parameter are in individual cells. I realize I can use formulas to format them but I see they will
Hi guys i have this part of code (is free and is not mine ) /** * Create the info-string for opened and closed order arrows. */ string formatOrderArrowInfo() { // order is already selected return ( StringConcatenate ( OrderComment(), " (" , OrderMagicNumber()
i have encountered this error : "improper enumerator cannot be used " my code below , can anyone please help. enum Applied_Price { Close_Price = 0 , Price_Open = 1 , Price_High= 2 , Price_Low= 3 , Price_Median= 4 , Price_Typical= 5 , Price_Weight= 6 };
  Deal magic numbers  (29   1 2 3)
Hello, I'm testing some systems on MT5 and I found a strange thing about History Deals. I count profit/loss of history deals but if I filter them with my EA Magic number I can only found DEAL_ENTRY_IN and not DEAL_ENTRY_OUT. It seems that DEAL_OUT do not have my Magic number. I searched on internet
Is it possible to knowingly provide login details for the purpose of sharing, downloading and using EA? I have a situation in which I consciously want to give a friend the EA I have purchased from my pool. Is it possible
Hi, we are using MT4, and want to work with a new broker. They do not support MetaTrader inherrently but they provide a pretty good API gateway on Pyton and have a good client. We want to run our EA's on that broker. Can we use MT4 or MT5 as a client and connect MT client to that broker? May be wit
gives me the following error: '<' - open parenthesis expected this is the context: if ( Bars < 5 ) return ; If I remove this line there are 0 errors. It's a simple EA (MQL5) based on the famous pattern "IDNR4" (Inside day narrow range 4). thanks, kind regards Improperly formatted code edited by
Here is the code for my iRSI and I have altered the period, RSI period etc and there are no errors with the code but it sets the rsiValue in line 2 as 10 constantly regardless of what the actual in-built RSI is. Any help? It was working before but I can't find the backup where it worked so I cannot
Hello Team, I have around 20 different EAs running. All working well, but some of them are very goos without any loss after yreas of working. I have created a "master EA" which trails all my open positions. But now I want to trail those EAs different, which are very productiv. I know them by the
Hi, I am trying to fix some issues with my martingale algo. The lot size isnt doubling after a losing trade The Total Profit/Loss for the day is not updating I have research the forum and Im still looking for the solution for this code, thank you #property copyright "Copyright 2024, MetaQuotes Ltd."
can anyone please tell me why this code is not running ,it is modification of one of my previous expert advisors , which are running perfectly fine but this one is not. i really need to solve this please help me,deadline is tight #include <Trade/Trade.mqh> // Include the trade library for trading
  Objects in MQL5  (2)
Hello, I´m stuck with my code. I always get the "invalid pinter access" failure and I can´t fix it. Would be great if someone can see where I´m going wrong. class CAOI : public CObject { public : ENUM_AOI_TYPE type; datetime time; double highAoi; double lowAoi; }; CArrayObj aoiMn; CArrayObj
Hello All, As an example, I'd like to display an indicator created by an EA on the parent chart. I can do this using the below code, I worked this out with a little help from Google and on line help, so you'll probably recognise the code (ish). Here is my open code: /* open_indicator() * *