Expert Advisors and Automated Trading - page 66

Hello dear community members, I'm facing an issue while writing an MQL5 script to access the profit and loss values of closed trades. In short, I've been trying to use the relevant functions to retrieve the profit and loss values, but I always end up getting 0.0 as the profit or loss value. I've
Does anyone know if there is any type of EA or Trade Manager that allows grouping of orders to see the individual Net P&L of multiple spread trades? Because when trading one spread pair (two instruments) it's okay, but when trading multiple spread pairs it becomes impossible to tell what the net
Hi, Have a code from standard library //snippet from a standard library module Expert\Signal\SignalMA.mqh with additional Compare() and LongCondition() class CSignalAMA : public CExpertSignal { protected : CiAMA m_ma; double MA( int ind) { return
Hello, I am trying to create an EA where the condition is : At the beginning, price is between support and resistant line. if price break resistant, then create only 1 Sell stop pending order price at middle of S/R. but if price back to between S and R price, and going up and break the resistant
Hey people, I want to create an Expert Advisor that trades on trending support and resistance like what's shown in the pictures below but I have no idea where to start. Can anyone provide some help? Thanks :)
Hi guys I'm writing an expert and I need it to stop opening positions and close all positions and orders 1hour before important news time how can I do it? I searched a lot, all is about using MQLcalendar but there is not such a file named "MqlCalendar.mqh" in my metatrader5 I tried to reinstall and
Hey, im following this guys tutorial and my code is not generating any buy signals or print statements saying that i should buy or sell even though i can clearly see that criteria is met. why do you think is going on here? I followed the guys code to the letter i believe. video
I can't change value in Trade Settings (MT5 tester setting). Anyone else encountering this problem as well
Hi all, I am quite new with MQL5 and trying to optimize an EA I wrote. I have no trouble testing my strategy on a single pair but once I try to optimize the inputs or test it on multiple symbols, the test run but not a single trade is taken on any pass. Any one had a similar problem? input double
Hi there, I'm trying to modify my current request in python, however I'm getting a 10013 error that indicates the request in invalid, whatever that means. I don't understand what the problem is here. Here is my order info: Out[103]: TradeOrder(ticket=175410556, time_setup=1692368155
  Buy pending order problem  (21   1 2 3)
Hi all My EA will not activate a buy pending order, now I'm assuming the problem might be with the Open predefined variable, if you know the problem please assist. #property strict #include <Trade\Trade.mqh> #include <Trade\SymbolInfo.mqh> #include <Trade\PositionInfo.mqh> #include
Hi Guys, wondering if is there any function to set focus on specific chart? i wrote a script to open charts with ChartOpen (MySymbol, PERIOD_D1 ); however whatever chart i run script from keep the focus not the newly opened charts, so for example if i wanted to use Comment or other functions etc on
  last bar  (2)
Hello Guys, i want my ea to recognize when a new high or low has been made, i.e. higher high or lower low. I want when that happens then go short or long but i do not know how to call the last candle or how to figure out the value of the last candle so that the program knows . Thanks for your Help
Hello everyone. My EA successfully sends buy orders but for some reason cannot send sell orders. When I try to send a sell order OrderSend function fails with 4756 error code and MqlTradeResult retcode is 10004. The following is a part of my code that sends orders. void openPosition( string
Hello , thanks in advance, i don't know how to ask in the mql5 area! ok this is a MQL5 code that i write with some example and copy from a similar code i tried to build a EA that Close Partial lot in determinate price , i use this for futures markets , specifically symbol, Micro Nasdaq, this should
  Unsupported filling mode  (33   1 2 3 4)
here is test script: MqlTradeRequest request;&nbsp;&nbsp;MqlTradeResult result; void OnStart(){ request.action = TRADE_ACTION_DEAL; request.symbol = "AUDCAD"; request.volume = 0.01; request.type = ORDER_TYPE_BUY; request.type_filling = ORDER_FILLING_FOK;/// request...
Dear MQL5 Community, I kindly request another pair of eyes on my 4756 ordersend issue! :) Not a coder by trade, I typically work with freelancers. However with a bit of free time this summer I decided to try and work on a basic MT5 MA cross system on my own. I've gotten more or less to the "end" in
Hello, This is just to confirm I don't stuff up something before I start. I have 16 charts on a MT platform located on a VPS. I would like to turn off 4 EAs on 4 charts but keep the charts with the EA on the VPS, so option is there to turn on later. So, I just turn off the 4 EAs and then upload
I am having issues with my simulations, it happens visual mode my expert works as it should, but when I try non - visual mode, shows a lot of mistakes , my expert is a multiframe expert that looks for several timeframes from biggest to smallest with confirmations in several times. I don´t think it
Hi,I have a problem after installation of EA . I cannot trigger a trade using EA. There's a display on the Chart that shows " Turn on algorithmic trading in Expert properties". There's none in my old set-ups. Kindly see attached photo with file name 'trade problem'. There's also a different labels
Hi What indicators are importent for scalping strategy? Any usefull code example? Best regards J
I have developed an EA that I am hoping to soon use on a prop firm challenge however, I understand that live trading brings a new wave of variables to consider. The first question I would like to ask is, what else (on top of what I am about to present) should be added to a Decision Matrix to aid in
}' - unexpected end of program and '{' - unbalanced parentheses Auto-translation applied by moderator
Hi guys I'm building an MT5 EA based on a range breakout strategy i want the EA to Enter the trade at the low of the lest bullish candle before the breakout and the stoploss at the high of it like you can see on the image below Anyone know how can i do that please Thanks
Hi. I'm trying to get 2 values from a free indicator downloaded from the market. These are the indicator parameters: This is my OnInit code, that works fine because I get a message for a valid handle: int OnInit () { //--- ResetLastError (); iIndicatorhandle = iCustom ( _Symbol , _Period
Hello, I try to calculate expected profit (D) and margin requirement , but I get strange result in Tester. On Demo and Real account, it is OK. I use this code (Script) over account, and same as Expert in Tester : void OnStart () { double D= 0.01 // Volume * SymbolInfoDouble ( _Symbol
I have made a simple expert advisor with these specifications: It is based on double simple moving average cross, fast=9, slow=21. It should only enter positions on open price of new bars. To achieve this, the modeling type is "Open prices only". It uses the CTrade class to open and close positions
Hi, Sorry for probably an easy question but I just started learning how to mql5. Let's say I have two simple pending orders, a long and a short, waiting to get triggered trade.BuyStop(0.1,longpriceentry,_Symbol,LTP,LSL, ORDER_TIME_GTC );
Hello Please could somebody tell me if it is possible to program an EA with Stop entry orders with OCO (One cancels the other)? For example, when trading Donchian channels , the EA would place Stop entry orders slightly beyond the upper and lower part of the channel and when one order is placed, the
Comments that do not relate to the " Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes ", have been moved into this topic