Download MetaTrader 5

MQL4 and MetaTrader 4 - page 12

To post a new topic, please log in or register
Hi Guys, I'm working on a EA and I need to check if the Bollinger Bands has crossed in the last X Candle of the specified timeframe... How can I do it ? Should I have to implement a loop where "for X times" calculates the bands and check if the value crossed? Thanks to support !
Hi, For every symbol in MT4 I use a different traded lot size defined in different chart windows, as shown below: How can I access from a script to this traded lot size defined in a selected chart ?
Hi everyone, i want to change the default settings for price alert from sound to notification! When i add new alerts over the chart than the expire date is activated. I want this also off as a default. Thanks@all!
Hi all, is there a way to clear an Excel sheet? I'm developing my on Excel sheet to monitor my positions. I'm searching between the File functions but I don't find it. Thank you!
Hello guys, may I ask you a little question: Is it possible to send a webrequest to a specific port? (MQL4) And how can I set up metatrader 4 to communicate with a localhost? Is it possible to send a request to a "http://localhost:10000/" ? WebRequest returns ERR_WEBREQUEST_INVALID_ADDRESS and I'm...
In mq4 iTime("USDCHF",PERIOD_H1,0) and  how get time for "USDCHF",Period H1, and Bar 0 in Mq5? Thanks
Hi All, I am trying to install MT4 on a new Mac PC and I am encountering problems and please bear with me if this issue has been discussed previously. I have installed PlayonMac and the Wine as advised on the Mac OS instructions. On the PlayonMac Menu under File/Install I am able to search and then...
FIRST TIME I LOGIN, I CLICK "SAVE PASSWORD". But now i forget it. How to solve? Thanks
  SL & TP (3)
Hi, one question, is it possible to delete a TP or SL once added by script? I have also a custom function of OrderModify...but with parameters 0,0 it doesn't seem to work
//+------------------------------------------------------------------+ //|                                                           HM.mq4 | //|                        Copyright 2017, MetaQuotes Software Corp. | //|                                             https://www.mql5.com |...
Hi, I didn't find anything about that in the forum staff: I want to write some Text on the Terminal Window. Very easy with the Comment () function. But the text should only appear if an appropriate extern variable of type bool is set. Problem is that every new call of the Comment () function...
Hello friends :-) I  need some help regarding comments in mql4.  below is my code If (condition1) { Comment(abc) } If (condition2) { Comment(xyz) } The exact problem is if both condition is true at same time , i get only only 1 comment in upper left corner.. I need both comments in 2 lines Please...
Since latest mt4 update, when I compile my EA I am getting the 'i' - undeclared identifier error but cannot see which part of this code is causing it: void CloseOrderSell(){    if ((Ask-Bid) <= MaxSpread*PipValue*Point){    int orderstotal = OrdersTotal();    int orders = 0;    int...
  write to file (2)
I am trying to get a simple script to write the values of the technical indicators to a text file but I do not get the right values.  The output file dates are integers void OnStart(){   int file_handle=FileOpen("h1.csv",FILE_READ|FILE_WRITE|FILE_CSV);      double   macd_buff[]; // array of...
I'd like to return my custom Candle class (inheriting from CObject) from a function. The compiler will complain: "object of 'Candle' cannot be returned, copy constructor 'Candle::Candle(const Candle &)' not found. How can I implement this copy constructor if my class has the following constructor:...
Hi, I have connected a DDE from MT4 to Excel and now I want to use that live updated price to multiply it with an other value but it doesn't work, it just says #VALUE!, how can you solve this? Best regards
On my VPS I have around 120 ms but when I click on the objecg in the bottom right corner to see my ping, there is usually an option for 100 ms. I click on it and it changes, but then I check later and it has automatically switched back to the default. This vps the ping is no problem, but I have...
I have a couple different EA's that I designed.  But the programmer I used just closed his business and doesn't take coding jobs anymore. I would like to make a simple modification to all of the ea's.  Basically, I want to add the function that if the current Heiken Ashi candle on the chart is...
Hi, I make this simple code to display arrow on chart : canvas.CreateBitmap(0,0, "arrow01", Time[0], High[0], 50, 50, COLOR_FORMAT_ARGB_RAW); canvas.LoadFromFile("ObjBuy.bmp"); canvas.Update(); The arrow01 object display correctly. For having two arrows on my chart, I use this code : canvas...
class Child {   Parent *parent;      public:   void setParent(Parent *p) { parent = p; };      };class Parent{   Child *child;      public:      Parent()      {         child = new Child();         child.setParent(this); // << Can we do something like this?      }      ~Parent();};   I need to...
  #property (3)
Hi I want put my ea to mql market .but , i have this error  (EX4 file must be compiled using #property strict directive) I've added this code at the beginning of EA #property version     "1" #property description "my description" #property description my description" #property description "my...
Hi , I recently started trading in forex , i had worked with mt5 , and today i started working with mt4 , and I noticed a “charges” fee in my deals that made all my deals negative in profit , can you help me to understand what is this part for ?
Hello everyone, I made an indicator that counts the number of pips and the profit from entry. I found code to make a toggle button, and I incorporated that into the indicator to toggle the alert On/Off. When I place the indicator on a chart, the alert is off, and that is actually the case, so that...
Hi All   I have previously coded in mql5 however i am new to mql4. I want to basically use my entire capital in every trade. I need to calculate the highest lot size. Here is the function i use in mql5 :      if(OrderCalcMargin(ORDER_TYPE_BUY,"AUDJPY",1.0,SymbolInfoDouble("AUDJPY",SYMBOL_ASK)...
I'm not a coder but I hope I'm giving enough info here for one of you MT4 geniuses to answer! I have a custom EA which was designed according to a set of trading rules and formulas.   When I run it through strategy tester, the trailing stop seems to work properly.   But in my demo account it's not...
I've read a few of the articles about Genetic Algorithms in optimization, and I've read that GA's may have been built into MT4. Does anyonehave any information on this? Does MT4 (build 209) use Genetic algorithms in optimization? Thanks Nick
Hey, I have written the following code that describes a pin bar and a subsequent bar that closes above the pin bar to confirm it, I would like to control the EA taking these trades by having a horinzontal line on the chart named "trigger" that I can manually move to support and resistance levels. I...
I have an EA that opens BUY and SELL orders with a stoploss and takeprofit based on certain conditions. However, when the moving average turns positive or negative over a certain number of bars, I want to close the order. When I do this, I keep getting error code 138 on the OrderClose. Does anyone...
Hi there, I'd like to create an indicator that runs on a different timeframe to the chart on which it is applied. This is so I can compare certain results from a slower timeframe against those of the primary chart's timeframe. The indicator I have in mind (an indicator version of an EA I have...
Hi one question... every time i try to fill an array with variables it returns this mistake  "constant expression required" this is the code: string tab_ordini[8] = { ord_a, ord_a_reverse, ord_b, ord_b_reverse, ord_a_s, ord_a_s_reverse, ord_b_s, ord_b_s_reverse }; and i have declared them in this...