Download MetaTrader 5

MQL4 and MetaTrader 4 - page 253

To post a new topic, please log in or register
Hi Guys! I just coded a "Buy button" in my EA using the feature "OBJ_BUTTON" ObjectCreate(0,aux_Button_name,OBJ_BUTTON,0,xposition,yposition); and put it into the "OnChartEvent"  for when I click on it, the EA issues an order.. It works on Demo/Live ,  however when I run it over the Strategy Tester...
My Order Line does not appear on my charts anymore. Here are some facts: *The volumes colour is different to the colour of my background. *I have tried placing an order on a fresh chart with no indicators whatsoever and the order line still does not appear. *The trade levels are ticked in options....
Hello, I want to insert a few arrows "Stop Sign" in the Chart and afterwards I want to get the X-Position from the arrows back with the command ObjectGetValueByShift("arrow_Name",i) while i is the arrow (Shift) Position in the Chart. But that doesn't work...the value is always zero.... can you help...
I've just started learning myself mql4 and so far it's going better than a week ago. I'd like to know how can I use a Comment that is posted on the Chart by a seperate indicatot to be called in an EA for use there? Basically what I'd like to do is using a comment that is posted of the HTF indi...
I am studying the great article by Andrew on using NeuroPro with MT5 recently posted on the MT5 forum. Neural Networks Cheap and Cheerful - Link NeuroPro with MetaTrader 5 www.mql5.com/en/articles/830 I understand most of what's happening but I do not speak/read Russian and I don't have a Cyrillic...
Please refer to the codes below. Is there any potential issue if I calculate order profit before closing the order? How should I improve the codes? Thanks for help!      for(int i=ArrOrderSize-1; i>=0; i--)     {      Chk=OrderSelect(ArrOrderIDs[i],SELECT_BY_TICKET);      if(Chk>0 &&...
Let's say there are many loops of orders, each loop follows previous loop. In every loop, there are a series of orders and a whole loop means the series of orders are all closed based on a condition. In order to recover the tracking once EA/terminal/PC is restarted while a loop is still ongoing,...
I am trying to modify an order that is current/open.  To keep the changes that I want to make very simple at this stage (I am just trying to get the code right) all that i am attempting to do is find the order and then change the arrow colour to blue, but I get an OrderModify error code 4109....
Hi guys! I am trying to code the Chaikin Volatility indicator. I know that there is plenty of examples of such an indicator, but my point now is to understand what I am missing and whether I misunderstood how to code in MQL4. The problem I am encoutering is the following: no data is drawn in the...
When backtesting sometimes the "tester/history/.fxt" files seems to always want to rebuild......doing the 1min, 5 min, 15 min  and takes a long time How do you overcome this???? ie. speed up a restart backtesting ???? re-use the existing .fxt ??????
Hello, I try to compile the second example of errors during compilation of the second example of WebRequest. But I get errors.   'SecondExampleWebRequest.mq4'   SecondExampleWebRequest.mq4     1       1'WebRequest' - wrong parameters count   SecondExampleWebRequest.mq4     51      8'WebRequest' -...
I am running an EA to function as a control panel which is filled with EDIT labels, 20 per currency pair. Another EA works on the symbols I want to trade and read the text description of the EDIT fields it needs and assigns it to variables. Everything works fine as long as I have it running on 10...
i need to custom a ui for  special chart,the program i wrote as following: 1.mql script #import "MyChartDLL.dll"  void CreateUI(int hwin);  #import   int winHandle=WindowHandle("USDCADf",PERIOD_H1);      int winHandle=WindowHandle("Lljr",PERIOD_H1);    if(winHandle==0){         Alert("(Lljr Script...
I have a simple formula that is calculating the FastK. I am using the ds array to allow me to access historical values as well. When I use the Print statement, it shows that it is calculating the formula properly, but it is not assigning the value to the specified array element. I have attached an...
Hello, I wonder if there is a length limit for "OBJ_LABEL"? I need to display a minimum of 100 text characters. I feel that there is a problem. Thank you. Franco 
I am trying to create objects of a class that have a global scope. However when I try to assign the instances of the class to the variables (the pf array), I am receiving an error "'=' - object required". What am I doing wrong?...
{   bool   Result;   int    i,Pos,Error;   int    Total=OrdersTotal();      if(Total>0)   {for(i=Total-1; i>=0; i--)      {if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES) == TRUE && //what do I put in the code here to find the Print text in the log?=="my logged print text")       {EA instruction once...
Does it impact my EA performance if I take some data from D1 data on my M15 EA?
Hey,   I want to ask your help with a problem i have,   I build an ea who is only trading short i am done setting my take profit. but i need to set my stop loss at exact the same distance to the bid as the take profit    So here is an example :   Sell order : actual price is 100 Take profit is : 80...
If I want an EA to look back say 50 or 100 bars back for divergence, is it possible? Or do I have to compare the last closed bar with each of the prior 49 bars? Thank you. 
hi, i am trying to  make an alert with laguerre indicator the alert show a message when laguerre is 1 or 0 the firs part il laguerre indicator, the sencond part il the alert which dosen't work it shows me only over sold alert  and this alertisn't even correct    tranks  #property...
Hi guys, I want to write a simple loop that counts how many times some part of a candle (be it Low or High) touches the 200-p EMA. Unfortunately whenever I start the program, it automatically exits without doing anything.  Any suggestions?  Thank you! double...
  Delay between trades (12   1 2)
I am trying to accomplish 3 things with this piece of code : 1)  I want to check the order history and identify the last closed trade of a specific signal associated with the chart/EA. 2) I want to be able to correctly identify the symbol associated with the chart/EA, even though other EA's are...
Hi guys! Here is the simple EA. When I am trying to test the strategy it gives me an error OrderSend 4051, however my OrderVolume is normalized. Can you help me to find what is wrong?  extern int SingleOrderRisk = 10; // in percentsextern int PeriodMA1 = 5; // period of the first MAextern int...
See picture attached what code would I need to get the value of intersection at the green rectangle of specific Fib channel level and Fib TimeZone level
Hey guys,   I am new to this forum and i really hope you can help me out. The problem is that i want to take profit at the lowest point from 30 bars back and i want my stop loss at OPEN[0]  - LOWEST POINT + OPEN[0] but i doesnt work the way i did it :p   Look below and i really hope you can help me...
Hello, I need to create a dialog box with 2 or 3 buttons (e.g. BUY/SELL/CANCEL) and to customize it in a friendly appearance, and I have no idea how to even start such a job (note: MQL 4). Have anyone any suggestion in this respect? Or can the buttons of a Message Box be customized (changing YES or...
Hi  I have coded an indicator which draws arrows and lines and it works. The problem is that when I scroll the chart to the outermost left part of the chart the arrows get distorted and appear in incorrect places. When I keep scrolling in that direction the chart timeline extends and older dates as...
when set up a new mt4 terminal ,the orignal charts have "BUY "/"SELL" on it ,but i can not get the code from the script fold ,where are they ?
Hi Everyone, I am trying to shade the area between the Main and Signal line of the Stochastic and I cannot do it. I try the trick in MA_Shade but it doesn't work. Can you help me to correct it? Thank you, SCFX...