MQL4 and MetaTrader 4 - page 190

To post a new topic, please log in or register
Hi group. I am trying to develop an MQL4 EA that places arrows on chart. When initiated, the EA will place arrows on past candles. To make it simple, the EA can be designed to place an up-arrow when the previous candle has had a 10 point move (or more) up (Close-Open>10). I am not a coder, but I am...
Hi all, To open an order I use the below routine so it will try again if the order failed because of the "trade context is busy" error. But recently, orders are occasionally being missed because the initial attempt failed because of the trade context is busy error but there are no retries to be...
I am trying to find the largest fib number less than a given input.  I know that a number is a fib number if (5 * n^2 + 4) or (5 * n^2 - 4) is a square number.  Here is the function I am trying but it doesn't seem to work for me.  Can someone more experienced please take a look?  Thank you....
I've got an EA that runs on many currency pairs/charts, and sometimes 2 or more charts will trigger trades at nearly the exact same time. I have filters in place that is supposed to prevent too many charts from having open trades at the same time, but this can be bypassed when trades are opened at...
I am new to trying to script in MT4 - what good resources are the for this?  I want to learn the basics first with some simple tasks like get the values of the previous candle or range of the previous 7 candles for example.
Since the last two update of MT4 when I start the platform I got this message "windows explorer has stop working" and I should accept to restart the windows explorer .. and this could be happen more than one time with one start to the MT4. My OS is windows 7 ultimate with 64  bit Hope you find a...
Is there any way to add encryption when compiling an .ex4 file, so it is very difficultto decompile / reverse engineer? Thanks
extern datetime candledate=D'05.07.2016 16:00';//DD.MM.YYYY. HH:MM                                                                   //---- bufferdouble buff_buy_entry[];double...
Hi! I am, obviously unsuccessfully, trying to paste datetime into string: datetime dt_EAExpires=D'2016.12.31 23:59';extern string EA_expires_txt="--- EA expires on: "+TimeToString(dt_EAExpires,TIME_DATE|TIME_MINUTES)+" ---"; /*2016.12.31 23:59 ---";*/ // --- EXPIRATION DATE ---  This raises an error...
I wonder if someone knows a way how to detect a 'visual' chart launched by the Strategy Tester using a pure MQL. I would like to prevent running my scripts on such a chart, as the chart does not update graphic objects with ChartRedraw(). The IsVisualMode returns false in scripts, and saved chart...
I am a beginner learning to code an EA. well in my EA i m calculating a percentage of range of a candle in Hourly candles. But in calculation 1 extra decimal place arriving such as in WTI.oil my BSO is 49.64 but it is coming 49.645. How can i code to ignore the last decimal place and take 2 places...
Maybe this is a basic question but I can't figure this out Why did my equity decreased more than usual from Friday 23:55  to Monday 00:00 Is there a commission I am being charged with? I am on Alpari demo server 2016.07.04 12:49:14.923 2015.01.05 00:05  macd EURUSD,M5: Bid1.192490 Ask1.192610...
New article Regular expressions for traders has been published: A regular expression is a special language for handling texts by applying a specified rule, also called a regex or regexp for short. In this article, we are going to show how to handle a trade report with the RegularExpressions library...
bpran
Hi, how to force update to 988 without reinstalling ?   Thanks 
Hi everyone First post here, however reading a lot.  Hoping someone here can help with this.  Im struggling quite a bit with the strategy tester. Im not really sure what Im doing wrong as I watched a video code this EA and it showed results. Are there any limitations to the strategy tester that I...
  A technical question (19   1 2)
How do I code in mql4 to find out if there is an arrow on the previous bar and the type of arrow, i.e. up or down? Appreciate any help.
Hey guys, So I have been struggling with this code, and not sure why. All I simply want is my EA to match whatever orders I place. Below is the function I have been using, however, it doesn't seem to match all the orders I place. Not sure if there is a more accurate way for this? int...
Hi all, how I can set EA that identify th trade manually and exit automatically?
Hello, I've coded an EA that among other things calculates iMA from multiple time frames in order to make decisions. When I try to backtest it with the Strategy Tester I randomly get a ZERO result from the iMA function at the very first bar. I then retry it without any changes and usually after the...
  Question for the Guru's (21   1 2 3)
I have an idea for a advisory type of indicator. 1) Calculate the maximum risk of a account using a Risk/Reward ratio and convert into the number of pips allowed to risk.  <Got this covered. 2) Reset the Risk at midnight (Broker Time). < Got this covered 3) Check Order History for losing trades...
I have to rate A Function That riconsce the following pattern of candles who can give me a hand ?     and         tanks     
this MACD with mail alert now working the mail alert it has the option, but does not work i have set the gmx mail  account from the tools in MT4    any body can see if  the codes need some twist 
hi all I'm looking for sample code,  or an explanation, on how to calculate the price Break Even for a few Buy and Sell orders simultaneously   basically this is the scenario 1 Sell order of 1 lot, 1 Buy order 50 pip above the sell order of 1,5 lots at which level i will Reach the break even?  keep...
I looked lots of trailing stop EA, but I just need a function which does not need any global variable and methods. Is there any trailing stop function that I can easily use it by calling? There should be a parameter to put magic number in the function.
Hi guyz This  is a piece of my code bool ordtype;   for(int vou=0;vou<OrdersHistoryTotal();vou++)     {      OrderSelect(vou,SELECT_BY_POS,MODE_HISTORY);      if(OrderType()==OP_BUY){ordtype=TRUE;}else{ordtype = FALSE;}     }  but i think its not optimized, i think its start from the 1st trade and...
Hi MQL4 community, I'm trying to at least get this code to work and I can build from there. I was able to successfully load up a button, however, when I click on it, my code is not sending a message to inform me that the action has happened. I'm doing this in strategy testing mode and wish to...
I looking for the EA Close all to other running meta trader. ( use for general Trading Balance ) As we know part of work trading balance is Close all running trade at other metatrader. Base Trading Balance System preparation : Use 2 metatraders, with each account ( different account and different...
I am testing it with an ECN broker where minimum stop level is 0 & freeze level is 0 too.   Here is the code: int init(){ double CalcDigits = MarketInfo(Symbol(),MODE_DIGITS); { if(CalcDigits == 2 || CalcDigits == 3) CalcPoint = 0.01; else if (CalcDigits == 4 || CalcDigits == 5)...
I need to look a group of some charts together in a sreen ,and also want to transfer to another group of charts . how to set it ? thanks .
Hey Guys, Is there a way to get the highest and lowest point for example between 12pm and 13pm? Thank you a lot!