MQL4 and MetaTrader 4 - page 502

Hi guys I've encountered a bug when spanning a single MT4 instance across 2 or 4 screens.  whenever you buy, sell or close a position, the MT4 will randomly minimize itself back to a single screen (and also then re-arranges the task bar which is quite annoying!) My guess this isn't a supported...
Hi guys, I have an idea to locate my stop loss (in case Buy Order): at the lowest of 3 previous candles (i used M15 chart) I tried using iLowest ((iLowest(NULL,PERIOD_M15,MODE_LOW,3,1)) but when tested in MT4 it wont modify the SL at correct price, even in other trade SL was not modified at all....
  Doubts  (3)
When two currency chart's are open  the first chart is inactive.  How to make it active using mql4 without closing second chart through programming.
Hi, Hoping someone can help me with this. I'm trying to send an HTTP Post with parameters , but have not used them much. How do I format/send the parameters? Where do the parameters go? Here is my basic code so far: void OnStart () { //--- string headers = "Content-Type
when some condition come true and after that need to find current candle'shigh to sell order or current candle’s low to buyorder in same current candle. How to write code? please guide me. void OnStart()   {    doubletickLast;                              double tickCurrent;    double tickNext;...
if(Buy Condition Come true) //buy   {     static double LastAsk=Ask;     double CurrentAsk=Bid;            if(CurrentAsk<LastAsk)      {        LastAsk=CurrentAsk;      }     if(CurrentAsk>(LastAsk+2*Point))     {         tkt=OrderSend(Symbol(),OP_BUY,Lots,NormalizeDouble(Ask,Digits),0,0,0,"BO exp...
Hi. To realize a simple Exper Advisor i need to know the value that MT4 writes to the right of the momentum graph at the top gray line that delimits the graph. To understand this is the dynamic value that appears in the right column at the top limit of the graph. If you can not read it, someone can
When I run strategy tester, a balance chart is created and stored in .gif file. Is there a way to create same chart for equity instead of balance?
Hi, i wanna build a custom indicator containing alert or notification from offline chart. But this indicator will attach or put in H4 or other available TF chart (not the offline). Is this possible?
Hello guys, I am trying to read data from a txt file but for some reason it doesn't work. I wanted to share the code with you in case you may have a solution. Thanks a lot in advance. So the file is a TXT file having only 2 integer values of 1 and 10 separated by XX. So the file content is like...
Splitting a string works if I use: StringSplit(strFile,'\t',arrTab); but this does not: StringSplit(strFile,"\t",arrTab); What is the difference that one works the other not?
The Sleep() function documentation in the MQL4 reference currently reads: The Sleep() function suspends execution of the current expert within the specified interval. The Sleep() function cannot be called from custom indicators since they calculate in the interface thread and may not...
Quick couple of questions, hoping someone can help. If I did this #define NoBox 0#define BoxForming 1#define ActiveBox 2#define ActiveTradePattern 3int GetBoxCondition;int somefunc()   {    if (A==B) GetBoxCondition = NoBox;   else if (A==C) GetBoxCondition = BoxForming ;   else if (A==D)...
Hello All: I am a beginner. I need some simple mql4 codes of buy & sell! 1. Buy: When current market price is lower than last close price,their absolute value of the difference between the last close price and the current market price is 6, then open a buy ticket. 2. Sell: When current market price...
I'm doing multiple broker backtesting for some strategies I've created. The data used for testing is the same at all brokers (via import). I'm testing using MT4 build 1010 on all. I'm not seeing any errors when testing my strategies at FXCM, Tallinex and ForexWare/TradeWiseFX however when testing on...
Hello everyone I want to create multi-currency EA but i have some problem when I want to check last orderOpentime() for each currency order but EA will check orderOpentime() for last order in list. TimeCurrent()-OrderOpentime() >= Timediff { OPsell(); or OPbuy(); } I dont know how to coding for
The situation: an EA has opened two position with aTckt and bTckt and manages them (controlled Comment()). Now I close manually one of them, e.g. aTckt. But the following code neither set _LastError nor does OrderSelect() return false so that n is not incremented and the EA enters the branch: if(...
Hi! I am backtesting a simple EA I wrote and the EA takes a position when the bar closes outside of the Bollinger Band (either upper or lower). But what I want is the EA to take a position as soon as the BB is hit (next tick).  Probably common question, but can't find the information online...
hello, I am receiving the mobile alerts from mt4 to my mobile very late, with a huge lag, sometimes a few minutes, most of the time 2 or more hours. tried to reinstall the app, but with no change. when I restart the mobile phone for a small time I receive the alerts with less lag (even if not
So I have a super simple EA that trades based on the time of day and a moving average . Just made it for fun. I am starting out with EAs so maybe I missed something, but the download amount in the bottom right corner of MT4 increases per each tick until the program crashes. I have an I7 processor so
  dialog  (2)
#property strict#include<Control/Dialog.mqh>//Declare AppdialogCAppdialog OurInterface;Using MT4 Metatrader Editor. Dialog.mqh is not compiling. Please are there any new changes to  to Dialog.mqh header. Thank you.
Hello Master Coding, please help me to add Timezone in to my Test EA .... i really appreciate who want to help me... thank you.... //+------------------------------------------------------------------+//|                                                         Test.mq4...
GreetingsCan any programmer help me to modify the code of an EA I'm testing?It is an EA that trades when price touches trend lines.It uses the color and description of the Line to identify it and execute the order.But I am using trendlines that are provided by a custom indicator.The original EA code...
Hi, I am new by EA. I try to build a very simple EA such as using the MACD to check if there is a golden cross (MACD crosses over the signal). If there is golden cross, go long. If there is a dead cross, close the long position. My EA is attached. By back testting one can see the long position is...
Hello everyone, I am trying to add a loop in an trading EA someone code for me.  The EA uses an external indicator which supplies the BUY and SELL signals the EA uses to open/reverse trades.  I have managed to add a few cool things to the original version by reading the manuals and internet searches...
Hi, Trying to understand why I got the OrderClose error 4051 (invalid ticket for OrderClose function).  I did read all the documentation I could find on google searching for the error code.  Also read https://www.mql5.com/en/forum/139592 . But because I am writing my first EA I don't fully...
  Lot calculation by Vince  (119   1 2 3 4 5 ... 11 12)
Ported from Roman 14.08.2011 06:37 Hey guys, please advise, I am looking for optimal f (for lot volume calculation) by geometric mean method using R.Vince's method. The task: go through the orders history and with increment f = 0.01 from 0.01 to 1, find its optimal value where TWR is maximal. the
i am making an ea that send orders if the volume is above the 21 moving average of the volume buy when i put my conditions for the order and test nothing happen , 0 trades taken what is wrong with my code? double vol[ 21 ]; for ( int i= 0 ;i< 21 ;i++) vol[i]= iVolume ( NULL , 0 ,i);
Hi, I first open 3 orders manually. Then I start the EA which does nothing but close all the opened orders if I delte it from the chart. My code look as follow: ...//+------------------------------------------------------------------+//| Expert deinitialization...
Hi, I see from an EA followings: ...//--- go trading only for first tiks of new bar   if(Volume[0]>1) return;... It seems only when the Volume[0] = 1. it is a new bar, right?