Expert Advisors and Automated Trading - page 81

Apologies for inappropriate formatting. If I attempt to format the code in code block, a big block shows up. If use HTML button on RHS, entire typed text disappears... First of all, we need a global variable to hold the profit's calculation. In case you are tracking multiple EA's at once you may
I have created an EA that I am doing some forward testing on. I have two sets of settings, let's call them 'A' and 'B'. I have on live account with the EA and settings 'A' running. Now when I login to my second = demo account and I put the same EA on the chart with settings 'B' it also changes the
I am new in MQL5. I am struggling with writing a function to get last open trade ticket for a specific type and Open price of that ticket. Appreciate any help. // Function to get the ticket of the last trade of a specific type ulong LastTradeTicket( ENUM_ORDER_TYPE orderType) { ulong lastTicket
Hello, is there a sure to prevent overfitting when testing a system over historical data
FOREX EA trades USD pairs strictly and is programmed to trade news and hold weekend trades. Strategy uses standard open position based off candle sticks formation, occasional hedge and trades on 1hr timeframe
Sir , It is working this One Symbol // Show Grid is Switched Off ChartSetInteger ( ChartID (), CHART_SHOW_GRID , false ); // Show Ticker is Switched Off ChartSetInteger ( ChartID (), CHART_SHOW_TICKER, false ); // Show Volume is Switched Off ChartSetInteger ( ChartID ()
I can go inside the if block even when the condition is met. The IsNewBar() function works properly but for some reason the condition in the if() block is never met. The var counter never increments. Any idea?? datetime dt; int candleNro; int counter = 0 ; int OnInit () { dt = Time[ 0 ];
java: ZoneId zoneId = ZoneId.of( "America/New_York" ); LocalDateTime localDateTime = LocalDateTime.of( 2023 , 05 , 30 , 15 , 16 , 17 ); //datetime in java ZonedDateTime zonedDateTime = localDateTime.atZone(zoneId); System. out .println(zonedDateTime); ZoneRules rules = zoneId.getRules(); boolean
Hello guys i need to determine the number of points suitable for the amount and percentage i want to risk i realise that as the account balance changes the number of pints used to calculate lot size can produce a lotsize greater or less than the desired amount and some times even greater or less
How i can resume back test if new day available.. for example.. i finished back test from 1/1/20230 to 31/12/2023 .. can i do back test from 1/1/2023 to 1/1/2024 without start it from the beginning... Only take time of 1 day as resume back test
Code here, mql5 newbie, can anyone tell me why it print array out of range (number71,55)?Thx a lot(Want to calculate the average high-low 20 days) #property indicator_chart_window #property indicator_buffers 4 #property indicator_plots 4 double DayHigh[]; double DayLow[]; double
Over the weekend I went to dowload and import last weeks data (from Tick Data Suite). I imported the bars as per normal and it showed the data. I then ran a test and got the error message that data is missing. I then went back to the custom symbol and ran a request and it said 0 bars. I have tried
  protecting an EA  (12   1 2)
hi good day can anyone tell me if i made myself an EA and i wanna sell it to someone what can i add to it that the person i sold it to cant resell it
Hello there. I opened a socket on MT5 and connected it with the server. But I could not send data from server to mt5 with socket. So I want to send a value from the server to the meta. can you help me. I would be very happy if you show a small example
test on EURUSD,H1 (netting) 2022.02 . 01 09 : 50 : 40 failed instant buy 0.01 EURUSD at 1.12584 sl: 1.12334 tp: 1.12734 [Invalid volume] 2022.02 . 02 10 : 04 : 40 failed instant buy 0.01 EURUSD at 1.12886 sl: 1.12636 tp: 1.13036 [Invalid volume] 2022.02 . 03 15 : 44 : 40 failed instant buy
I have been working on an EA for some time now and suddenly the code just seems to not work on my VPS anymore but still works just fine on my home PC. The issue seems to be that the trades open just fine but then modifying the stoploss of an open trade throws errors. I have tried copying the code
Could you guys please help me find out what's wrong with this MQL5 EA. So basically the original of this EA is an EA that helps you move SL to the A1 point after the price moves to an A2 price point. I did some modifies this EA to move the SL one more time, SL at the A1 point will move to the B1
Greets, Here's a quick implementation of a grid trading idea showcased here I'm not sure if I've made a mistake, or if the concept simply doesn't work, but it always results in a loss in backtesting. Maybe someone can have a look, play with it, and possibly give ideas. Since the strategy apparently
I am having the following error while i am trying to login to my account using Metatrader5 Python Module: Failed to connect to account #1234567; error code: (-7, 'Unsupported authorization mode, OTP or certificate password needed') Any help will be appreciated
Hi everyone Just as there's a function for selecting a position by ticket " PositionSelectByTicket ", there's also a solution for deselecting a position, although I don't think this will be of much use, since according to the documentation, even when a position doesn't exist, you can still retrieve
Hi there, Im looking to automate the login process and server setup process but i cant figure out hwo to download the server data via python.. It seems that when i manually login into mt5 it downloads a server file first, and this is what im missing i guess... any tipps
So I have a certain trading logic that when met I want to enter the trade at the price of the previous close. This of course cannot be done using a market order due to spread between ask and bid. However, as the candle closes and the next one opens, placing a limit order automatically where the last
Hello, I have always wondered why the backtest results of an EA differ from its live market results. Throughout my trading experience, I have tested thousands of EAs in both backtest and live market conditions. While most EAs yield impressive results in backtests, they often result in losses when
Sir , I want to practice this Example EA MT5. 1) It is working to grid Trading into One Symbol. int Pip_Step( string symbol_2, int magic_2, double StopLoss_3, double TakeProfit_3) { double Open_Price = 0 ; bool LastIsBuy = false ; int TotalBuy = 0 ; int TotalSell
I have a multi symbol EA that I want to optimize using a high spec PC. Does it use market watch to determine which symbols to include or the setting in the EA where I can list the symbols separated by a comma
I have built an EA with EMA crossing logic. It works very well in backtesting, generating BUY and SELL positions when the fast and slow EMA lines are crossing. However, the profit is sadly lost when unexpectedly the trend reverses against the EMA indication, which is something I have been unable to
Does anybody know of a simple EA that will allow me to set simple buy and sell limit orders with SL and TP? thats it! thats all I want please help thx
I don't see the optimization graph tab in the MT5 desktop version on Windows. Has anyone else seen this and how did you resolve? TIA
Was trying to find out more information on backtesting approaches and some additional information on how to handle a condition where the same code is getting different backtesting results on two different machines. We've checked the backtesting settings etc but was looking for more insights into
Hi everyone, I am ripping my hair out trying to figure out why my EA is not turning from the blue hat to green, to show that it's working. I have tried using the VPS from MQL5, restarted, and it still doesn't work. I have tried without the VPS, I have tried all of the settings in the EA options