MQL4 and MetaTrader 4 - page 92

would it be possible to use https://www.mql5.com/en/docs/basis/preprosessor/conditional_compilation #ifdef, #include, etc. to have one codebase for both mq4 and mq5 variants of an EA? the main logic is the same but might call different order functions and other such functions which are different in
Hi, why in the following code does OrdersTotal() not always return an order? void OnTick () { // Timer int hour = Hour(); int timehour = 10 ; // Buy Switch static bool buySwitch= false ; // Adjust Lot Size double lotSize=LotSize; // Current order counts int buyCount = 0
Is there a way to capture the high/lows of an indicator value during the formation of a new bar similar to what we already available for prices: High[0], Low[0] ? I wonder if there is some function already for it on MT4. I am not talking about high/lows of the price, I am talking about high/lows of
Hello, I am trying for a couple of days to solve 1 problem in my EA which I can not solve. The "issue" is following: Lets say I have a Sell trade running. After few positive pips the price reverses and the initial sell trade becomes negative. After x pips in wrong direction I want to open 1 hedge
  Drawing a rectangle  (13   1 2)
Hello, I need some help. Like in the topic's title, I want to rectangles appear on the chart. Of course, I would like to learn how to code it in Meta Editor. It looks a bit like "zone" than normal rectangle, cause they have to stretch until one of future bars will break it through. Any form of help
Hi there, I was wondering if it was possible to get a list of input parameters given to an EA or Indicator? Right now I'm logging my EA's settings to a new file automatically whenever it detects that I'm using different settings so that I can look back and see what I was using in the past.  However,...
if everyone I tried to check if there's an open or pending order using this code, int AnyOpenOrders() { int result = 0 ; for ( int i= OrdersTotal ()- 1 ; i >= 0 ; i--) { if ( OrderSelect (i,SELECT_BY_POS,MODE_TRADES) && OrderSymbol() == Symbol () && OrderMagicNumber()
hi, I need to get how much is bullish or bearish candle in points in real time and after that use if something. I have M15 TF if is my candle bullish with 150 points then use if something if is my candle bearish with 150 points then use if something This must works in real time, not on new bar
  Brainwashing EAs  (287   1 2 3 4 5 ... 28 29)
Statement for Brainwashing 1c, H1 timeframe. 4 main pairs. This is Brainwashing EA with i_Trend filer. This i_Trend indicator is used for enter and exit as well. It was estimated during the development of this EA to catch big trade. The level of i_Trend filter should be estimated once per week but I
Hi at all. This is my first try to add some changes to an code. But I really dont konw how to do this. I tryed some things, but without success. I downloaded this code from the net. It works. But I want to see the input propertys in the indicator options window. There is ony the Alert true/false
Hello forum, I have my entry and my stop-loss and I want to calculate the lot size according to my risk-management. It works fine and this is how I do it: double pipRisk = MathAbs(orderOpenPrice-orderStoploss);double lotSize  = AccountBalance()*0.01 / pipRisk / (MarketInfo(_Symbol,...
  stoploss  (7)
Please , is stoploss different from loss position of an order
I have just written a trailing stop function that starts at a hypothetical 20 pips and progressively decreases down to another hypothetical 5 pips as a trade becomes more and more profitable. It seems to be working but it's really messy and I would love some feedback. Thanks
Hello everyone, I would like to know why my EA send multiple orders (like 2 or 3 with same qty and same price) exactly on the same time ( not always but it appear nearly often ) even if i have some variable to only allow one order at the time. If someone could help me it would be great thanks Here
I need help please. I have a script that closes the opened positions and opens a new position in the opposite direction. But this script applies this function only to opened positions, from the current active chart. I would now like to rewrite the script so that all open trades are rotated no matter
Can anybody think how datetime bar_time=Time[1]; can cause an array out of range critical error while backtesting? It is a client doing the backtesting and apparently the history has been downloaded from elsewhere than the platform broker. I thought that if data is missing, there is a mismatch...
the idea is simple, mabe it is not a smart way to do it. The idea I had was using 2 iMAs to define whether it is a bullish or bearish trend, nothing special. When both iMAs cross, they usually cross right after a new Highest High/ trend reversal, or they cross right after the price ranges. Either
Hey, I wanted to download old experts logs (07/2022 & 08/2022) but when I click the request button I'm getting logs since "2022.08.05 00:00:00.179" and nothing before this date. The terminal logs are present since the start of the VPS (2022.07.14). Is there any auto remove of logs on the VPS side
Hi, My thoughts were this: why can't I reuse histo in the same way as I use "i" ? I use histo for comparison for up/down cross. histo = iCustom ( NULL , 0 , "MACD True" , 2 , 1 ); I use histo_1 for counting void histo_up_count() { for ( int i= 0 ; i < 50 ; i++) { histo_1 = iCustom (
  TCP Sockets...  (7)
Any good examples of setting up a TCP Socket in MT4 to listen for calls? 
This is hard to describe - but anyways, I have an indicator that either paints above or below a bar (maybe a few centimeters) and works great when the quotes are in the middle of my MT4 chart, however when the quote reaches a new low, or simply drops below the previously lowest point on the chart I...
Hi, Is it possible to identify an order sent by an EA or manual? Suppose that the EA sends an order with magic number equal to zero and order comment equal to nothing, i.e., empty strings. A similar question that I have is if it is possible to send an order from an EA where the broker is not aware
I do my data analysis on Python Is there a way to integrate my python data analysis with MQL$ or C++ For example, I would like to determine my next entry using data analysis from python. Once I get the python results, I would like to use them in MQL4 or C++
Hello guys, am using a UNIVERSAL EA for two charts with different indicator strategies on one pair. One is trend trading and the other one is momentum/impulse trading. The problem is, if the EA opens a trade in one chart and a signal is received on the other chart of the same pair say USDCAD, the EA
I am trying to draw Candles of a different currency pair inside the Indicator_separate_window , but its Not drawing correctly , can someone please point to what I am doing wrong here: #property indicator_separate_window #property indicator_buffers 4 #property indicator_color1 clrYellow #property
Hi All, I want to add the contents of an array to a csv file, but I want to append each value to the end on the current line, not to the next line. Here is the code which works perfectly, except for the positioning of the output in the CSV file. #property strict string _sym[] = { "AUDCAD.a"
Hello All, I have an extremely weird and frustrating problem....This problem only started recently so perhaps it's something to do with the VPS or the new MT4 platform(?) I run an EA on a VPS . A week or two ago everything was fine.... But recently when a trade is opened by my EA, a secondary ghost
Hello, I am new to this site and the MQL5 web terminal, (I've mostly used MT4 on my phone, but am trying to transition over to an actual computer) Anyways, I was just wondering... is there a way I can connect my account with an outside broker to this MLQ5 web terminal platform or am i only able to
Hi I'm getting different results running the same code on MQL4. I just ran the same code consecutively and the graphs are different, without any adjustments the code or anything else whatsoever. My initial thought is maybe that this is a result of processor load between ticks, because the processor
hi guys, Suppose i have several nested conditions which every candle is checking and when all of them is true i want to waiting and counting 5 candle. how to do that