MQL4 and MetaTrader 4 - page 374

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...
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...
[Deleted]
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...
[Deleted]
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
Hello, I'm trying to write an EA but I have a problem when I do a backtest. It seems to work properly for a moment and then it does something that I really don't understand. The problem: 2 15:22:04.133 2018.11.07 02:42:47  DoubleScalp(1.2) EURUSD,M5: open #352 sell stop 0.02 EURUSD at 1.14519 ok...
Hi, Im having issues with an array that will constantly return compiler error for this array. string time1 = timeperiod1,time2 = timeperiod2,time3 = timeperiod3,time4 = timeperiod4,time5 = timeperiod5,time6 = timeperiod6,time7 = timeperiod7,time8 = timeperiod8,time9 = timeperiod9,time10 =...
MQL4 how to identify in the past 10 days, MA 20days never below MA 10days? which means the 20-day average line is always above 10-day average line. thanks 
Hi, How do I code this? I want to have a system that will sell when price crossed below its 100-bar moving average and the price must stay above its 100-bar moving average for more than or equal to 20 bars Thanks in advance
When using strategy tester on say H1, it initially uses lower time frames as shown just above the progress bar - for example it states, "collecting M1", then "collecting M15".  Can someone explain that please. 
Greetings, I have the latest version of MT4 and the F12 function does not work for advancing the chart bar by bar. Nothing at all happens when I hit F12. Any suggestions on how to make this work?  Thank you Mike 
Hello, I have a pending order expert advisor which places many pending Buy Stop orders and Sell stop orders with a specific gap, one after another. But the only problem is that it is placing Take profits and stop losses according to pips for example if a buy position at 113.560 it will place 20 pip...
Hi. Since we usually set a lot size of every EA in the appeal to a maximum drawdown (max DD), then THE MOST IMPORTANT ISSUE is to see a graph display of a balance and a drawdown on the same chart, to see its curves and values in each changed point OR, at least, to know what is a balance value [USD
How do i remove the red 120 number on mt4 market tab ? I tried to click every tab in market and scroll it up and down. https://imgur.com/a/jNobsGP
On MT4 it has a DOM. Ok, On any other charting software, the DOM will show the stop and limit orders on the prices above and below the current price. Not on MT4. I dont have any orders showing. I have ask the broker, Hugo's way, and they say yes that is the way it is.  Not much of an answer. How is...
I have this codes but not work close function How can I success it extern double LotSize = 0.5 ;int BuyTicket; int SellTicket;int magic;double atr_current, atr_past;//+------------------------------------------------------------------+//| Expert initialization...
Hello everyone Some times people ask me to edit their EAs. I have built lots of EAs before but when I see a code which is written by somebody else it's difficult for me to read it. It takes much, and I always afraid of missing some small but important thing. So please share your experience about
[Deleted]
Hi everyone, Recently,sometimes when my EA sends a request for an order,I receive the following errors: 2012.11.13 13:00:26 AUDUSD ,M15: Alert: AUDUSD Opening order Sell... 2012.11.13 13:00:26 AUDUSD,M15: Alert: No prices. Waiting for a new tick.. 2012.11.13 13:00:26 AUDUSD,M15: Alert
Hi Guys.. the indicator is drawing the single line w r to close price bars with two colors. Blue color always up & red color always down. whenever the close of present bar=previous close bar then continue the previous color. so here the specification is : i)Connect Blue line from C[i] to C[i-1]:...
Hi, I am planning to write a code where I can plot 9 SMA on to the William's R (14) in a Separate indicator window. Not able to do it. Appreciate if someone can help. I have a strategy that is working great with this combination, but want to do int MT4. thanks, Pratyush
Hello friends, I am testing this EA at the moment. This will only allow one trade at anytime and will close the current order if you switch to a different chart. The EX4 file shouldn't allow you to use it on a real account , if it is attached to a real account it will not start and EA ends straight
  Kama crossing  (5)
Hello I created an expert advisor, to open long and short positions at the intersection of two KAMA, can anyone help me figure out why I don't get results?
Hey guys, I'm very new to MQL4, I'm trying to convert a setup from my mobile phone to EA. I coded the setup as custom indicator, but when I'm calling it from EA and comparing the suppose entry from my mobile app, I noticed the entry is bit off and found the indicator value are not accurate. The...
Hello, i would like an indicator that show me the average true range of a candle based on past time candle Example: 06/05/19 candle 12:00/13:00 value = 20 07/05/19 candle 12:00/13;00 value=30 08/05/19 candle 12:00/13:00 value= 10 09/05/19 the indicator show me the average range of this (20+30+10/3)
I think - Stochastic is quite a promising indicator for automatic trading. But it turns out it is not that simple! I have made a very simple (about ten lines) Expert Advisor based on stochastic without any "excesses". Entry - crossing of the main line over the signal line. Therefore, the algorithm
  Average Range  (1)
Hi all, I wrote this code to calculate the average range between high and low. Could you tell me if it's ok or have you got a suggestion on how to improve it? Thank you Where Periodo is an external int. int start()  {   int limit;   int counted_bars=IndicatorCounted();   //---- last counted bar will...