Download MetaTrader 5

MQL4 and MetaTrader 4 - page 522

To post a new topic, please log in or register
Hi guys, i was wondering because in Alert functions all numbers are rounded to 4 digits even if the pair has 5 digits. How can i receive the whole number unrounded? Thx
Hello, i tried to build an indicator in a separate windows that shows two lines. First the ADX indicator and second a moving average of this indicator. As a result i get a correct ADX line but the Moving Average line is always zero. Where is the failure/error in the code? // Indicator// Berechnung...
where were my problems ?  #include <stdlib.mqh> /* External variables*/extern double EquityPercent;extern double StopLoss;extern double TakeProfit;extern int Slippage;extern int MagicNumber;extern bool CheckOncePerBar = true;/*Global*/ int BuyTicket;int SellTicket;double UsePoint;int...
  Can Metatrader capture mouse clicks and pass those values into an indicator - similar to the Andrew's Pitchfork.    Someone suggested that WindowPriceOnDropped &  WindowTimeOnDropped may be an answer.   Thank you for your help.   
Hello Everybody! Been using mql4.com for a while now and have finally signed up! Everything about this site has been great and I could not have gotten this far with making EAs without it. So I can't seem to find a concrete answer anywhere for a particular problem and apologies if its been asked...
I need a single moving average ea that trades micro lots, thanks...
Hi, I cannotfigure out how the profit is calculated in MT4. I know thatusually you look at the profit in terms of Pips, but at the end of the day Ineed to know how many Euros I’ve got in the real world. Is thereanyone who can help me understand how the Profit in terms of Deposit Currencyis...
I'm new to programming with MT4 and was wondering how I could cancel a pending order if its not filled by the end of a candle? I'm on an ECN broker so it can't be placed in the OrderSend function. Any ideas would be greatly appreciated.
For each currency pair I use a separate EA. To verify if an position should be opened, I test if there is no open order "if (OrdersTotal<1)" but this will block all other currency pairs to open positions and I miss opportunities. In other words: I want to open only one position per currency pair =...
Ok. Here is problem. Just got home and see this stranger fail on my EA which make me didn't take 30 pips profit.   My EA return the order fail to open because of 130 error. yes, I know 130 error is invalid stoploss. I'm not sure why it is invalid. I set a buy order and the stoploss is lower than...
Hi all, sorry if the thread is not for here. I'd like to ask what program language is the closest to MQL4 and MQL5, because I am also planing to learn Java, or C, or something like that, and I'd like to know which one is closest to MQL4 and 5 >I copied the thread from MQL5 forum, because I think...
This is my first EA, but after a long time spent searching for an error I could't find anything. If you can help me find it i'll be forever grateful. The compiler gives me errors like: '=' - Illegal Assignment Used  '0' - Unexpected Token '&&' - Assignment expected  Please help Thank You  //EXTERN...
APeng
Hi Guys, ATR calculated for a shift bigger than about 8500 bars always results in zero. Do you have any ideas why and how to solve it? wrote this code to check it: int start(){ int i; while(i < 10000) {  double ATR = iATR(Symbol(),60,10,i);  if(ATR == 0)   {    Alert(Symbol()," ",i,": ATR: "...
when test an ea ,a very large log was written ,so the testor become very slowly ,it always write the same useless message like XXXX load sussesfuly ,XXXX removed , the memory is full ,and cannot load the history data .  
I know alerts are a popular question and I have read how to do an alert and faithfully followed an example that seemed a good fit for what I seek to do with an indicator I am working on. I have lines that "cross" and assign a value 1 to a "Long" cross and -1 for a "Short" cross.  My alert correctly...
im new to this site and want to ask a few questions as there is nothing for beginners here. *can signals be seen on my trading platform? or are signals only seen on this site? *is there a way to automatically copy someone offering a signal without having to set up the trades myself? I appreciate any...
I am looking for a way to close ALL open orders rather than just the current code I have which closes just 1 order: void IfOrderExists86(){    bool exists = false;    for (int i=OrdersTotal()-1; i >= 0; i--)    if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES))    {        if (OrderType() == OP_SELL...
Hey guys, to be honest, i'm really disappointed of the latest MT4 software. I just can't belive that the mega bug with the trendline ( moving from timeframe to timeframe ) which had been discussed several times on almost every forum i know, is still there. I just don't get it. It's such a pain to...
Hi Anyone know if it is possible to remove an indicator programmatically from a chart. https://www.mql5.com/en/forum/115967 shows how to attach and indicator, script or ea void StartCustomIndicator(int hWnd, string IndicatorName, bool AutomaticallyAcceptDefaults = false){   int MessageNumber =...
Hi  i ve got the following code that scans the bars on a chart from right to left. What it does is to get the bar from the current TF i m looking at and get down to M1 timeframe and scan the bars there. Eg if were looking at the H1 timeframe then the loop will get each H1 bar and get down to M1...
Hi guys, i have to trades open with the same Symbol, Comment, Trading direction and i'm trying to close both but it only works once. The second trade is still open. Is there anything wrong? int closeTrade(string TD)  {   for(int i=0;i<OrdersTotal();i++)     {      if(OrderSelect(i,SELECT_BY_POS...
I want to setup an e-mail setting in my metatrade4. I have setted it up but could not receive an e-mail. When i contacted the customer support they told me that they only support outgoing messages with port 25. So i need if is there any one knows any generic e-mail that with port 25. Regards Shehab 
Hi  i ve got the following algorithm.  what i m trying to do is to check 1M TF from a higher TF.  while (i>=0)  // i is the standard IndicatorCounted()    {     log ("while i is :"+i);                    for (j=0;j<Period();j++)        {            candles_look=i*Period()+j ;...
Hi Coders, assuming I get hold of an object which happepns to be of type trendline and I want to iterte through its price values; as trendlines usually do, this one also leaves the screen area at some back time point. Naturally what comes to mind is - before I start the price values iteration I...
1)  I noticed that some automated trades are not initiated.  Is there a way to code the EA to try the trade again or do a market order getting the best possible price? 2)  Is there a way to code the EA to set a variable to the close of a certain time of day? Thanks!
HI All I have a major problem with charts freezing as I switch from one pair to another in the same profile. The new chart window opens and the old chart starts to build a minimized window but freezes and all other processes stop. I can open a second chart fine but when I go to switch  to...
I have to recognize , in this case, a long trade has been opened when a pending OP_BUYSTOP has been hit. It returns it to a variable nlongs.  If nlongs is >0 and the price has moved x pips, the stop loss is moved to break even. int GetLongsNumber(){   int n = 0;   for(int x = 0; x < OrdersTotal();...
Hi, I was running backtest on EURUSD and noticed that there is no data between 2012.1.13 thru 2012.12.04. So I went to history folder and deleted all downloaded files and then redownloaded all data for EURUSD from "History Center". Looking at the journal, I noticed that download stopped during Jan...
Hi all,  I want to get the OrderCommission() of an open order, for that have include extra code in the following block, Is this right and if so is it  value accessible in any part of code including void functions if I put double Commission; in Global ?  Thanks in advance for any help provided. Luis...
Seeking help; Live MT4 account stated in notional unit size (ie, instead of 1 lot, trades stated as 100K). However, when programming in strategy to backtest,  MT4 states "Lot Size." Thus, when backtesting, if I put in 1.0 in "Lot Size" (for 100K units) it is being read as 1.0 units instead of 100K...