Expert Advisors and Automated Trading - page 43

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"
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
Hi guys, i have a problem with my simple expert advisor, it gives alerts whenever an inside bar forms as shown in code below but the alert rings continously until the next candle closes. how can i stop it to make it only ring once?? Thanks in advance
I've looked for any documentation on what's under the hood of this function with no luck so far. I'm trying to calculate required margin for upcoming positions, and OrderCalcMargin() gives me a different value than the standard calcuation that I'm digging up everwhere else on the web. I'm currently
Hi all. I have been using MT5 for trading my funded account for about 8 months with very little issues. I have a macbook, I use the downloaded MT5.dmg file specifically for mac. I have just started getting into EA's, and purchased a few. It seems that the windows version of MT5, once you open the
Hello, I read many threads about this topic but they are of some years ago and I want to ask about the actual situation in a more clear way. I want to develop an EA that is reading the values of the economic calendar and trade. My questions are: 1. How fast does the mql5 economic calendar give the
Hi Everyone, not entirely how this works since this is my first post:) Everything in this EA works fine, i tested it all multiple times. The only issue lies in the createObject. It works fine when i create objects just for one symbol which i make corresponding in the strategy tester although when
Dear all, I hope I landed in the proper section with my question. Here is the story. I was back testing some MT5 experts I developed on various instruments, and when I came to EFA, iShares MSCI EAFE ETF (EFA.arcx), I noticed that my experts behave strange, to say the least. Sometimes they yield
Hi, I have a strategy that I want to separate between settings of long position and sell position. To simplify the process I will put a 2 same EA one with long position trade only and the other short position trade only. All the other parameter is the same including OpenPositionTicket[] to store
Hi, Im getting Invalid Price error in Validation to publish my EA. Looking at this it looks like it's not getting the price. My code regarding the order is below. In fact, it is working normally in backtests and real trades. Pls, somebody help me. request.action = TRADE_ACTION_DEAL ; request.price =
I have been testing numerous indicators, and for some reason two indicators got stuck in the chart of the STV. Now each time I open the STV, the lines of that old indicator still display. IS there a way to remove them?. Why would indicators get stuck (become orphan) in the STV? May be the original
Hi Could somebody please help me? i am trying to get the below code to compile in mql5 and keep receiving 2 errors for expression is always false for line number 44 and 66 (I have highlighted below) //+------------------------------------------------------------------+ //| Expert initialization
Utilities seem to load as EA's and testing them from source code works fine if you test on live data. When back testing, they may not execute any trades and then closes after period has run through. I have seen this with DEMO utilities that do allow trading (with manual intervention) but you cannot
I am facing a strange behaviour of the visual tester agent in MT5 I do not understand. I have a custom (home made) expert system that I am developing by long time. The code looks to work good by the program point of view; i t is compiled without error and, for example, I can launch it in the
Hello everyone, I have been testing the [product name redacted] EA on a demo account for a month. I do not know how to code. I have had mostly very profitable backtests, but for one month that is profitable with certain settings, the next month blows the account because of a big continued draw down
input double RiskBalancePercent = 1 ; double Ask; double Bid; double AccountBalance; double TickSize; double TickValue; double LotStep; double TP_Calculated; double riskpertrade; double LotsBuy; double LotsSell; double RiskPerRewardRatio = 1 ; ///get price Ask = NormalizeDouble (
The EA has been started already. the system is running on a fibo trade sytem, multi timeframe of 15 muniutes and 5 munites for entries. and the sl and tp. input parameter done already. the major frame work done already. remaining is to place the logic in the on Tick Function (OnTick), compleation of
  Equity protector  (1)
Hello i need an expert adviset that is for equty protection. Example: I have 1000 usd on my acc,when it reaches 900 to close all the trades,can you please tell me how to do that
I have two symbols running three EAs each. Each EA with a different magical number. I want to know which EA is the best, I want to see the final profit of each one since it started running. On the history tab, I can select each symbol individually, but it lumps all of the EAs together. I can add the
Hello guys, Does anyone know what's wrong here, I just copied the codes from the MQL5 help document to my first python script and tried to run it. But I keep got this error message: from datetime import datetime import MetaTrader5 as mt5 # 显示有关MetaTrader 5 程序包的数据 print("MetaTrader5 package author