MQL4 and MetaTrader 4 - page 34

To post a new topic, please log in or register
  new bar formed? (23   1 2 3)
Hello, How we know when a new bar is formed, please? It's because I would want to stop analyse, trade...ets when something happened in the last bar. Regards Chris
//+------------------------------------------------------------------+//|                                            Price Close Alert.mq4 |//|                                        Copyright © 2007, SMJones |//|                                            sjcoinc2000@yahoo.com...
Hi Guys,  Im wondering is there a way to limit a HLINE  to show only for the last  10 Bars(for Example). I need something like that in a project of mine, Ive searched, but didnt find anything. Id appreciate the help!  Best Regards Stan
Greetings, I am keen to use this indicator (tdi-with alerts) seems much support for it has ended. Issue 1: Right at the end error says: 'not all control paths return a value' I dont know how to resolve this. Request 1: Add function so that indicator works only at first tick of new bar, not all the...
Hello everyone, I busy making a EA that uses MA5 and MA10. i want to do a OrderClose function when the cross back so . (PMA5>PMA10 && MA5<MA10) BUY order opens. (PMA5<PMA10 && MA5>MA10) BUY order closes and SELL order opens. Can you please look at it and help me out int MagicNumber=1200;void...
Hi Friends, I am trying to write a piece of code to check whether the previous candle body is completely outside of Bollinger bands. So far I wrote the following.   double bolinger_upper_band=iBands(NULL,0,mPeriod,mDeviation,mShift,mAppliedto,MODE_UPPER,1);   double bolinger_lower_band=iBands(NULL,0...
hello, so i included the #include <stdlib.mqh>   i wanna use the std::map from this tutorial http://thispointer.com/stdmap-tutorial-part-1-usage-detail-with-examples/   but when i trying to write std::map<std::string, int> mapOfWords; i getting errors ...   please can somebody help me that uses c++...
Hello, dear users! It is necessary to read the messages in the terminal from alerts. Reading log files is not suitable, because there messages are updated with delays. I understand that it is necessary to use libraries, I'm unfortunately not strong in this. Perhaps someone has ready examples or...
Hi I am new to linux but I have managed to run MT4 on Linux and so far I am happy because it consumes less resources. I am having trouble when restarting the MT4, the attached EA suddenly disappear from the chart. I have to re-attach it again and it's not looking good for the trade if there is open...
New article Common Errors in MQL4 Programs and How to Avoid Them has been published: Some older programs can return errors in the new version of the MQL4 of compiler. To avoid critical completion of programs, the previous version compiler handled many errors in the runtime environment. For example,...
I'm trying to get the stop loss in my EA to auto set behind last three bars can someone show me how this is done, when complied I get error, not all control paths return a value how do I fix this? I have some idea that I have to use: return StopLossBuy;
hello, I made a simple EA that reads from a CSV and opens the orders, there would be the possibility to check if there are already open orders for a symbol?
Hi, Could someone give me tips for this ? 1. Two MT4 are running on the same PC. (each terminal is working on a different account number but of the same broker and account type) 2. I want to create a Expert Advisor code that runs on one of these terminals (let's say 'terminal A') and monitor/operate...
Hi all! I've been trying to close all orders with my custom function CloseAllOrders  which works fine but cant seem to be triggered with the condition if(Bid==OrderTakeProfit()) as seen below in my code. What seems to be the problem? hoping for your help on this guys. Thanks....
Hi, Please coder do alert for this indicator. Thank you.
How can I calculate the required margin? Required Margin = Trade Size / Leverage * account currency exchange rate (if different from the base currency of the pair traded) How to calculate 'margin' for a trade + margin for 45 pip SL? Before I open a trade, I think I need to collect this info: -...
I need two code for my coming up EA...  Before building it,  I want to test an old ea with two conditions..  if you give me the code,  I will be glad... Code it please....    EA will not take one more entry on same pair...  Like if it takes one trade open from eurusd pair,  until it is closed, no...
Hello everyone, Im making my first indicator and I dont understand why its not refreshing/calculating the first bar. The indicator works with no errors apparently. As soon as I drag the indicator to a chart, the whole buffer is ok, but the first bar is 0. And the next bars that will eventually feed...
Hello to everybody, I am getting mad in dealing with array passing to a function. I have defined a function called clear(), with the following prototype void clear(string &[],int); and defined in such way: void clear(string &myArray[],size) {} But when I call the clear function  string...
Hi Is there a way to use mql4 to open 4 charts and tile them on the top of all other charts so that only these 4 charts are visible and equally sized in 2 rows and 2 columns? Thanks
Dear developers, My EA put 2 pending order before the news time. my broker is TRUE ECN and my account also TRUE ECN. I am using MT4. Buy Stop at : 67.70 Sell Stop at : 67.30 With the news time Sell order activated by moving 22pips. So it placed with next available price. Price 67.30 no longer...
Hello, I noticed that in order to read data from an attached chart, I can use CopyHigh() function, for example. Everything is OK when I try to get chart datas of a recent, for example datas of May 3 2018. But when I try to get chart data of an older date, for example May 3 2005, I always get 0.0...
good morning everyone, I created a simple EA that reads the positions from CSV and executes the orders. would it be possible to open positions of symbols other than just one EA? I try to explain myself better, create a script / EA and attack it to a chart, for example EURUSD, it would be possible...
given the following two arrays: string symbols[]=      {       "USDCHF","GBPUSD","USDJPY","EURUSD","AUDUSD","USDCAD","EURCHF","EURGBP",       "EURJPY","EURCAD","EURAUD","GBPCHF","GBPJPY","CHFJPY","NZDUSD","NZDJPY",       "CADCHF","EURNZD","AUDJPY","AUDCHF","AUDCAD","AUDNZD","CADJPY","USDSGD",...
Hello, I have an expert and I would like it to make a WebRequest to verify the current version number of the expert, and alert the user if there is a newer version. I am wondering if there is a way to add the URL to the Allow WebRequest from inside the expert. I assume this may be a security issue,...
hi i just downloaded indicators but they do not open up in my charts on mt4.  nothing happens when i run them am i doing something wrong?
Hello, I have some issues loading historical data. I want to test an expert advisor for which I need lots of 1Min Historical data. 1. When I keep pressing the home button on the 1 min chart to load more historical data, there is only a few weeks back I can go to. After that, pressing the home button...
Hello to everybody... I would like get the integer part of a double number, so I guessed to use the library function MathTrunc() (https://www.mql5.com/en/docs/standardlibrary/mathematics/stat/mathsubfunctions/statmathtrunc) but such function is not recognized by the compiler. How could I use it ?
Can somebody help me how to make a program in MT4 for plotting dynamic horizontal line (such as for High/Low), dynamic vertical line (such as for date) to chart...?Thanks for any kindly help :)
I have loaded an EA on my mt4 platform.  When I try to put it in my chart I get an error message that says its in my library stdlib.exe4 When I go to the dependencies part of it I get a message under the library exe that says STRING ERROR DESCRIPTION (INT) Can somebody please help me fix this issue?...