MQL4 and MetaTrader 4 - page 172

To post a new topic, please log in or register
How do I change my demo password ?
Hello I have a fn which calcs missed daily, weekly and monthly pivots, and plots lines. Due to the lines being triggered by buttons, the calc is done in an EA, not an indicator.  I need to plot the lines to start level with the first bar of the day (daily), week (weekly, i.e. Monday 0000) and month...
Hi   i recently found a strategy that would lose a LOT. You know that kind of strategy that you can reverse and make profit.  I was working on a set of non-tick data (regular backtests)   later i tested the algo on a tick quality backtest and the results were the exact opposite !    yes the "to...
Hello All,   I have to call a function from a third party software DLL in MQL4. The DLL function definition is like this: int func_1(double** X, int rows, int cols, double* A, double *B)   When I try to import the function using above definition, I am getting the error 'pointer cannot be used'  Can...
Hi, I'm using MT4 for the first time and I can't figure out how to calculate the running standard deviation of price differences, i.e., Close_{t} - Close_{t-1} over the last N values using iStdDev? Thanks :)
Hi All, I'm trying to build an ea for binary options (i'm using MT4); I created the code using an online builder and then add few things. The ea works fine with normal forex but not for bo, which is what I'm interested in. Any suggestions to make it work for binary?  Thank you, Cronos...
Hi all, I've goggled extensively and come up empty and was wondering if anyone has come across the following issue. For Brokers that offer trading on futures, the symbol naming system is like this; #CLK5 which is 'May 2015 Light, Sweet Crude Oil Futures'. The K5 part of the symbol name changes...
I have a question regarding the below code.  It is meant to search the open orders and count how many open buy and sells their are for the correct symbol.  In this case there should only be 1 buy order open.  However, is it possible that if the OrderSelect fails to select the order at say i=0 it...
New article Cross-Platform Expert Advisor – Orders has been published: MetaTrader 4 and MetaTrader 5 uses different conventions in processing trade requests. This article discusses the possibility of using a class object that can be used to represent the trades processed by the server, in order for...
I am new to coding but I am learning about it.  I have been trying to set my stoploss to 3 different condition as follow ( Open_Buy Case): 1. My Stoploss = 50 pips if the previous close is not greater than 50 pips compare to previous bar open . 2. My Stoploss = previous bar open if the different...
Hello, I performed a series of calculations to arrive at a final percentage. The code has no errors but the calculation does not work. example: Total excursion Body candle = 36 tenths Total excursion shadows      = 11 tenths mathematical expression (100 * 11) / 36 = 30.55% Can you help me? Thank...
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...