Download MetaTrader 5

MQL4 and MetaTrader 4 - page 146

To post a new topic, please log in or register
I'm trying to point out the candle, on M1,with the biggest volume within an hour for every hour. The results are puzzling, some do point out the biggest volume, some hours have none. Could you please help me out as i don't know where i'm going wrong with this.     void DrawMinuteDot(string dayhour,...
Hi,  i´m new to programming but trying my best. Currently i´m trying to program EA which will trade after predefined set of points e.g. open order after last trade +/- x points. My EA is working fine until one moment, When i open a trade pending order will be set +/- points only if tick will take...
Hi guys, I want to logout my mt4 account from all device that it is installed.  Can anyone help me to do that. The problem is that I don't have access to all devices and I can't logout manually. I need to do something like Force logout from all at ones.  
void LockInProfit(){   double Balance = AccountBalance();   double Equity = AccountEquity();         if ((Equity) > (Balance*1.01))   {                   CloseAll();                   }    return; }void CloseAll() {  // for (int i=OrdersTotal()-1;i>=0; i--)   for (int i = 0; i < OrdersTotal();...
Dear all, I've been searching the web for the last week, but couldn't find a clear answer, or at least not one that encompasses all aspects of my problem, so I made an account specifically to ask it here. Is it possible to have an external program interact with the MT4 platform from my broker? This...
Sorry to ask this question,pls i need help on an indicator i was working on(modifying to suit my need),i wanted my indicator to use 2 timeframes-1min and 5mins to give a signal by showing an arrow on the bar it occured using 2 indicators, stoicastic ( 5,3,3) and Bollinger Bands_Stop_v2. pls the...
Hi, On History Center, Inotice that for example in EURUSD the M1 was not lighted (the green-yellow icon on the left). However Icould see the EURUSD M1 chart. So why the EURUSD M1 was not lighted? I double click theM1 in History Center, now it is lighted and it seems there is nodifference on chart...
Hi, I made a small script which should tell me if a horizontal line is visible in the current timeframe. The line I plotted is only visible on H1 but whatever timeframe I choose I always get "true" as a response.  I doubt that bool is the correct initialization because there are no timeframe-flags...
How to place multiple orders only when with enough money? Say I need to order 4 different pairs in the order of: EUR/USD, EUR/JPY, GBP/USD, USD/CHF. Is there a way to check is I have enough money before opening the first order? It has to be all 4 pairs or nothing.
New article MQL5 Cookbook - Trading signals of moving channels has been published: The article describes the process of developing and implementing a class for sending signals based on the moving channels. Each of the signal version is followed by a trading strategy with testing results. Classes of...
hi, i want to test some strategies of closing trades. I've already made some tests on historical data with opening and closing trades, but now i'd like to test what'll happend with my real trades if i use different closing strategies. Basically: i'd like to somehow 'import' trades from my account...
When a disconnection occurs when an EA tries to open an order.  Is there a way to ensure that it would place that last order once connection is established again? (Regardless of the conditions that were set for the order to be opened in the first place.)      
Hi, I'm trying to display a .bmp file in a chart (not relative to a time/price, but to its coordinates from the top-left corner). I have tried this script  https://docs.mql4.com/constants/objectconstants/enum_object/obj_bitmap_label but haven't managed to get it working. I got my file, called "30x28...
Hello!  I would like to know how can I get average of moving average difference. I have this but not working. for(int i=0; i<Bars; i++)  {  double EUR_MA=iMA("EURUSD",0,1,0,MODE_SMA,PRICE_CLOSE,i);  double GBP_MA=iMA("GBPUSD",0,1,0,MODE_SMA,PRICE_CLOSE,i);      double diff...
Hello I'm working on a bespoke missed weekly pivots calculation.  If the user pulls such onto an M5 chart, as I process the Bars, if the Time of the last bar (i+1) is Sunday and the time of 'this' bar is Monday, I know i+1 is the last of last week. What I was thinking of doing was then counting back...
Hi gurus, Is it possible to copy a part of a 2D array into a 1D array? So, there are: double 1DArray[100]; double 2DArray[10][100]; I want to copy 2DArray[5][all of the 100 elements] into 1DArray. Is it possible and how? Thanks
Hello everyone, I have a little problem with the moving average cross. The arrow must come out only when the Cross took place, however the code reads even the equal of moving averages. //--- indicator settings#property indicator_chart_window#property indicator_buffers 2#property indicator_type1...
Maybe this can help someone out sometime.... because I have been losing hair and sleep for that last 5 days... When you are using iCustom(Symbol(),0,"AnyIndicator",BufferNumber,Shift) .... PLEASE don't take it for granted that the indicator in question can be in a "Sub-folder" of your "Indicators"...
MT4 Platform The Mt4 Platform automatically saves objects,Indicators,Text on the chart when it is closed. When my PC Closes unexpectedly/Crashes, it doesn't save the  objects,Lines,Indicators,Text on the chart. How can I save the things I have put on the chart  eg; objects,Lines,Indicators,Text on...
As stated in the title, I'm wondering what's the different and when to use iHigh and iHighest? Thank you. 
Hi, i'm currently coding a strategy which requires a Fibonacci in a specific time range. Let say, the Fibonacci levels has to be drawn based on 1 month highest and lowest point.         int fibHigh = iHighest(NULL, PERIOD_W1, MODE_HIGH, *What to put?*, 1);      int fibLow  = iLowest(NULL, PERIOD_W1...
New article How to quickly develop and debug a trading strategy in MetaTrader 5 has been published: Scalping automatic systems are rightfully regarded the pinnacle of algorithmic trading, but at the same time their code is the most difficult to write. In this article we will show how to build...
Thanks a lot for help input double Lots           =0.1;   //at the ea start, enter the parameter 0.1 here//and then there is a "lot" in the block following, there are two assignments for"lot", then what's the 1st assignment for?double LotsOptimized()  {   double lot=Lots;   // the 1st...
Hello,  I have a problem with the virtual hosting in MT4. Aftersynchronization my EA works only until a new tick arrives, after which it isautomatically deactivated.  My approach is as follows:  1) I activate the "Auto Trading" Button  2) I prefer the EA in the chart and activate "LifeTrading...
GUYs: By "secondary encapsulated DLL", I mean I build a B.dll, which calls A.dll. I don't know the exactly tech name of that..... But when I call this B.dll, the MT4 doesn't do anything at all, and there's no error msgs in the log file. Here's the codes. I first build a helloworldDLL.dll which...
Hi friends, I want to know how can I use the data of the indicator that I developed it by myself in an EA. Suppose that I've developed an indicator which it creates numerous arrays that are so important to be used in my EA and in other word, the arrays that are created through my indicator are the...
Hi.   I'm new to Forex and MT4. I've had some success with demo account, but I feel  that trading manually is not my way. I'm a software developer. I think I should use my programming skills in trading. My first approach was to learn MQL4 and try to write some advisor.    After reading documentation...
New article The checks a trading robot must pass before publication in the Market has been published: Before any product is published in the Market, it must undergo compulsory preliminary checks in order to ensure a uniform quality standard. This article considers the most frequent errors made by...
  Cannot write to file (12   1 2)
Hello Im trying to create a .csv and .hst file. Everything seems to run fine, but I can see my files in the directory! Can you please help?
Hello!  I have a wave function I would love to get coded in mql4. It is a parametric equation, x= and y=. how would I code this part? The code should draw this wave on the chart, but I am at a loss.   Thanks!