Expert Advisors and Automated Trading - page 56

Hello. Kind regards to anyone who might read this. I would like your help. My EA compiles without errors, but when I backtest it, it does not open trades automatically. Can you please help me fix this? So that I can open the trade when the conditions are met? Thank you in advance. #include
Hi people, this is my first post and I'm starting right away with questions. I've done some EAs with the help of YT and, documentation and chat AIs, but nowhere can I find an answer to the question of how I should create working code so that my EA can run on the same Timeframe and Symbol at the same
Hi expert, i try to write a code for stop loss. i wanted to write the open position hit SL or closed the position if MA crossed. this is my SL for buy double sl= ask -InpStopLoss * SymbolInfoDouble(_Symbol, SYMBOL_POINT ) ||fastbuffer[1] >= slowbuffer [1] && fastbuffer [0] < slowbuffer [0]; this is
I am creating a ea using a prediction method for the open,close,high,low price during an hour (not included here). When creating market orders or using buy limit/stop orders I keep on getting failed orders. Is something off with my code or are there any things I am not seeing? if (predictedOpen <
I created a Dialog and added a number of (CButton) buttons to it. Each time I click a button everything seems to work as expected without fail...or was I just lucky? I then replaced the dialog/CButton's with buttons created by the CChartObjectButton OOP class. 9/10 times it seems to work, but
Dear Friends, I know we can comment during opening new trade. but I am wondering if there is possibility to comment at the time of closing trades in MT5??? Any comment will be highly appreciated
Hello Everyone, Since build 4570 of MT5, I have had the problem that the function PositionsTotal() returns 0. In build 4410 this is not the case. I need the function to export data in an EA so I am looking for a solution. This problem occurs on an account with a signal subscription. The problem
Check this code When you run this on ohlc and uncomment the newbar function it returns different results? Can anyone explain what it skips on 1minute ohlc?? #include <Trade\Trade.mqh> #include <Trade\OrderInfo.mqh> //+------------------------------------------------------------------+ CPositionInfo
If you can help me resolve this situation, please let me know. I was thinking about the process after StopLoss in OnTradeTransaction(). I wrote the following code. When I backtested with this code, it did not work as expected. The reason was that HistoryDealGetInteger() only returned 0 no matter
Can someone please help me fix the errors of my script...I don't know how to
I have a custom indicator that produces a red arrow when the trend is going down and a green arrow when the trend is going up. The problem is when the arrow is drawn my trade doesn't go through until the next candle. I am specificially using OnTick() when I call the orderSend function. Is there
So I was experimenting to try and fully understand the way that Experts and Indicators work, especially for slow indicators. But when I did a base-case test, just an Expert with a fast indicator, I noticed that the OnTick (or at least the print inside the ontick) does not call sometimes, even though
Hello, i'm pretty new to automated trading and have a problem. I'm trying to programm a EA that open a trade (under specific conditions) at the high of the previous candle. My problem is that i try to set the stop loss at the low of the previous candle. I got the Low and the high of the previous
i am searching for a week and do not get the answer so i decide to ask you guys. i want to buitd ea which use renko chart. i ask my friend who have computer skill, and he replied that he cannot build it because he doesnt know how to make EA open offline chart. he cannot do because renko must use...
Hello community, i know this has been discussed already but not really solved so far. When i make a CopyRates request in onCalculate for a symbol, which is not the chart symbol, then CopyRates call SOMETIMES returns 4401. If i recompile my indictor or change timeframe and then back, then CopyRates
please can anyone support me to fix this code it showing that '-' - open parenthesis expected for (int i = 1; i < Bars - 1; i++)
Hi I've written a very simple code to buy if a cross between MAs occurs. But the error is "Invalid order type ". All the parameters could be found like ask and Bstl but it could not open position. this is m_Trade #include <Trade\Trade.mqh> CTrade m_Trade; can u help me please. void
Just a quick question for an EA, I know about the error " not enough money " that sometimes pops-up when trying to place a trade above certain limits. My question would be, is it any (maybe easy) formula to calculate the trade parameters so it will avoid, or at least alert the user, that the trade
Hello, I have been struggling for the past 2 days to understand what's wrong with my code. I am new to coding. I have done similar EA's, but this is the first time I encounter this issue. All seems good to me, I also used chatgpt to recheck the conditions and make sure to debug the errors and type
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...
I couldn't get the trade bot to work, can you help me
  Python or MQL5 — Code Migration  (42   1 2 3 4 5)
Dear support team, I hope this message finds you well! My team is looking to migrate our highly profitable trading algo to another home and we are trying to find what platform will provide the most benefits. The following are some questions we still need answers to that we have been unable to find
Hi fellows coders, I tried to use Shared memory (through File Mapping), by first setting up the required space using CreateFileMapping. But i kept getting error 6 <=> INVALID_HANDLE ( the error is collected through the following function kernel32::GetLastError() ). Even tho i tried multiples
Do we have any recourse if I bought two Expert Advisors from a seller who then stops selling all products ? Of course I activated the products but after about 2 weeks of use, the seller stop selling all of their products because they do not want to sell lifetime licenses anymore. The EA's were
I've been working on an EA, and over time, I've added several libraries that depend on other libraries. Since I was collaborating with another programmer, the code has become quite extensive and difficult to manage. I know it wasn't the best way to organize it, but now I'm wondering if there's an
Hello, I'm having trouble solving a problem. A source code that initially didn't present any errors is now showing 102 errors during compilation !! Unable to find the source of the problem. I consulted ChatGPT4, and it provided the following response below. In your opinion, since I'm not a coder
Hi All, I have written a logic in MQL5 in Meta trader 5 but when I backtest this strategy I get this error: failed [Invalid request] Error opening order: 10013 I tried so many things but the error is not getting resolved. Need some help
// Input variables input double TradeVolume= 0.1 ; input int StopLoss= 1000 ; input int TakeProfit= 1000 ; input int MAPeriod= 10 ; // Global variables bool glBuyPlaced, glSellPlaced; // OnTick() event handler void OnTick () { // Trade structures MqlTradeRequest request; MqlTradeResult result;
#property copyright "FrostBite" #property link "orbilloalvin157@gmail.com" #property version "1.00" //+------------------------------------------------------------------+ //| Expert initialization function |
Hello guys, I have some advice for an error that I can't understand. I developed an EA on mql5, everything works precisely, I only have one problem that I can't solve, sometimes (it happened 3 times in about a month) the set take profit is not respected and the position is even closed negatively