Download MetaTrader 5

MQL4 and MetaTrader 4 - page 310

To post a new topic, please log in or register
string a;      if(a=="") Alert("ok"); if a equel empty, How do I write
Dears, How to get the latest time in seconds with functions? e.g. if now the candle time is 2014.11.10 21:15:25, how to get it and transfer it to seconds? Thank you very much!
Hi all, I'm new to mql4 and was wondering if anyone knows of an EA which sends an email once a trend line I have drawn is either touched or passed through? Many thanks
I'm trying to add the total amount of volume over a number of periods.  The following code displays the volume of each period from the start of the day to the current candle.  Not able to add the volume amounts of each candle together.  Can anyone show me what I'm missing?  Also, the code for...
  ATR-MA (1)
bom dia gostaria que alguem me ajudasse, estou procurando um indicador onde tenha o ATR sobre MA, para ver a variação de tendencia, esse indicativo fica em baixo da tela com as duas funçoes...
Hi, i know that basically it can't be possible but someone know a solution for create a subwindows with an expert advisor in mql4?  Thank you 
I do not know why I cannot OrdersClose() I understand the parameters which seem clearly defined in the documentation I am not getting any errors and believe the condition to close the orders are coded correctly. I have moved the function call around, and used many print statment to attempt to...
Since my broker has updated MT4 to Version 5.00 Build 996 the SweetSpots Gold indicator shows horizontal lines without pricelabels (like 1,24000, 1,24100, 1,24200). The MetaEditor compiler says in the new MT4 Version 5.00 Build 996, variable 'pricelabel' not used:     How can i fix this issue? The...
I'm learning MQL4. I'm studying programming in MTF. Now I try to put zigzag "M30" in the current graph. I made the following code, but does not show me the signs. What am I doing wrong? #property copyright "2006-2014, MetaQuotes Software Corp."#property link      "https://www.mql4.com"#property...
Hello, Im new in MQL4 and i wrote a indicator with just global variables and int start() function. It works, but when i start the MT4 again the Indicator is dissapeared.. Which Code i need in my indicator that it is still in the Chart after New Starting MT4? Thanks
I am battling to find a way to do something simple I want to display the Highest TP and Lowest TP on my chart using two variables. TPH (Take Profit High) TPL  (Take Profit Low)   The end result will be an alert  that starts sounding 0.0010 before the TPH or TPL is hit.  Its part of a scalping EA I...
Hi, I'm wondering the easiest way to close all charts. I need it as I have a script that opens about 50 charts to apply a template, and I want an easy way to close them all. I have utilised this script  ( https://www.mql5.com/en/code/11566 ), but it only closes charts of the same currency pair....
I've been working on this for a while today and I just can't find my mistake! I modified an existing script that exports MT4 data and changed it a little. I added more pairs and removed the moving average export functionality. Now I'm getting an error stating the parameter count is wrong. I've...
I am having issue with my EA. I need it to open trades at the beginning of the trading day. the issue that I am having is that when the ea sends the order. My broker gives me the error that the market is closed or busy. So I am trying to add a delay to the ordersend to execute a minute or less later...
How do i calculate the seconds since the beginning of a bar ( or the seconds before ending the bar )?
what is the Problem in my code? I have very limited knowledge on mql4. Just wanted to code somehow sup according to my imagination. Thanks. int start (){double Temp1;check4sup(Temp1); Print(" Temp1 = ", Temp1);return (0);} double check4sup(double& Temp1) {     int i;   double LOW[500];...
i want to make a daily pivot point ea for my mt4 five or four digit broker.if anyone can make this ea then i will give him 21% profit when i trade by this ea.interested person mail me and add me on my skype id. email: john01823@gmail.com. skype: john89786
In a custom indicator, we can set  #property indicator_chart_window or #property indicator_separate_window   How can I draw indicators (e.g., indicator_buffers 2) on both a separate window and the chart ? One drawing goes in the separate window and one on the main chart!    
Is this not legal ? ticket = OrderSend(Symbol(),OP_BUY,martingale(),Ask,3*pips2points,Ask-(StopLoss*pips2dbl),Ask+(TakeProfit*pips2dbl),NULL,MagicNumber,0,Green); The return value of the martingale() function will be a double Please advise
I currently work with offline charts, in fact offline charts are the only charts i look at. I have a problem though, im trying to set up a DDE/excel thing and excel is not accepting the custom chart name. =MT4|BID!EURUSD would be the standard way of putting it into excel, its just excel wont accept...
Why in the following code, does not draw logarithms? //+------------------------------------------------------------------+//|                                                   Logaritmos.mq4 |//|                        Copyright 2014, MetaQuotes Software Corp....
{      int OSS,OTS;      bool OCS;      OSS=OrderSelect(NULL,SELECT_BY_POS,MODE_TRADES);      OTS=OrderType();      if(CC1>iMA(NULL,0,48,0,MODE_LWMA,PRICE_HIGH,1))      if(OTS==OP_SELL)      {      OCS=OrderClose(OrderTicket(),OrderLots(),Ask,3,clrRed)&&PlaySound ("alert2.wav");      }}{      int...
Topic.., please,  cant find a proper guide for that on google.., thanks.. 
Dear friends, I have built an arbitrage EA that is ran on different Mt4 platforms. These EAs save timestamps and prices into the hard disk, which the other platform reads. Is there a more efficient way to communicate these two platforms that doesn't involve writing files to the hard drive every...
Hi, I created an indicator to display volume + spread as 90° turned text objects in its separate window. At the beginning everything looks perfect!, but after a while (some hours on the m1 chart) it gets mad look at the attached snapshot. Can it be that mt4 gets into troubles by the non standard...
  zero divide problem (13   1 2)
{BR1=CandleBody1*100/CandleRange1;BodyRange1=MathAbs(BR1);} So im trying to get % of the candle body to candle rande, im getting this error zero divide and the ea stops trading. How can i fix that? Thanks Piero
On build 711, if I compile an EA using the command line compiler mql.exe: 1. The EA will not appear in the experts folder unless the terminal is restarted 2.  Even after the restart, the EA is grayed out can not be attached to a chart.  NOTE:  This is not the normal "gray out" when an EA has not...
Hi,  I am trying to developer anEA by using the following indicators. However, I faced some difficulties andappreciate if anyone can help me. EA Inputs: Lots: 1.00 Takeprofit : 20 Stoploss : 15 TrailingStop : 5   Indicators used 1.      1)  MT4-LevelStop-Reverse-v2 Parameters:       2).  Center of...
Should "Close" be regarded as latest Ask or latest Bid price? or the middle between Ask and Bid? Thanks for help.
i want to make a ea by daily pivot indicator.i have no any knowledge in mql4.if anyone make this ea i will give you money when the ea make profit.email me and i will send my strategy.if anyone interested pls email me at john01823@gmail.com.