MQL4 and MetaTrader 4 - page 134

To post a new topic, please log in or register
‌How do I code the movingaverage variable‌ so that it gives the exact correct data ? ‌In other words , I cant correctly retrieve the iMA data. double  iMA(   string       symbol,           // symbol   int          timeframe,        // timeframe   int          ma_period,        // MA averaging...
Hello everyone, I have a problem regarding an EA in Metatrader4 build 1045 (SimpleFX MetaTrader 4 Terminal) on Windows 10. Until a while ago, the EA worked just fine. The problem is.. I make little improvements every day, and some day it stopped working properly (or simulating until the end).   The...
If I set up using this as shown in the figure, apply the regional language to English.   But,If I changed the locale language as shown below.It is not right.   How is this if i send a program to someone else i can not ask him to change the system settings.   Interestingly if I edit the script with...
Per this article on MQL4 https://www.mql5.com/en/articles/2555 ‌ Errors that occur when working with symbols which have insufficient quote history If an expert or indicator is launched on a chart with insufficient history, then there are two possibilities: the program checks for availability of the...
Hello, I want to have a random number between 280 and 340 at the beginning of my EA.‌ So, I tried to make it in the onInit() But they have all the same value when I have, maybe, 5 charts with the same EA and I restart Metatrader and they load all at once. So, how can I build for each chart a random...
Hi, Is it possible to oblige an EA to trade only long or short from code. I know it's possible manualy, but by code? ‌If, yes what command have to use please? Thanks‌
Hey guys, I have an EA that puts a buy trade when basically there is no signal. What could be the problem? Any ideas? ‌Here is the code: //+------------------------------------------------------------------+//|                                                      ProjectName...
I want to test a trading system with the strategy tester (30 Minute timeframe). Trading this system I first decide discretionally whether I determine the Market to be long or short. So for testing the system in the Strategy Tester I need to define a certein period of time, let's say from Jan. 1st...
brianroxxxfx
      ‌I am getting improper enumerator errors for these following 4 lines, ‌ maOpen=iMA(NULL,0,MaPeriod,0,MaMetod,MODE_OPEN,pos); maClose=iMA(NULL,0,MaPeriod,0,MaMetod,MODE_CLOSE,pos); maLow=iMA(NULL,0,MaPeriod,0,MaMetod,MODE_LOW,pos);‌ maHigh=iMA(NULL,0,MaPeriod,0,MaMetod,MODE_HIGH,pos);
In the code below, the error comes up on ChartOpen.  Now, despite the error; the chart still opens.  After going through a few things, I actually found out the problem.  MT4 using too much memory.  I made the following changes: Somehow after I installed MT4, I forgot to change the Max bars property...
Hi, I have built an EA from scratch and am running it on AUDUSD 30M.   I have done lots of backtesting which is fine. Then I ran the EA on two live demo accounts on VPS servers for 2 weeks and the results are good / in line with my expectations and the backtesting. I decided to put real funds into...
Hi All, ‌‌Not sure if I am posting in the right forum here as I don't see any reference to MT5, only MT4, so apologies if I am in the wrong place. Also, is this just for programming backend stuff or for all help? I guess I am about to find out. ‌‌New to Metatrader and I was just wanting some help...
With the help of my friend, i have got an ea coded, which works perfect. I am checking it for past one month and till no no loss.... It's performing very well. But the only problem is, it opens multiple trades whenever a signal is generated... I tried to restrict that, but i get errors while...
Is there any way to make the latest build/release of MT4 portable? In previous builds, I had all my terminal installations, installed on my D: Drive under a directory tree structure organised by Broker, Live/Real and Account with hard-link junctions points for common areas such as experts,...
In the following code why does it return my object AVGVol1 as 0.0 and not the average of volume it should? I see AVGVol[0] works and returns the volume okay, so this array work as far as I see‌. But it doesn't work within the iMAOnArray parameter? Why not? Any help on this I would be much...
Hi,  In my EA based on MA's I want to have a trailing stop attached to any open order.  I thought I did it right but the trailing stop moves both direction, not only following price up (or down if it's a sell position).  For instance, open price buy position 100, ts 10, price moves to 110 and my sl...
As I understand it, Bid price is the actual market price, while Ask price is an artificial price which is determined by each broker for either Opening or Closing an order (creating the 'spread'). My question is, what constitutes a "tick" ? i.e. a tick is the point of incoming price change. When I...
I am very new to MQL4 How to pass ENUM values to array -  ENUMDataInput?  How to programmatically count ENUM size (so I don't have defined ENUMSize=5) ? Thanks for the help. ‌ enum MALines{_20=1,_34=2,_50=3,_100=4,_200=5}; int ENUMSize=5; void LinesArray(string ENUMDataInput, int ENUMSizeInput) {...
A couple of days I did deposit some money in my mql5 account. When looking at MT4 the Balance was not updated. I‌ don't remember what I did, but finally it worked. The other day a friend of mine had the same problem and now my brother as well. I‌s there a way to refresh this so I can see the balance...
Hi ‌I'm attempting to debug MQL4 code in MetaEditor 5.00 while using MT4 as a platform and cannot seem to debug my EA or Indicator code. Breakpoints are ignored when I select Debug/Start on Real Data (having selected a market under Tools/Options/Debug) and there is no 'debug' section visible on the...
Hi, I get this error "Tester: exchange rate cannot be calculated" when trying to backtest indexes such as _DJI on Alpari. This error doesn't occur on Forex, Futures or CFD just indexes. I saw that this error was mentioned in the old forum (in Russian) and using Google translate I somehow understood...
if i order a VPS from mql5.com and run an EA which uses the WebRequest function, will it be able to send http requests?
  Array to file (3)
I have an array (example[]), that i want to print to file. What i am doing wrong? The data.csv file appears in folder, but it's empty. ‌‌This is the code: ‌In main section: input string InpFileName="data.csv"; input string InpDirectoryName="SomeFolder"; string path=InpDirectoryName+"//"+InpFileName;...
  Signals (3)
Dear all I have download MT4 in my VPS space. I'd like to copy a Signal but I cannot see the label "Signal" where I can find the signal that I like to copy... do you know why? Can you help me?‌
Hi, ‌Are pending (!) buy/sell stops with a stop loss automatically deleted when the stop loss is reached before the order gets active? R‌egards,
Hi I‌'m attempting to debug an MQL4 EA in MetaEditor however I am not being offered the 'Start on history data' (or indeed the Start on Real Data) option under the Debug menu. It is greyed out despite me specifying a dataset under Tools/Options/Debug. U‌nder the Journal tab of the Toolbox I see the...
‌ ‌triling stop working with buy orders but not working with sell orders can any one help with that to make tsl work for both sell and buy ‌ thanks in advance‌ // Determining the TP, SL and TSL Levels void Set_Levels(){       double PP=MarketInfo(OrderSymbol(), MODE_POINT);    double...
Hello friends, ‌I develop and EA to open order base on multiple strategy.  C‌ode should draw a OBJ_TEXT on each new OP (Chart & snippet code as below)On the next Sell Order(same strategy), it should also draw OBJ_TEXT again (Sell Order), as marked in blue circle.so i figure out what's wrong, the...
Hi, ‌ I wanted to use the expiration date on pending order. ‌ void openShortLimitTrade_RSI(double value) { // TrailingStopDistance    int ticket = OrderSend(Symbol(),OP_SELLLIMIT,Lots,value,slippage,0,0,"RSI_EA",MagicNumber2,TimeCurrent()+60*60,Red);    PlaySound("alert.wav"); .... }‌ ‌ While...
Hi, ‌ I‌ have an EA which is have specified 2 time frames to run on (1 hour and 15 minutes) ‌ W‌hen I run the EA, do I need to open 2 charts with different time frames and run the ea on the 2 charts? ‌ W‌hat would be the best solution if I would only like to run the EA on 1 chart but the EA will...