Expert Advisors and Automated Trading - page 5

I am trying to get a total count of buy (open buy + buylimit + buystop) and sell (open sell + selllimit + sellstop) orders at a particular price level. The following function code seems to get the count correctly in some instances but shows a zero count in other cases. I am not able to figure out...
Hi friends Please I have an indicator which have 3 buffers. The 3rd buffer should return EMPTY_VALUE for buy condition OR same value as second Buffer in sell condition. But in strategy tester, the indicator constantly returns thesame value for first and second buffers. Please help me take a look
Why is it i failed the validation for OrderSend due to invalid trade volume but i am able to send orders in the strategy tester
hello every one I failed to write code that enables me to close all opening orders and pending after achieving a specific profit on a specific symbol and need to make that profit as a variable
Hi, I observe weird behavior on this method. There are cases that I can reproduce every time but also there are those which seem like random... Package version: 5.0.36 OS: Windows 10 NOTE: I have deals on every (working) day in last 30 days, so there should be a lot of deals listed. Observed
My goal is to create some code that I can add to me EA. I would like the ability to have my EA trade the Asian session, the London, Session and the New York Session. Sometimes I might only want it to trade during the London or New York Sessions. I am very new to coding. If anyone could take a look
I’m looking for a function that returns if the last trade was a win or lose trade. In other words, if the price hit the take profit or the stop loss of the last trade. If someone decide help me, so, PLEASE, give-me a function that you have sure that work correctly, because I’m not programmer and I...
Does anyone know if there is software available that allows for MANUAL backtesting in MT5? I know MT5 has the Strategytester to backtest automated strategies but I would like to test Semi Automated strategies where I manually place discretionary trades. I was looking for something that does chart
Hi, while backtesting, there are tons of messages that I don't need: - order performed - deal performed - position modified - stop loss triggered - market buy - market sell - deal #100 done - etc. If there are 100 of the above messages every second, it is difficult to keep track of the important...
Hi, I've come to a bit of a hiccup. In 1 of my programs, I need to make automated chart screenshots. The function for that is: ChartScreenShot(chartId, fileName, ss_width, ss_height, align_mode); Prior to that I ChartNavigate to some time in history, where bars_navigated is much larger than...
The DD% in the tester optimization is "Equity DD% Maximal", but I want to see "Equity DD% Relative", what should I do? please help, thank you
When i try this code to get the number of events; It doesnt give any results in strategy tester but it works in real data. Why doesnt it give any data in the backtest? How can i fix my code? Thanks void OnTick () { datetime start_of_day = iTime ( _Symbol , PERIOD_D1 , 0 ); datetime end_of_day =
Hello. I have code that opens a file using int file_handle = FileOpen (file_name, FILE_READ | FILE_COMMON | FILE_TXT ); ...... FileClose(file_handle); If I run it with optimization disabled and visual mode disabled, it runs fine the first time, but after that any additional runs return
I have an EA as below. I want: - limit the number of ending order = 20 (EA place ~200 order) - When there is a profit of 200 points (20 pips), shift the SL and TP by 20 pips (using CheckAndAdjustProfitableOrders () and ModifyPosition ()) - At the same time, close half the volume of active position
  Help open parenthesis expected  (22   1 2 3)
I have no knowledge of coding yet while compiling an ea i managed to reduce the 15 errors to just 2, both are the same '' 'if' - open parenthesis expected '' and when i click on this error it leads me to this point in the code which i cannot rectify void tick22() {if {tick22==true} { and
  MQL VPS Service  (7)
Hi, I'd like to have few infos about how that service work. I found it very convenient as you can set it up on the fly with no login on a server etc. But ... The terminal I used to sync it on : Once migration done, is it still connected on my side ? If it's still connected do I have to...
Hello I have this problem, can someone helps me to fix it? Thanks
Hi I am a newbie who doesn't know how to write the code properly and found this kind of error using ai, please help fixing this I am hopeless TT Error logs & MQL5 Respectively Description File Name Line Column 'SELECT_BY_POS' - undeclared identifier Lastone.mq5 168 29 ' OrderSelect
Hi, is there a way to let a bot trade looks like a manual trade in mql4 and/or mql5? Somebody told that there is a "self" or "shelf" attribute when you place a trade with an EA but I didn’t find anything a out that. Thanks for any hint
Hi Everyone, I am having issues with the method PositionSelectByTicket (ticket_id); After I open a new position (ctrade.Buy) and a few lines later call bool res = PositionSelectByTicket (ticket_id); it returns a false. But the position is sitll there and it is visible in the table. Any ideas how I
  Canvas is cool!  (948   1 2 3 4 5 ... 94 95)
I set myself a task: to demonstrate the capabilities of custom graphics via CCanvas class in a short code. Here's what came out of it. This script works in both MQL5 and MQL4. But it is much faster on MT5. Each frame is unique and does not repeat, i.e. the script is not cyclic. #include
this is the MQL5 code I use: //+------------------------------------------------------------------+ //| Socket.mq5 | //| Copyright 2024, Javier Santiago Gaston de Iriarte Cabrera. | //|
I've had some code that has been working fine on a demo account ever since I wrote it 9 months ago. Using MT5. I recently moved to a funded account (live) and have run into issues. Here a snippet of my original code where I located the issue is occurring, that was working fine on demo okay. I'll
Hello. I have a program that opens a position with a higher lot size if there's a position open and it aims to multiply based on the lowest lot size but I'm having trouble getting the lowest lotsize. Please help double getLowestLots(){ double lowestLots = 0 ; for ( int i = 0 ; i < PositionsTotal
Is there any function to return the day of the week of today? Like: Sunday, Monday, Tuesday
Hello Friends Is there a way to contact 'Service Desk' for technical issues which remained unresolved on the forum? I have been struggling for almost three weeks now, since the last release of MQL on 21st June 2024 after which the problem started. Regards
Hi every one. Please help me how solve error in backtest after updating mt5 and compiling my program: Access violation at 0x000000007FFF00D6 read to 0xFFFFFFFFFFFFFFFF In forum I found several similar problem but no clear answer. Thanks
Hello Everyone, If you are an EA developer and experienced with the following: 1. Reviewing and running EA in the marketplace. 2. You know tricks and scam EA sellers use to show fake back test. 3. Avoiding fake back test. I would like to hire you for a 1-hour consultation fee on how I can mitigate
Hi, I am running MT5 on Wine (Linux Ubuntu) and I get this message in the journal tab of the 'Strategy Tester Visualization' window, "IO operation failed with code e9 (233)" The log file gives the same info, the ending lines are NP 0 13:50:34.592 Tester final balance 10000.00 USD RJ 0 13:50:34.592
I'm trying to convert a string into a char[], in order to write a file using WriteFile from kernel32.dll. string writethis = "abc" ; int lineSize = StringLen (writethis); uchar line[]; ArrayResize (line, lineSize); StringToCharArray (writethis, line, 0 , - 1 ); Happens that, this gives me