MQL4 and MetaTrader 4 - page 9

To post a new topic, please log in or register
Is there a way to set the account number in my mq4 file so it will be locked to just a specific account number when compiling the ex4 file? So, if I want to share one EA with someone and lock it to their account number. I guess it should be a short line of code, but couldn't find anything about it.
I try to execute a script and after the message SUCCESSFULLY LOADED it gets REMOVED. Why?
why these candles appear in meta quotes demo account ? is it normal ? but we test many EA on this account and we found much differences when we  use another brokers one
Hello everyone, I'm looking for a function in MQL4 that returns a color of a specific indicator's buffer. Something like PlotIndexGetInteger(plotNr,PLOT_LINE_COLOR) in MQL5. I know there is a constant indicator_colorN but if I change the color in the input window (tab colors) the indicator_colorN is...
Hello, everyone, I have met a problem when coding EA and I was wondering whether you could be kind enough to enlighten me. The internet connection to the server here is sometimes lost and reestablished automatically. The following is my understanding of EA working when internet is lost and...
I have been using the MetaTrader 4 app on my android for over a month, worked great for what I was using it for. One morning, I logged in around 7:00 am, worked fine. Tried logging in later that morning around 10:00 am and I got the error, Authorization Failed. I contacted the broker to see if...
I'm testing an EA in the strategy tester. To get a graphical representation of it, I also added an indicator, a simple indicator that warns me when the bid price breaks the lower or upper limits of a donchian channel. In real time, the indicator works perfectly, but in the strategy tester the...
Hi, Hi need to preserve a string variable from reset when I change TF. GlobalVariableSet is not a solution for me because I need to apply more times the same indicator on the chart with different properties, so to work correctly the GlobalVariable should have a different name for each indicator...
  Deleting a pending order (13   1 2)
Ok.. i give up, I don't know what else I can do.. I have to SO many ways to do this, and i can't... so,, hopefully you guys can help me out on this one.. The thing is, I have and EA that opens 2 pending orders ( OP_BUYSTOP and OP_SELLSTOP) and all I want is to delete 1 of the pending order once the...
I want to backtesting my EA with the period of weekly or monthly, but I only can find the period selection only from M1 to Daily !
Hi all, I have a custom indicator and I build an EA from it. I would like to know is there any chance to put the indicator into the EA so I would be able to sell it via the market? Iam not talking about the iCustum function, I already use this to use it with my terminal, but nobody would be able to...
Hey all! Does anyone know of an effective way that I could extract the trade history from strategy tester after it is complete, into excel? I am currently doing this manually at the moment, but is a very long process when I am back-testing on 20+ pairs... Is it possible to use Macro's within excel...
Not sure whats going on, adding one makes it an empty controlled statement. Help please. double lastClose;//+------------------------------------------------------------------+//insuring its a new candle function//+------------------------------------------------------------------+bool...
Hi, Im backtesting my strategy under different TP/SL and indicator parameters (as period), so i run a backtesting, i take note of results, then i change my code (TP for example) and run it again to compara with previous results and get optimal profit parameters. I was wondering if i can configurate...
Hi friends, I usually need to change my indicator extern variable's value in order to change my indicator setting and redraw the indicator with the newly set variables. Now for the purpose of saving my time, I'd like to use the objects to change my extern variable's value by only a simple click on...
Hi Is there any way I can hide external inputs and set them to false as default? It will be much easier than modding code. I dont want the customer to see these in the inputs.. but i still want them set to false. extern bool PA8=false; extern bool PA50=false; extern bool PA200=false;
Hi. I'm sort of new to forex. I have a question. Let's say I open a position; any position. There's an initial spread cost (ex. a spread of 3). Next, let's say I'm at a profit of +0.12; and now I decided I want to close myposition. Here's my question. Will my profit be +0.12 - the opening spread...
I want to scan the history of the trades to check if I had 3 consecutive wins or 3 consecutive losses  I wrote a code and this one scan only the last two trades even if I increased the Bistory and make it equal to 4 or 5   extern int     Bistory              =3; int...
I've been reading mql4 documentation, but I still don't understand this well. If I set the period to one hour, does ontick event run every second as the name tick indicate or does ontick even run every hour as I set in the period? Sorry for the stupid question, I'm not really good at this.
  Previous tick's value (39   1 2 3 4)
I, a custom indicator, just got a new tick and am currently in Start already. I need to find out whether I am to move up from the previous tick or down. Where do I fetch this information?
  MT4 History (2)
Hey, guys, what's the difference between ...\tester\history and ...\history\BROKER? I ask this because the archives located in ...\tester\history have more than 200GB!
Hi folks!  I was wondering if there's a way to create a custom Drawing Tool for Metatrader 4 (or 5); concretely something like R:R ratios, Harmonic Patterns, etc. I know that reading in depth the documentation something will come up but I also wanted to know if someone already tried and succeeded....
  Coding help (7748   1 2 3 4 5 ... 774 775)
Hi, Mr. Guru could you please help me to constantly refresh an ea after each tick movement. I have tried everything, But I just can't make it refresh constantly. What lines of code must I insert to keep an ea and indicator refresh after every tick? Tnx
Hi, how can i change position of this? ObjectCreate("HEADER",OBJ_RECTANGLE_LABEL,0,0,0);ObjectSet("HEADER",OBJPROP_CORNER,1);ObjectSet("HEADER",OBJPROP_XDISTANCE,270);ObjectSet("HEADER",OBJPROP_YDISTANCE,30);ObjectSet("HEADER",OBJPROP_XSIZE,260);ObjectSet("HEADER",OBJPROP_YSIZE...
Hello, This is my 1st time purchasing an indicator from the mql5 market. I have a demo mt4.  I have the checks on authorization, selection, payment, and confirmation. The "end" does not have a check. I have my demo mt4 up and when I go to login to mql5 community, nothing happens. I enter the...
I have done a great EA which gives me excelent results when simulating on strategy tester of mt4. On real account it doesn't give me the same results...
I've got OrderSend 138 only if I run it in tester, not in live demo. I've try to adjust slippage point to no avail. Anyone get any idea why this happen? double price = iClose(Symbol(), PERIOD_H1, 1);   if (up > down && up > sideway){      double stoploss = NormalizeDouble(price-piploss*Point,...
Thanks in advance, once open Buy order, current stoploss is 100 point, take profit 200 points. if price moving up, how to modify the stoploss moving up accordingly. thanks
  Limit Value (5)
Hello, How to limit the output which has results between some range values (for example): 240 < outputvalue < 250. Anyone have an example please? I am trying with this code, but give no result: int NumberLimit = 1double outputvalue;for (int i=0; i<BarsLimit; i++){    int...
There are several reasons why an order was closed:         Unknown = -1,         Expiration = 0,         Market = 1,         TakeProfit = 2,         StopLoss = 3,         Risk = 4 In MQL 4, how does one determine why an order was closed? How does one determine if an order was closed by Market,...