Expert Advisors and Automated Trading - page 45

Hello community. I am currently coding an ea which will allow me to know if the market base line of the TDI indicator (trading dynamic index) which is an exponential moving average is inclined downwards or upwards. In my research I saw that I could use the slope which, if positive, means that the
Good day. I'm having an EA which is working very well without any problem but whenever I upload it to the market it always says Not validated and I don't understand why cause it has no errors. Can anyone maybe help me pass the validation 🙏. Thanks in advance
I have a trading algorithm set up with the MT5 python system and I noticed that it doesn't consistently execute trades as it should. I don't get any error messages, and if I re-run the algorithm again it will sometimes execute the exact same trade that didn't previously execute. No variables are
I've learned mql5 iteratively as I've been building my system. In the process, gotten better about abstraction, functional/oop design, using structures and arrays, reusing vars, constants, etc. My issue now is optimizing my code. It runs fine live since single thread performance isn't that big of a
When you close a trade partial, you see it get a comment "from # ticketnumber" and in the order history it get the comment "to # ticketnumber" When i want to code 3 partial close areas for a trade, then i need to count how often i have already close partial from the first trade, but i am looking for
for ( int i = PositionsTotal () - 1 ; i >= 0 ; i--) { ulong ticket = PositionGetTicket (i); if ( PositionSelectByTicket (ticket)) { pos.Side = ( ENUM_POSITION_TYPE ) PositionGetInteger ( POSITION_TYPE ); ENUM_POSITION_TYPE side = ( ENUM_POSITION_TYPE )
I have made an ea with my conditions and it cannot open a trade. Who can assist me
  Help With My EA  (5)
I keep getting this no money(error 134) Error when the strategy tester tries to Test the Ea on 1m timeframe ? test on EURUSD,H1 (netting) strategy tester report 21 total trades test on XAUUSD,D1 (netting) strategy tester report 16 total trades test on GBPUSD,M30 (netting) strategy tester report 9
Hi I am building a custom EA for MT5 When it is attached to a chart, the Socket Connection is made in OnInit() function & the connection is closed in OnDeinit() function while detaching the EA. My code is: int socket = - 2 ; // Socket Variable bool soc= false ; int OnInit () { if (socket == -
Hi all, My goal is to write a simple EA that cancels pending buy stops or sell stops whenever current price moves past original stop price. The EA - code attached below - works flawlessly for test sell stops (commented code for test sell stop). Yet, for test buy stops, the EA cancels pending order
[Deleted]
  EA Freezes  (3)
Sometime EA Freezes and there is no error. My EA runs on OnTimer I keep printing TimeLocal() on timer on comment but it also freezes How can i find the reason of Deinit or freeze? all works fine when I restart EA
Hello everyone I cannot get this thing to work. I am trying to read a moving average buffer from a downloaded indicator (AllAverages_v4.9_MT5), and want to read a few values to calculate entry (eg close above MA for a buy). I'll attach the indi file and paste my EA code. #include <Trade\Trade.mqh>
Hi all, maybe someone knows whether there will ever be the possibility of showing "Positions" in the backtest report? In MT4, they were clearly listed using their Open price + time, Close price + time and their total profit/loss. In MT5, only "Orders" and "Deals" are shown with no real connection to
Hi all, I developing an EA and I am using multiple currencies in it and I want to show arrow object on each chart for which I need chart id. The problem I am facing is I am unable to get chart if of the chart other then first chart while back testing. I am using following script to chartid of the
hello friend, I think there is a bug in mql5 an DeInit section, ObjectsDeleteAll(0) not working in OnDeinit. Error is 4022 When I remove expert drom "Expert List" it is ok but when I remove from Right top side of chart it's not working. Please see attached video . Does anyone know what the problem
  EA trading  (1)
can you add new option to a ea if it is encrypted like attach a stop trade after 7 consecutive losses and if so is there anyone willing to add for cheap not i dont know how long it would take or pricing but i dont think it could be more the a couple lines of code or have so all ready made sorce code
Greetings, I did some testing with .ZOrder method in AppDialog, and I found out that no matter where I put the Button.ZOrder call, it does not set the ZOrder of the object actually, so I looked that part up in WndObj.mqh, and i saw that the virtual bool OnSetZOrder( void ) {
I practically know the name of the button of an EA not of my creation... When I ask for the list of components, I get the name of the button for example the button named "btnX" I would like to use one of my scripts to "click" that button to execute the operation of that EA type --> click ( btnX ) is
i have an EA, codeA.ex5 i have made all the necessary checks but this EA fails the automatic validation with errors(no trading operations ) for all the test pairs when i copy the exact code and paste and compile with the same editor to codeB.ex5, this code passes the validation with no errors then
Hi, does anyone know how to get the candle close from a non time based custom chart such as renko ? iClose and Copyclose doesn't work. thanks
Hi all. I've had an EA developed which uses two time frames, ie a higher time frame requiring conditions be met, and a lower timeframe for execution. The strategy tester, and even backtest is running extremely slow - 131 of 1280, in 9 hours - with the full test taking 89 hours. Even when running the
Hi All, I have written the code below as an attempt to create a function that limits the number of open positions by closing either the oldest or least profitable depending on input settings, the code compiles however when I run it on backtest I get an error message saying array out of range on line
Sometimes I want the fast genetic optimization to test for many more possibilities than it does. I have a small neural network that seemingly has tons of local minimums. For each weight it could find a good value that it gets closer to but there is a much better negative value that it doesn't test
Hello! I have a question. I have this array of a struct type, I would like to fill the data from an indicator buffers. I tried like this : for ( int i = 0 ; i < array_size; i++) { CopyBuffer (handleHH, 3 , 0 ,array_size,dir_primery[i].close); CopyBuffer (handleHH, 2 , 0
so ive tested for some time now with mt5 and recently as soon as i press ''start'' on the strategy tester, my computer just freezes up to the point i cant even move my mouse. the computer i have is a hp desktop ryzen 5 which im 90% sure can deal with the processing power needed so im almost certain
Hi all, could you give me a tip on how to get the current bar in python using the MetaTrader5 library? I'm trying prices = mt5. copy_rates_from ("EURUSD", mt5.TIMEFRAME_M5, today, 10) but this doesn't return the current bar, as it seems to have a delay of 2 hours. how could i do day trade without
  Handle release  (6)
Hello! I have this function in my include file : double ATR( int index) { double atr[]; int handle = 0 ; handle = iATR ( _Symbol , PERIOD_CURRENT , 14 ); CopyBuffer (handle, 0 , 0 , 10 ,atr); ArraySetAsSeries (atr, true ); return NormalizeToTickSize (atr[index]); } So at any time in
Here's my code const double myVol = 0.1 ; ulong myTicket = 0 ; MqlTradeRequest request = {}; MqlTradeResult result = {}; ulong SendTradeRequest() { if ( OrderSend (request, result)) { return result.order; } else { Print ( "Error: " , GetLastError ()); return 0 ; }
Hello all, I'm struggling already for several days with how to draw objects within Expert Advisor in MQL5. First goal is to draw objects and have them visible within Strategy Tester. I searched and read various articles in the forum, but still, it's not clear to me what is the logic behind drawing
Hello guys, I really need help in implementing trailingstop in my bot. I want when the trade is opened, if it is a buy trade it follow the price by 45 pips and if it is a sell it; there is no error in my code but for some reason the strategy is not implementing in the tester. See my code below, i