MQL4 and MetaTrader 4 - page 462

Hi all, still quite new to MQL here and have already hit a road block. I can't seem to figure out what went wrong here as I am unable to load the condition if(total>1); My objective is to trigger a trade and once a trade is triggered, the system will detect that there is already a trade running and...
I need to check if a specific market order is open or not and return a Boolean result It returns "not all control paths return a value" bool IsMOrderOpen() { for ( int h = OrdersTotal () - 1 ; h >= 0 ; h--) if ( OrderSelect (h, SELECT_BY_POS , MODE_TRADES )) if
Hi I got a new version of MT4 earlier today, and it has introduced a new error in and existing EA of mine, and that I haven't been able to fix, so I'd like to hear if you can help me. The thing is that I have get error 'Cannot call 'stdlib.ex4::ErrorDescription', 'stdlib.ex4' is not loaded' My
Hi, In the historical center window data, I have imported an historical 1 minute DAX  file.txt  from Jennuary 2015 until these days. And everything went ok! The problem that  I didn’t get updated all the other timeframe. So I thought to myself , now I import the same 1 minute text file into the
int orderstotal = OrdersTotal();    int orders = 0;    int ordticket[][2];    double lots = 0;    for (int i = 0; i < orderstotal; i++)    {        OrderSelect(i, SELECT_BY_POS, MODE_TRADES);        if (OrderType() != OP_BUY || OrderSymbol() != Symbol() || OrderMagicNumber() !=...
  Why do My INDICATOR repaints  (15   1 2)
I see last time to my charts on 12:30 AM Tuesday, There was 2 Arrows showing on the chart, But when I see again on 10:30 AM , I can see only 1 Arrow on my chart , CAD-CHF MONDAY 18 DEC 2017 Why do my Indicator REPAINTS like this ??? Please help me to correct this. Also on CAD-JPY M5 MONDAY 18 DEC...
Hi all Just wondering if anyone has played with this or if it is even possible to get the data from MT4 into a spreadsheet Trying to get currency pair data in so that I can do risk calcs quicker rather than having to input teh values all the time Cheers Seth
  Alert to Email  (2)
Hello,    I would like to implement indicator which will catch an Alert from some another Indicator or Expert Advisors deployed to MT4. Is there any way how to handle the Alert event to take the message and then send it be SendMail() function ? thank you j.
Hi, I have a process that only occurs once and when it does, it dispatches notifications in the usual "standard" ways (email, push etc). However, if I change time-frame/input-vars, as the triggering situation is "recalculated", my EA will re-send notifications. I would like to retain the knowledge...
hi i have more than 30 profiles saved and im using metatrader build 1090. why arent the profiles sorted in alphabetical order when choosing profile to use? it would be easier to pick profile if they were sorted for example alphabetically. now they seem to be in random order. is there some kind of...
Hello Coders, I need to understand this, I have code 1 simple indicator, which Draws the Arrow on MT4. But to my surprise, when I try to load the same indicator on different laptop, then the Arrows are showing at some different place not exactly on the same BAR. Why such things happens ??
Hi, I am fairly new to MQL4 programming.Was doing ok but I am completely perplexed by this bit of code. All I want is to find on a one minute chart, the last 60 candles and compare the closing price to the price of the 300ema, and then set up a counter of how many of those closing candles are above...
Hello Can someone explain to me the difference between these two codes? First ****************************************************************************************** for(int i = limit-1; i >= 0; i--) { if (i >= MathMin(5000-1, rates_total-1-50)) continue; //Indicator Buffer 1
Hi all, I got the error "OrderModify error 130" but I do not why I got this error since I have all required check on take profit and stop loss before to call the function orderModify. Below is my code: int openPosition(int cmd, double volume,double priceDistance=0, double sl=0,double tp=0){...
Hello, I have a rented VPS for FXCM, but is not shown under my PROFILE--->HOSTINGS in my account. I need to change my VPS subscription to another broker's server. I already have the instructins to do so, but the subscription is not there. PLEASE HELP! Thanks!
Hi, I know this question must be already asked earlier but i am not really able to find the proper code for the same. I need the close price for a specific time in history. I do understand that i can get it via iClose[] function. All i need is the working code for getting bars since that time in...
How to turn positive number to negative number vice versa? I created indicator when EUR is down it means the USD is up, I computed the price in EUR/USD
Hi, I need to know if it’s possible to assign a different sell order to the respective buy order. Ex: first buy order was executed and a second buy order was executed at a different bid than the first buy order. I want to assign two different  sell order for my respective buy order. Thank you in...
Hi All, I came across an old script (by a user called Hanover) that allowed you to take a FXT history file and output an ASCII readable file displaying the header record and any number of tick records you choose.  However the MT4 I am running is Version 4 Build 1090 so I need to modify the code to...
This is a very good indicator. The arrow of this indicator appears in the old candle when the new candle is opened and not painted again. I want the arrow to appear earlier in the old candlestick and it may disappear when the candle is closed for manual trading. Can anybody help me with adding code...
I've got a subclass of CObject, which will plot a trend line on the chart. At some point the end point of the line has to be changed (I know how to do that part). However, I have to find the line object, which up until now, I did by looping over all chart objects looking for a string tag I put in...
Are there indicator or script to showing the calendar days (Saturday & Sunday) as an empty candle or empty space into MT4? Thanks in advanced.
Hello, I need to check in runtime, what is the license type of the EA. In MQL4 terms. If it is free, demo, paid(full), or time trial. I need to check this, because my program is mainly designed to work in a tester mode, and it will have a paid version with more features unlocked. This is a question...
Hi, I have a horizontal line that shows a price. I want to put a text on this line but for some reason, I only see the beginning of my text on the right of my chart. How can I see the whole text? Thanks! ObjectCreate("price",OBJ_HLINE,0,0,price);ObjectSet("price",OBJPROP_PRICE1,price);...
I've created 2 custom classes that need to be able to hold a reference to an instance of the other's class. They've been created with the MQL4 class template. I broke them down to the basics. Candle class: #include <Arrays/ArrayObj.mqh> #include "MyTrade.mqh" class MyCandle: public CObject { public
Hallo, please an help. I have backtested and optimized an EA fortwo weeks. Of course it launched sell and buy orders in backtesting stage. Now that it is running in real time on theEuroUsd currency,, it does not launch orders, neither on my pc , nor on avirtual server running 24 hours, although...
Hello there, The title pretty much says it all. I have the following code (I use similar code to add other things to the chart):- void CArrow::_createArrow(datetime time1,double price1)  {   if(_arrowUp)     {      price1-=(_config.ArrowUpOffset*Point());     }   else     {      price1+=(_config...
Hello everyone, I am very confused about what exactly swap means. I found this bit on Google   "A swap/rollover fee is charged when you keep a position open overnight. A forex swap is the interest rate differential between the two currencies of the pair you are trading, and it is calculated...
Hi All I have an OrderSend working on previous Hour Candle at 06:00 Problem i have is that OrderSend is using the last 06:00 which is one day ago? Anyone able to point me in the right direction to read documentation how to fix. Look forward to any replies. Merry Christmas. J
Hello everyone, I have two demo accounts at the moment in which I test my EA's.  I don't want both the EA's to be capable of being enabled on both accounts. Can I use a conditional compilation to prevent this from happening? If it possible, please elaborate on steps to achieve this.