MQL4 and MetaTrader 4 - page 3

To post a new topic, please log in or register
The code below uses iCustom to get the value of the Stochastic indicator on CADJPY on PERIOD_M5. This is not a problem with the Stochastic indicator or this particular symbol, as the same problem manifests with any symbol/indicator. The problem is that when this EA is applied to any symbol other
Hi guys is possible return a position bar by price ? example i have a highets value of 48 bar , suppose is 0.96366 , exist a method for positionbyvalue (0.96366) and return me .... 5 the fifth bar
Dear experienced traders I have a question confused me so much, could you help me? In options we can set max bar in history and in chart. Do you know max bar in history and chart affect EA work or not? (A) Only max bar in history affect EA work, so we have to set it as 9999999999999 to make history
how can we command new order on the condition if TP( take profit ) buy or sell another lot if time limit is 1 am to 2 pm and it hit tp on 3 pm onward , we want to take another lot by ignoring time condition. what will be syntax for that
Hi guys, I need a big help. In my indicator I create some ChartEventCustom, but when OnChartEvent is On, it don't work corretly. can you tell me what I do wrong? here there is my code: <Deleted> Tank you too for all help
  Price Line (2)
Hi everyone, I would like to get rid of the live price horizontal line on my chat on MT4, please. Show ask price is off but I still have a horizontal line which moves up/down depending on the price. Anyone knows how to get rid of it? Please see picture below. Thanks
Hello I am a new in MQL and using MQL4 I have a code that gives index out of range error. Even though I understand the error I could not figure out how to fix it. Actually, it is a part of code which I want to take the moving average of willy r for 5 and 10 days then get the difference and just
Evening all, I have an issue with not seeing custom indicators in MT4. I have placed it in the folder in the data folder location. I previously was using MT5 but I switched back to MT4 but by doing so the data folder only has MQL5 folder instead of MQL4, so not sure if this is the issue on that MT4
I'm brand new to coding. I found a course on Udemy that is really helpful but when I want to do something that the course doesn't cover, I really struggle to understand the MQL4 Docs. For example, it doesn't cover adding objects to the chart. Right now I'd like to add a simple vertical line whenever
Thanks for you help. I was wondering when I placed my EA on my chart and turned off my computer. Is the EA going to run?
Guys, is it possible to create a horizontal line in MT4, and when it gets crossed by a candle, to sound an alert (and perhaps open a .dll or .exe file)? I am using this 4H strategy, and I don't want to be bound to the PC... Thanks in advance. Dave
Hello coders As the headline says. I'm looking for a simple MT4 EA that can place buy/sell orders, via a point value measurement from the latest High/Low of the current and latest candle. I have searched for tutorials on the suject. And for paid EA's. But i cant find anything. It seems to me that it
<Deleted - Please post in English only> #property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 DeepSkyBlue #property indicator_color2 White //---- input parameters extern int Kijun= 26 ; extern int Kijun1= 52 ; extern int ShiftKijun= 3 ; //---- buffers double
hi i write indicator for draw arrow when cross moving array and when i change time farme it mess up //+------------------------------------------------------------------+ //| Tamrin 1.mq4 | //| Copyright 2020, MetaQuotes
I'm wondering how I would note a place in time once discovered through a loop. I don't have any code prepared but my intention is to run a FOR loop looking for the place where the MACD value is higher than the current value. Doing that much I understand, but I now want to look at price at that exact
Dear experienced traders, When we use MT4 manual, we will have a chance to fail to close position and we will hear a voice is like "Wooo...". Does EA have same chance to fail to close position? What will happened if the EA fail to close position? Will the EA try to close the position again or never
Hi all, I've found this article about how to add custom indicator to ea. in my code I already create a variable for the input and create the indicator using iCustom function. But when I backtested, it tells me about 4051 error code which is invalid function parameter. Anyone can help me with this
can some one explain the logic dir=((OP==OP_BUY)?1.0:-1.0);
Hi, Can anyone help with retrieving an account number using the AccountNumber() function in an Expert Advisor that was launched using the Configuration at Startup feature? It looks like the EA gets initialized before account login is complete and when I use the AccountNumber() function from
Dear Forum, I've been struggling to read the attached SSRC indicator values without success for days. The value returned by my code is different from what is displayed in the Data Window with same timeframe as the code. For some unknown reasons, the three values are the same and different from the
Hi, I would like that when I take a trade, it automatically open the corresponding chart in my MT4 and when the trade is closed, the chart auto-close. So that the only opened charts are the ones where a trade is currently running. Does anyone know how I could manage to do that
Hi I'm a beginner, could you explain why mt4, during the strategy tester , when he reaches the Take Profit instead of adding the profit to the balance, does he deduct it? Thanks
I am using an EA I struggled to make. It works as I intended it to. Now I want to add an email alert function. The code is trading, however it is not sending me an email when a trade is opened. WhenI run the compiler, I see no errors. I have set up the email server and I am able to send a test email
hi, sorry but I need to ask how to find that "MQL5 Wizard" which said can create a EA in my MT4 ? in my MT4 's meta editor ,, there is only MQL4 no MQL 5 thank you
Hello guys, Was using an EA from the market since last year up to today, my terminals i had a smiley face everything was working, then when i restarted the terminal i got this message: 2020.05.26 01:56:49.815 cannot load
hi guys itry to set the time frame when i attach a script with this code but not work ChartSetSymbolPeriod ( 0 , NULL , PERIOD_M30 ); anyone can help me ? thankz
Hello! I have an issue with my indicator and I'm almost sure it's due to the way I am performing the look back. My problem is basically that when the indicator is loaded, it plots on the chart without issues, but when new bars forms, it doesn't update. Here is the code I am using to perform the
I am trying to overwrite a .csv file. I open the file, read the contents, calculate the result, then overwrite the line. (for some context, this file will have 10 lines, with from 4 to 25 doubles, the file is read into an array[10][25], processed then written back to the file ready for the next
Hi i have dificulties how to make my marti code to multiply with decimals. I use this this NormalizeDouble but when i attach ea error comes up "Invalid Lots Amount OrderSend Function " but when i do backtesting its works fine this is how i code OrderSend ( Symbol (), OP_BUY, NormalizeDouble
Hi everyone, I've found part of code below about trailing stop loss in the mql4 documentation. I'm confused about this part (Bid - open order price) and (Bid - Point*Trailing stop), what those calculation does? Thank you. if (Bid-OrderOpenPrice()> Point *TrailingStop) { if