MQL4 and MetaTrader 4 - page 186

I'm trying to close a grid of orders at specified distance from breakeven point from a void function, without success. This is the code: void CloseGridLong(){   for(int i=0;i<OrdersTotal();i++){      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)){         if(OrderType()==OP_BUY){       // Select BUY...
I am trying to figure out how to make takeprofit and stoploss values accurate.. If for example stoploss is set at 200 points it shows a value of 1.79? If that stoploss is set for 200 points then that value of 2.00? Should it be coded differently so it makes the correct level? If a stoploss of 213...
Assuming I have VPS for MT4, and I want to create multiple MT4 accounts, and apply a separate EA to each account,,, the question is that doable, to keep all accounts trading at the same time
I have lost access to MQL4 Storage and 100's of programs that I have written. I took a few months off at the end of the year, when I returned to trading with a new computer system and a fresh download of MQL4 my programs are not available through storage anymore. Anyone know how I can retrieve them?...
  RSI EA code help  (17   1 2)
Hi...  Need an indicator to trade RSI. where if the value goes above 70 and retrace below 50 I enter short wher if the value goes below 30 and retraces above 50 i enter long  need help with teh code 
Hi, Does anyone know of code floating around that adds consecutive candle volume if they are the same colour. Eg. Green(volume), Green(Volume+previous volume), Green(Volume+previous+previous), Red(Volume), Red(Volume+Previous). Then plot them like the standard volume chart on mt4 ? I have had a look...
Hello experts, I'm wondering if it is possible to write a script/EA which will make edits to a loaded EA without removing it and reloading it. The EA is compiled and I do not have access to the source code. The only way to adjust the settings is via the GUI dialog box (right-click window -> expert...
Hello, I use MT4 and realized I set SL to a certain price level of an asset, in real SL get's hit a lot earlier, since it does not seem to take into account that the trade already starts with a minus, guess is called spread. Eample I sell BTC and set SL to asset price 5300 MT4 showing me a loss of...
Hi all, I'm trying to create a function that on every Bar, determines the Maximum and Minimum values of the MFI. But it's not working. Can someone give me some hints ? Appreciated. //---Function Max and Min values int MFI_Period = 14; double Max = 0; double Min = 999999; //emulate infinite double...
[Deleted]
I have 2 MT4 accounts, before I log in my second account. I should log out the first account, anyone can tell me how to log out, using android samsung galaxi tab 8.9. Thank you in advance
Have seen response to select last open order, but not if we need to select last buy or last sell. I have this functions but no way. // Code for LowerBuydouble LastBuy(){   double Price=0;   for(int i=0;i<BuyOrders();i++){      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)){...
Hello  I need to Open a new Opposite order immediately after stop loss hit if i have a buy order and the Stop loss hit immediately open a sell order with a stop loss at the open price of the previous order and a take profit target 2 times the SL and if i have a sell order and the stop loss hit...
If one entry make profit ,how can open next same orders into this direction in EA How can code it.
Hello, can anyone tell me why my ordersend function wont execute?  #property strict double vbid= MarketInfo (Symbol(),MODE_BID); double vask= MarketInfo (Symbol(),MODE_ASK); double StopLoss= OrderStopLoss(); double openprice= OrderOpenPrice(); extern double LotSize = 0.1; //---------trailing stop...
If I would like to copy a signal where the master account sends something like EURUSDx and my broker use the regular name EURUSD for that currency pair. Is there a way to have an EA on my account that can convert the incoming signal to trade the correct pair by removing the x from the signal...
I need to be able to manually manipulate the stop loss of an EA during testing, as well as some of its parameters.
Hi guys, I have a problem, i want to select the last open order and know the OrderOpenPrice, so i can do: OrderSelect(0,SELECT_BY_POS); double last_price = OrderOpenPrice It works fine but when i have 2 operations this function always returns the first operation OrderOpenPrice, I want to know the...
  SetTradingOff  (5)
IT is possible tu turn off automated trading programatically?
Hi. I am building the automatic strategy and I need the code to count the number of bars from Forex Trend indicator. And hint would be appreciate. thank you
  Multiple MQ4 files in an EA  (12   1 2)
I am brand new to MT4, and am required to use MT4 instead of MT5 because OANDA my broker only supports MT4. I am a C/C++/C# expert. Questions: Using the MetaEditor I do not see a way to organize a set of files into a project. It looks like EA's must be 1 file and only 1 file? Is there a way to
  Excess Printing  (29   1 2 3)
I only want this to print the Spread to the Experts Journal when it places an order when the spread is low enough. Now it prints one every time (their is a Tick?) and more annoyingly, makes a sound. I want to fix it, not just eliminate the sound (< 8) Thanks for any and all assistance....
[Deleted]
Hi everyone,   I have one trading system which I'd like to have as EA. This system is based on renko charts and mindhero indicator.  Why am I using renko charts? The reason is simple. Renko simply filters choppy market. Also it is very useful during news (I'll show you what I mean in example below)....
Have this code: Print("Profit target: ",NormalizeDouble(AccountBalance()*((CloseProfit/100)*OrdersTotal()),2)); But in the experts tab it prints: "2019.04.24 11:35:41.370 CloseAgent XAUUSD,H1: Profit target: 641.8099999999999". Please help.
Hi all, I am not sure if I am posting this in the correct page. I faced a problem when come to code the risk management module . My deposit currency is in SGD and the instrument that I traded is in HKD. I like to allocate 2% risk for every trade that I take using MT4. For example, Hang Seng index is
Hi all, can someone kindly tell me how to make a EA what measures price movement from starting price what can be first bar open price. to point that price has risen or decreased lets say 10pip. and from that price it will repeat the process again and so on. Many thanks.
  Turn ON/OFF Grid  (7)
Hello all, I would like to understand why this code doesn't work. Some expert help please.  Code:     bool ShowGrid=ChartGetInteger(chart_id,CHART_SHOW_GRID,1,value);//         Grid not removed    int OffOnGrid=ChartGetInteger(Chart_ID,CHART_SHOW_GRID,window,value);//  Grid not removed 1) What does...
Hi Everybody!!   I Cannot Edit My User Name On The Custom Indicator Panel For MT4!!   I've Tried Double Clicking On The Period And Every Other Parameter!!   I've Just Bought New Software - Binary Today 5 And I Can't Activate It Without Editing My User Name!!   Can Somebody Please Help!!   My e-Mail...
Hi, I need to code for my system: - atr periods 7 - exponential ma of atr at 35 periods I think that it would be a good indicator for scalping strategy. Thx for your attention.
It seems that OnTick() and OnTimer() event handler used to work before, but recently I found they stop working when I minimize MT4 terminal, and they will come back to work when I un-minimize MT4 terminal. Does anyone found this issue? Test of OnTick() 0       14:48:33.850    EA GBPJPY,H1:...
[Deleted]
I cannot delete a demo account on mt4 mobile (ipad). Any help? thanks.