Have been looking at date and time functions and admit that being 68 years old doesn't help. All i want to do is be able to stop my EA from trading for 24 business hours when things are going against me and then let the EA continue from where it
I am interested in the new virtual server but have a problem with the global variable statement saying that they will not work. My current MT4 EA uses "TradeBusy", "TradeNotBusy" global variable to prevent problems with opening/closing trades. How
I can generate and use files in Metatrader but sometimes wish to manually delete a file when i have run demos. Files used to be stored in Metaeditor under MQL4_Files - where are they now please
I know what iHighest/iLowest do but have found that these are quite often hit by spikes in the price. Is there an easy way to ignore the highest and/or lowest and get the second or even third highest or lowest
When coding within a void? If i use the code: OrderClose(MyTicket, OrderLots(), OrderClosePrice(), 3, Blue); On compilation I get a warning "return value of 'OrderClose' should be checked" If i use the code
Please find below my code and log for loading an array, writing it to a file and reading it back (no problem) UNTIL I try resize the array to add another row to store more data. I get no errors but data entered from an order into the array is not
I am probably doing something wrong. I am trying to build an array, store it in a file, and read it back. However, it seems to work but the data read back is incorrect!! so obviously it does not work please see the attached code and the associated
I do not understand what I am doing wrong here. I am getting Invalid Handle messages for writing the file as well as flushing and closing. See the code and the log. Also, why does it print the correct data only for the first loop. HELLLPPPP!!!!! int
How do calculate the above: For example, if I start by placing a trade of lets say 5 lots of EURUSD then on the in the toolbox under the trade tag I can see the order type, the price the order was placed at, the current price & current P/L
Stuck again!! two problems with the code below. First is with the toolbar autotrade function switched off, when I attach this EA to the chart the EA still runs. WHY? Second the EA gives a 5004 error and I cant see why. What am I doing wrong please
I can not seem to get any data into the files I am creating. Who can see what I am doing wrong. The code is stripped down to show only the file code as below: when I examine the created files they are empty (not even anything in the column headings)
has anyone found a easy way to check when the day changes. On MT4 I used the simple code attached. Is there an equally simple way to do it in MT5 please. if (DayOfYear() != OldDayOfYear) {
I feel stupid!! I can not find out how to get the current profit of an open position. tried lots of things like if (OrderSelect(ticket) Print("Profit = ", Profit()); but compiler says Profit function not defined although its in the documentation
I have this code in my EA and I am puzzled by the results. Please can someone tell me where my thinking is wrong as I thought that this should load the current chart prices etc. or if it failed print the error statement and error code . It normally