MQL4 and MetaTrader 4 - page 86

To post a new topic, please log in or register
Hi, Firstly, I Have never  write new topic this forum, the format may be incorrect, sorry. I would like to develop my first EA. I tried to convert Custom Indicator to EA, but failed. This codes was correctly compiled as Indicators and succeed sending mailalert. Therefore, I thought that the convert...
Hi, im trying to code a basic program with mql4 but since im a beginner, i don't really know how to code and i've got some problems, i don't even know if my program is okay. when price break the upper side of a rectangle which represent a zone, the indicator should send me an alert when price does a...
  OBJ_VLINE (32   1 2 3 4)
Hello, This is my first time using graphical objects in an indicator. I would need to draw a vertical line everyday at the same time "22:00", could you please guide me to a solution? Thanks
#import "user32.dll"    int RegisterWindowMessageW(string MessageName);    int PostMessageW(int hwnd,int msg,int wparam,uchar &Name[]); got error message: 2019.05.18 12:30:16.944 2019.01.01 00:00:00  Cannot call 'user32.dll::RegisterWindowMessageW', 'user32.dll' is not loaded Menu:...
Hello, Please take a look at this code and tell me why I can't access to  previous candle's rsi  RSIBuf[i+1] ,  I tried this AAA[]  Array but still not working when I try to comment (AAA[i+1]) in the strategy tester I get array out of range error please help me how can i use previous candle's data...
Hi, Is there any way to get an alert (via email or metaquote/phone) when the Tool / Signal "Enable real-time signal subscription" option is unchecked ? Regards Olivier
Hi I have the problem, as in the picture and can,t solving? For example, I want to load a Indicator and then show me this message, it is not possible to auto-tune my MT4 platform, maybe because I installed another M4 platform for another account and then deleted it ... how can cameback natural as...
MQL4, EA how to load Indicator template I saved on computer to the chart? so that I don't need to load it every time manually. thanks a lot
Hi guys, I have a problem with my custom indicator: Then the indicator should mark if there was a band riding so I created a BandRiding.mql4 indicator that works the trend if it is higher or lower than% B after which in the second indicator acquires the data of the first and if in present trend...
I have this EA which has various buttons. Buttons marked with X closes the relevant pair. There is a button "B/S the direction" I want to use this button to do the following When pressed: Criteria: if previous day's Close is Less than previous days Open, Sell. if previous day's Close is greater than...
  Writing EA (3)
I am new to mql4 programming. I have watched alot of video of mql4 programming and i am ready to start developing my own but my challenge is that when I create a new file I dont see the Start() function as i saw it in the video but I am see OnTick(), OnInit(). Has the Start() function been removed...
Dear firends, I want to assign a name on a variable and I want the name to include the Timeframe or the symbol name of the current chart. As an example suppose that I'm running my indicator on "W1" timeframe so I want my variable name to be XYZ_W1 . I want to know is it possible in MQL4 to do so ?...
  NewOrder after last lose (11   1 2)
Good Evening i'm not able to do: Make a new order after the last lost, the new order must be sended when the price crosses the last order close price. the code: //+------------------------------------------------------------------+//| OnTick...
Hello, i am interested if there is any way to move each particular bar to remove space between open and close of previous bar.
Hello Is it possible to assign indicator buffer for all bars to an array while the indicator has bars limit? For example the indicator calculating buffer for last 500 bars , and I want to assign buffer for all bars into an array. because I don't have access source to remove this limit. 
I am new to MT4 trading. I have spec'd and commissioned a EA and trading dashboard via the freelance service for Forex trading. I need to be able to reliably run my backtesting and the robot. I have read that EA on a Mac doesn't work reliably. I have a great Mac and would much prefer to use it but...
Hi Guys, Please can someone help me or point me in the right direction - i have looked far and wide but still no luck...wish i knew some coding . https://www.mql5.com/en/forum/122352 Based on the above thread... i have the RSI and the MA in the same window, my levels are 90 and 10, how can i add an...
Hi Gents, I have the following code  it works perfect on my EA  tester but when it comes to automatic validation  it fails int start()  {//----int TCC = 0;   for(int ii = OrdersTotal()-1; ii >= 0; ii--) {     if(!OrderSelect(ii,SELECT_BY_POS,MODE_TRADES)) continue;  if(OrderSymbol() != Symbol() ||...
Hi all,  All of my custom indicators have suddenly stopped loading in my MT4. When i drag one to the chart or double click the terminal freezes. The Journal tab states the indicator initialized successfully. The in-built indicators work fine though. Another thing is that loading a template with...
Hi Support There is a function to insert directly from code an Alert, just like the image here in the bottom? Thanks for reply
Have this code for building a grid of orders, grid is working properly but OrderOpenPrice don't change its value to match the last OP:    for(int i=OrdersTotal()-1;i>=0;i--){      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)&&OrderSymbol()==Symbol()){                                              //...
I'm a newbie who has done a lot to try and solve the problems but I can't find answers to the following: 1. When running the Ichimoku Ea in the Strategy tester and live the Ea buys, sells and works perfectly, except for at the end of the test run when the MT4 Ichimoku indicator gets called in all...
Hi guys, can you tell me what's wrong with my calculations? Works fine on 5-digit-pairs as well as on metals but to get the correct values for JPY pairs I need to divide them by 100. But why? I thought my calculation is correct for every pair. void OnStart()  {   double openRisk=0;   for (int...
  CloseOrders by FIFO Rules (20   1 2)
I made this code for close from the first to the last ticket according to the FIFO rule: void CloseShort(){   int FirstOrderTicket=0;   int LastOrderTicket=0;   for(int i=OrdersTotal()-1;i>=0;i--){      if(OrderSelect(0,SELECT_BY_POS,MODE_TRADES)){...
I spilled some coffee on my laptop and quickly used paper to dry & clean everything - no damage :) BUT because I wiped the keys my MetaTrader app starts as normal but after a few seconds only the top bar shows - I now have to manually select view and terminal or view and strategy tester etc. I know...
Lot increment is failing when Martingale < 1.5                double NextLong=OrderOpenPrice()-(GridSize*10)*Point;               Comment("Next BUY order at ",NextLong);               double GridLots=NormalizeDouble(OrderLots()*Martingale,2);               if(Ask<=NextLong&&!OrderSend(OrderSymbol()...
Hi, Anyone encounter this problem before? The system cannot optimise the EA in a lower timeframe. It can optimise at 1-hour time frame for the very same EA. However, if I did not do any optimisation in a lower time frame, the backtest is able to come back with some results. When I optimise at lower...
Hello, I have the following overloaded function: double normalize(const double price,const bool normalized)  {   return normalize(price,normalized,0);  }double normalize(const double price,const bool normalized,const int digits_delta)  {   double value=0.0;   if(normalized)     {      const int...
In C++, you can have a pointer to a funtion, giving the programmer the ability tohave arrays of funtions and variable funtions and functions in objects. (here'san example from http://cplusplus.com/doc/tutorial/pointers.html) // pointer to functions #include <iostream> using namespace std; int...
What code can accomplish importing the current bid and ask price of the currency pair that would be in the account base currency, and that would be used in the TICKVALUE calculation?   I ask because more and more brokers are prostituting MT4 data feed by not including incorrect values which the...