Expert Advisors and Automated Trading - page 40

Hi, I want to delete file using ShellExecuteW like code below but failed to launch cmd to delete the file. Anyone knows the problem? #import "shell32.dll" int ShellExecuteW( int hwnd, string Operation, string File, string Parameters, string Directory, int ShowCmd); #import //
Hello there, I created an EA that catches spikes. I backtested and it worked fine. But it fails to catch those spikes during a real-time test. Instead, it opens the position after the market has spike
Hi I want to create EA to get news times. I get history with: CalendarValueHistory (newsHistory,startDate,endDate, NULL , "USD" )) and i get event info with: CalendarEventById (newsHistory[ 0 ].event_id, event); but event.name and time of news in history that i get is not match with calendar in
The example code at https://www.mql5.com/en/docs/standardlibrary/controls/cspinedit works fine for me (v.5.00 build 2302) but when I change the minimum, maximum, and current value parameters from 10, 100, and 50 to numbers with a decimal (e.g., 0.00001, 0.00010, and 0.00010, respectively), I get the
I did an expert, and optimized it severeal days on historical data, it looks good. so I decided to test it on real data but nothing happens after checking , it turned out that CopyBufer hangs when copying data from the iMA function where the period is set to over 100,000 but it only hangs on real
Hi All, I have an EA running on a VPS purchased through MT4 - the EA seems to run great when MT4 is closed on my computer, however, when I open MT4 on my computer to monitor/update/check things it is placing duplicate trades. Is there a fix to this? In reading through the journal, it looks like MT4
Hi, I have a Problem getting values from an indicator. Can you please give me some advice/Help? Here is the problem: I have the indicator vwap_lite (see attached file) and I'm trying to get the Vwap Daily, Weekly and Monthly Values but apparently i'm getting only the Daily value with my code: How
Hi, Any tips on good MQL5 EA developing? Some free courses, tutorials, playlists on youtube you can recommend? I understand the basics of developing, but would say I am a newbeee, but understand the basics of developing, ( Yes, I can search, but if someone can recommend stuff that are good, :) )
Hello, I am new to Mql5 and I have a question, I want to open a transaction in Nasdaq and Dow Jones indices, but I want to have at most 1 transaction open from each of them. For example, while the Nasdaq transaction is open, a second Nasdaq transaction should not be opened but the Dow Jones
Hey guys, what is the difference between these 2 profits in strategy tester??! It had 1438 profit but it's written 393
I am developing an EA to trade with a small keyboard, coding its respective keys to give them specific trading functions. I already coded SUCCESSFULLY the BUY, SELL, and CLOSE ALL hotkey scripts., However, I can't find the right parameters/coding functions for setting up the STOP LOSS key on a
  Close only profitable trade  (14   1 2)
Hello, I search a EA similar the known EA "Close all at profit or loss". But I want, if a predefinied level of profit (or loss) is reached, that the EA close only the profitable trades and not the other trades, which currently still in loss. Have someone this EA
[Deleted]
//code 1 int bar = 10 ; double open = iOpen ( _Symbol , PERIOD_M1 , bar); double close = iClose ( _Symbol , PERIOD_M1 , bar); double high = iHigh ( _Symbol , PERIOD_M1 , bar); double low = iLow ( _Symbol , PERIOD_M1 , bar); if (open>close) // do something //code 2 if ( iOpen ( _Symbol
I am new to coding and expert advisors. I was following along with a YouTube video just to learn, this EA is supposed to open a position every time there is an SMA cross for a quick scalp. I noticed many times there are many times the SMAs cross but no position is opened. Any ideas why
My EA did not properly implement the sell limit condition that I was requesting. At "// Check the conditions for a sell signa"l and "// Check the conditions for a sell signal" seem to be logically correct. Can you check and point out errors for me? Thank you ! input double RiskUSD = 10.0 ; // USD
Hello everyone, how can we get a calculation of the number of candles formed from the date 2009 to 2021, for example, on the minute frame? i want to gets (open ,high ,low ,close) prices form 9/10/2009 to 9/10/2022 for example can any one help me please
1 full hour of reading threads and posts to no avail. All input is appreciated. Q...How do I add up all Deposits into account via code
Hi Guys Is there a notable distinction between connecting to a live account and a demo account while strategy test my EA's on MT5? The history quality of both are the same 98%. Still, I see quite a difference in results when I'm connected to a Live or Demo account strategy test my EAs. Can anyone
If a system is robust, wouldn't it have similar Recovery Ratios between the "In Sample" and "Out of Sample" data
  Historical data  (2)
Hello, when downloading bar data for 1 minute of an asset and also the tick data for the same asset an unexplainable happens. Lets say close price at 12:00:00 is 100. Tick data shows that at 11:59:59 bid and ask were 101 and 102, and at 12:00:01 they were for example 102 and 103(these are all
any assistance please... my code has undeclared identifier errors for functions OrderSend() and iStochastic(). im still getting undeclared identifier errors for parameters of both function even after including the trade.mqh library
Hello! I wrote a function to return the takeprofit in price using the expected profit. The function worked well for symbols like EURUSD but failed in AUDJPY ( JPY pairs ) and Cryptocurrency. I believe this is because of the discrepancies in their _Digit values but even after accounting for it, I
Hello there! I'm working on an Expert advisor. I want it to close all positions when there is a 2 pips retracement. I utilize Ctrade Standard library to open and close positions. Yes, I'm aware of the SetAsyncMode() method, but it doesn't solve the issue. I tried orderSendAsync(), it still doesn't
void OnStart () { //--- } //+------------------------------------------------------------------+ void RiskPercentageByAccountBalance(); { double accBalance = ACCOUNT_BALANCE (); Alert ( "Your Account Balance is: $" + string ( ACCOUNT_BALANCE )); Alert ( "Max Risk is: $" + string ( 0.01 *
Can anyone tell me why it print array out of range (number71,55)?Thx a lot(Want to calculate the average high minus low f or 20 days, the custom indicator in iCustom is the code itself) #property indicator_chart_window #property indicator_buffers 4 #property indicator_plots 4 double DayHigh[];
Hello there, I've been experimenting with AVX (and its derivatives AVX2 + AVX512) support in MQL5. - Assuming, and to some extend verified, AVX is being utilized by the compiler, if enabled, we should be able to see significant speed increase on some types of operations. - Due to the lack of
Hi guys I know that I can do a backtesting for my EA with all the pairs in market watch at the same time in MT5. but can I set different setting for each currency pairs? For example I want to test for Gold, EURUSD, GBPUSD and USDJPY and my EA have 5 options in its setting , I want to disable option1
Hello everyone. I encountered the error "Experts initializing of ????(ETHUSD,M15) failed with code 32767 (incorrect parameters)" when running mql5. The program code that seems to have caused the error is "double min_volume=SymbolInfoDouble(Symbol(),SYMBOL_VOLUME_MIN);" and it occurred with the
I was working on a backtesting expert and I notice that the ticks jumps to the next minute before finishing the minute. I did a simple code to export to file the OnTick() and saved the price and the current time as show in the left image. The right image show the symbol MT5 tick information which
Hello, I am currently using this method to get an order ticket when the order is placed successfully. Is this method the best practice? Is there any other more effective and secure way? Thank you in advance. if (trade.PositionOpen( _Symbol , orderType, lot, NULL , NULL , NULL , cmt)) { ulong