MQL4 and MetaTrader 4 - page 543

[Deleted]
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...
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();...
[Deleted]
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...
[Deleted]
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...
[Deleted]
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.)      
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);
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...