Expert Advisors and Automated Trading - page 34

Hi everyone. I recently started an MT5 account with forex.com. For some odd reason when I attempt to backtest most times the tester stops early than the set end date. I have ample amounts of storage and there is no error in the journal. Does anyone have an answer that might help me? I'd really
My code is as follows: int count = HistoryDealsTotal (); ulong tik = HistoryDealGetTicket (count- 1 ); ENUM_DEAL_REASON drrr2 = HistoryDealGetInteger ( tik1+ 1 , DEAL_REASON ); When using the debugger (tester), values of variables is as follows, while they are different from the History
Greetings community To my knowledge Microsoft Windows allows a maximum of 32 installations of metatrader per user account, I'm aware this can be bypassed simply by creating a new user. My question is how does one copy trades between different windows users on the same computer? Thanks
  Freezing charts - Error 4203  (23   1 2 3)
Hi, its frequently that we have to deal with frozen charts. Any function like ObjectGetInteger(), even ObjectName() or similar, then needs seconds to return and the error code is always 4203. The error code makes no sense at all, since ObjectGetInteger() uses OBJ_TYPE with an existing object, and
I know there are differences between brookers. But why does the example downloaded below work for some and not others? int OnInit () { MarketBookAdd ( _Symbol ); return ( INIT_SUCCEEDED ); } void OnTick () { MqlBookInfo priceArray[]; bool getBook= MarketBookGet ( NULL ,priceArray); if (getBook) {
Hi, I'd like to ask coder that has already implement a multi-strategy EA on their EA. I read an article about multi-currency multi-strategy EA from this link with this framework like the picture below. From the picture above, what I understand is having 2 separate strategy and put it in an EA. I
Hi, my understanding of logic regarding this event is, that it is sent when the chart changes. But it does not in many circumstances in MT5: 1. User changes the scale from normal to fixed scale 2. When bars are growing and exceed the current price scale 3. When the scaling (zoom) is changed These
Hello developers, I recently bought an EA from a developer and he sent me the .exe file with the password to activate it after I shared with him my account number and broker's server. The EA is working now, but how can I guarantee that is will not be disabled out of the blue? I mean, how can I
can anyone help me please, webrequest function always returns 1001
I've been trying to test my socket connection using tester, as I will need it to communicate back and forth with Python. But it keep returning 4014. What I found in the documentation (https://www.mql5.com/en/docs/network/socketconnect), it cannot be called from an indicator, I've made it as an...
I've recently seen quite a few updates to Integration with Python, including various functions. Does it can be used in back testing? According MQL5 Reference, I found that there is no such function. At the same time, Socket functions can not be used from the Strategy Tester. Is there a way to
I'm trying to do this programmatically, but I don't see a way to do it manually either. Is this possible
Hello everyone, I have a problem when I create a Panel in MT5 using Dialog library. I have some elements within my dialog box, when I need to use "Destroy" method to delete some objects within my dialog box and then again use "Create" method to create those objects, when I do that the relation
How to identify panel button click during testing. OnChartEvent of course doesn't works
Hi All, I would like to know whether it is possible to check historical Account Leverage ? Alternately, if someone can guide me on how to calculate the Account Leverage using MQL5 code for a given date time would also be useful. I've tried the below code, but the output in the journal always returns
Hello, Is there anyone who can help me about CHART_SHIFT_SIZE in my EA, it works with charts, but not in strategy tester . I have a rectangle panel with labels and everytime, bars are behind it. Thx a lot
  Please help me  (1)
Hello for all I have error in EA RSI and want to fix it,The error is the EA close the position randomly without hit SL,TP,Or close trade by opposite signal ((i set the close trade by opposite signal to false)) and the EA still close the position randomly
Hi, I am using EA position sizer that automatically adds the stop loss and take profit lines onto my chart once I place an order. I should be able to drag the lines on the chart if I want to change the stop loss or take profit. However, a few seconds after I drag the lines to a new price, they
Hi everyone, does EAs work when I close my notebook. It is still on
Hi all, why is so hard in MQL5 to get last closed position profit, or at least if this was >=0 or <0 ? I'm not posting any code as I tried all that I could find on mql5.com, but none of it worked. Please, can anybody post some minimal example ? Thank you
  Emoji to Telgram messages  (11   1 2)
How do I add emojis to my telegram messages? Below is the code but it does not print the emoji when a message is sent. if (Notify_Modify) for ( int i= 0 ; i< ArraySize (OldOrders); i++) { if (OrderTicket()!= OldOrders[i].ticket) continue ;
hey i want to add a minutes to the expert advisor now the expert have just a hours parameter and its open a 2 pending orders (SELL and BUY) every minute.. somebody can help me to edit this code? please 1. add a minutes to open a order in specific time 2. open just 2 pending order and not every
I have isLogging parameter in EA to indicate whether calling Print() or not. I turned it off but failed to pass validation of MQL5. Then I removed this parameter, I can pass the validation. But I want to log something instead of turn it off. May someone advise how to fix it wisely? e.g. can I clean
Hi folks, got an issue with an self programmed EA. After opening my position my EA is advised to add a SL to the position. But I always get the hint below:&nbsp; "2016.08.17 10:29:39.064 Trades '3895623': failed modify &nbsp;buy 0.00 &nbsp;sl: 0.00000, tp: 0.00000 -&gt; sl: 1.11690, tp: 1.15690...
Good day codders, I want to get the ema value of the price I stored in an array, please what is the best way to do it in mql5? this is my code below //copy price to an array using copybuffer MqlRates barsPrice[]; //ArraySetAsSeries(barsPrice,true); int copied= CopyRates ( Symbol (), NULL , 0
I have been experiencing bugs in forward optimization for a while now and I am trying to identify the problem (post about bugs: https://www.mql5.com/en/forum/454524 ). The only error message that shows up says in the journal tab is " x forward passes not processed and returned to task queue". If I
double prev_buy, prev_sell; bool Enable_Trade = true ; void OnTick () { double buy = 0.0 , sell = 0.0 ; double atr = iATR ( Symbol (), PERIOD_CURRENT ,ATR_period, 1 ); Check_Time(); buy = iCustom ( Symbol (), PERIOD_CURRENT , "SuperOsmaArrow"
been working on this inside bar expert advisor and i had issues with it giving continuos non stop alerts but tried to solve it but now it wont compile because of a unbalanced parenthesis on the "void OnTick(){" line 23 in the code below. can you guys please help me balance the parenthesis as i have
I need some help from an experienced developer. I would like to do the following: 1. Create a database in memory in "OnTick". 2. Do one query from defined StartTime to Timecurrent() and copy all the transactions to above database. Benefit is much less interaction with main server, less lag and
Is there any function to return the day of the week of today? Like: Sunday, Monday, Tuesday