Expert Advisors and Automated Trading - page 69

Hello, when I try to add an expert to my mt5 I always get this error: mt5 initialization of expert failed with code 0 (prepare to execution failed) First I thought it was because of my Implementation but this even happens when using a Metaquotes-example. What does this error mean
OK, I appreciate that none of you are mind readers, but have any of you come across the following error before, and if so, did you manage to get to the bottom of it? The piece of erroneous code is shown here... static void Cards::AddCards() { string symbols[]; int count =
Good day, im looking for some support on getting my GraphicInterface to show up in the Chart. Im using MQL5 to write my EA and using MT5 to test. it. The EA is compiling without any errors in Meta editor, The Experts window is printing: 2024.01.30 11:03:28.989 CTM_TradeManager_EA (GBPUSD,H1)
void OnStart () { string sym = Symbol (); bool cus = true ; bool is = SymbolExist (sym, cus); double last_high = SymbolInfoDouble (sym, SYMBOL_ASK ); Print (sym + " : update " + last_high); double hi = last_high + 100 ; double low = last_high - 200 ; if (is) { bool ok
  EMAs Crossover  (4)
Hi everyone... I have a code that works well, but when for example the slow ema crosses the fast ema and the ea has to sell , It works but sometimes immediately after this the next candle makes the cross over to the way that we have to buy so the previous cross over was fake actually and the ea
Hello, I have attached the code for a function I am using to move the stop loss to break even. I do not see any issue with the code, but I am obviously missing something because it is not working. It is supposed to iterate through all open positions, and if a position is 5 pips in profit the stop
With the most recent update, it seems Metatrader 5 is having issues with the strategy tester. I attempted to update MT5, but I already have the latest software it seems. For your reference, I am using Version 5.00 Build 4158 26 Jan 2024. This is the exact message I am getting on the Journal tab of
  Multiple EA  (3)
Hello ... I just can't find the right answer in the forum. So I hope there are some specialists here who can help me. I have 10 expert advisors on my real account and would like to only have a maximum of 2 running at any time. the Expert Advisors all work very well. Only if everyone places orders at
Hello, has anyone seen this error when trying to validate an update to the market? test on EURUSD,H1 (netting) EURUSD: no history data from 2020.04.01 00:00 to 2020.08.01 00:00 there are no trading operations Do you know the solution to this problem? I've seen many, but never this one. Thanks in
[Deleted]
original code:Print("Launched the EA ",MQLInfoString(MQL5_PROGRAM_NAME));   should be:Print("Launched the EA ",MQLInfoString(MQL_PROGRAM_NAME)); 
Hi all, I am attempting to modify my TP after placing a trade. The problem seems to be that i am using the same stop loss. This is what i Want. However, if i put in a new Sl by subtracting .00001 from the prev stop loss, it works. I am assuming that positionModify wants new values. How can i only
I'd like to know more about the actual algorithms (code)used to generate ticks in the backtester . The description in the Help file for the option to generate ticks using OHLC values is clear enough, but I have questions about the other two methods: * Randomly by Real Volume. Can I assume that
Hello. When I start debugging with historical data from MetaEditor, it changes my EA's input parameters and I can't figure out where can I set those? These are not the defaults and they are not what I set in strategy tester before starting the debugging
int OnInit () { //--- Newbar(); ma_Handle= iMA ( _Symbol , PERIOD_CURRENT ,maPeriod, 0 , MODE_SMA ,rsi); rsi= iRSI ( _Symbol , PERIOD_CURRENT , 7 , PRICE_CLOSE ); stocha= iStochastic ( _Symbol , PERIOD_CURRENT , 13 , 3 , 3 , MODE_SMA , STO_CLOSECLOSE ); ChartIndicatorAdd ( 0 , 1 ,rsi);
Hi, attached is my simple function to breakeven stoploss after price reaches certain profits on that pair. It is working on all the forex pairs i have tested but, not working on other pairs like indices and cryptos. Im trying to figure out how do i amend my code for this but cant really find much at
Hi, I've experiencing a virtual hosting error with code 1003. I looked in the web and found nothing about virtual hosting error code. Anyone can explain to me about the virtual hosting error
int cntBuy = 0 ; int cntSell = 0 ; void OnTick (){ Comment ( "\n\n\n\n\n" + "Buy Count : " , cntBuy, "\n" , "Sell Count : " , cntSell, "\n" ); cntBuy = 0 ; cntSell = 0 ; // initialize counts for ( int i = PositionsTotal () - 1 ; i >= 0 ; i--){
ObjectSetText(labelName, "text to display" , 10 , "Arial" , text_color); The above line of code is giving me the following errors: 'ObjectSetText' - undeclared identifier ',' - unexpected token 'labelName' - some operator expected ',' - unexpected token ',' - unexpected token ',' - unexpected token
Good day, I got this error when running optimization , but this error does not occur when I run single test . This error did not affect the test results, but after a few thousand passes my log file was stuffed to tens of GB of data, which is very irritating. I wrote the MACD indicator using Custom
My EA is created with the idea that it should execute a buy order when the current price goes below the lower band and a sell order when the current price crosses above the upper band. But he doesn't react as he wishes. At first he carried out orders but now nothing I review the code but I don't
  Optimization  (2)
I will do optimization test for my expert but it will be from 1974 .. it will take long i know.. so i will buy new laptop.. so which specifications do you advise me to buy .. for example i will buy laptop by core i9 gen13 ram 64..etc
Hello MQL5 community, I'm curious about the potential impact of the operating system architecture (64-bit vs. 32-bit) on the performance and operation of Expert Advisors (EAs). Specifically: Does the nature of the operating system (64-bit or 32-bit) affect the operation of EAs developed in MQL4 and
I am trying to practice my coding EA skills and created an EA around RSI levels. When i try to back test the ea, it opens a position up on RSI level between 50-60 (range) and the example input variables are based on 70 and 30. Is this a coding issue or something to do with the back test / days off
For a while I have been using this .bat script to automate testing on the MT5 strategy tester to optimise my EA. It edits the .ini file for adjust for set file to load, the pair, timeframe and also then loops how many times to do this. Recently I have had an issue where it would do several sets like
Hi, I'm trying a new multicurrency strategy on MT5, I personally wrote the code which opens new trades only if certain conditions are met. The strategy constantly monitors the price of different forex currencies and according to the strategy tester it should have already opened several trades in the
Hello everybody I am new to programming EA and I have been following some videos and so far, I was able to make a strategy run smoothly. I was testing the following: - EMA 1H 34 periods / EMA 1H 8 periods -Alligator M5 (EMA, no shift) Also, I addeded a loop for trailing stop. This was working fine
  Backtesting.  (3)
Hi. Does anyone of you know a way to test EA on M1? I would like the test to be performed only at the times I specify. For example. The EA is to start at 4 p.m. and end after making the set profit or close all open positions at 8 p.m. Thank you in advance for your tips
Hey, i added some input variables to my EA, but now (different to the version before), I can only open an empty Inputs Tab in strategy tester when, the newer version is selected... What to do?
Hello guys, I have a problem when try to use example for vector::Sort at https://www.mql5.com/en/docs/matrix/matrix_manipulations/matrix_sort when I compile it said error that: 'Sort' is not a member of 'vector' type I try some another ways but still don't know the way to use Sort method Can you
I want to calculate a history profit on OnDeInit event handler. This function only runs when backtesting the strategy. My code looks like this, void CStrategy::OnDeInitEvent( string & SymbolArray[], int numberOfTradeableSymbols, TRADE_DIRECTION TradeDirection) { if ( MQLInfoInteger ( MQL_TESTER ))