MQL4 and MetaTrader 4 - page 436

Hi guys, Ive went through every material on error 4107 for EAs. I have this Expert that constantly returns this error, but Ive made all adjustments to prevent this - stopleve, normalize double , but still nothing. im adding the code and hope someone has ideas. thanks         double...
Hi, I'm not sure if this will work GlobalVariableSet(_ticketshort,OrderSend("XAUUSD",OP_SELL,PositionVolume,Bid,0,0,0,"",0,0,clrNONE));and later,if(OrderSelect(GlobalVariableGet(_ticketshort),SELECT_BY_TICKET)){etc..} Can I make the ticket number a GlobalVariable?
  about for()  (2)
want  value "TimeOpenFirstOrder" to use how to fix int TimeOpenFirstOrder;       for(int k=0;k<=OrdersHistoryTotal();k++)       {          if(OrderSelect(k,SELECT_BY_POS,MODE_HISTORY))          {             if(OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber)             {...
hi all,  im new to programming and trying to modify a free  EA. what code do i need to complete the below, to show codes from https://book.mql4.com/appendix/errors  {       HandleSendError(GetLastError()); // implement this custom functon on your own.       return;    } many thanks
Hello everybody. I have a very simple piece of code that calculates candle size (current and previous). Then, based on the simple panel sample, I created a panel with 2 labels. I searched, but I was not able to find how to get the variables on the panel. I'm sure there is a way......
Can anyone help me by providing an example of how the following function is used correctly.. #import "user32.dll"   long CreateWindowEx(uint dwExStyle,uint lpClassName,uint lpWindowName,uint dwStyle,int x,int y,int nWidth,int nHeight,int hWndParent,int hMenu,int hInstance,uint lpParam);#import...
Can you include a way to pause/slowdown the backtester after it has reached a certain time or date/time? MT4 tester does not currently have ability to pick HH:mm time of day to start backtest.  So you always have to start at the beginning of the day, even if what you need to obverse is near the end...
Hi, I'm trying to open a buy and a sell order then delete them if they don't open in 40 seconds. The loop is decrementing, but only the sell stop order deletes. I can't figure out what I'm doing wrong. Here's my code: double sell_ticket;   double buy_ticket;      int TotalNumberOrders =...
Ended up getting tangled and confused again by an example given in the manual/tutorial regarding Function Calls. Here's the code: //------------------------------------------------------------------------------------int start()                               // Description of function...
Is it true thatfunctions like iRSI returns 0 (zero) if you haven’t yet open that symbol in thegraph window or downloaded its historical data? In the nextsimplified code theRsi returns 0 for some symbol/timeframe combinations. Is there away to avoid this? string theSymbol = "";int theTimeframe =...
Hi, there is an indicator in sub-window. I want to make arrow signal in main windows not sub-window. In the followings: #property indicator_separate_window #property indicator_buffers 7 #property indicator_color1 Red #property indicator_color2 Blue If I make arrow signal buffers, It shows up in a
Hi The 2 lines below are braking my code: #include <windows.h>#include <stdio.h> Error: can't open "C:\Users\myname\AppData\Roaming\MetaQuotes\Terminal\someid\MQL4\Experts\windows.h" I tried to locate the files manually on my system for no avail Any suggestions? Thanks
Hi The code below is expected to take the screen shot of the chart window as is, but when I shift the chart window x number of bars, it still takes the image as if the chart is not shifted, It also shifts my custom indicator so that it does not align with the chart bars correctly, which is not...
  last order profit  (17   1 2)
Hi all,   Say that I have more than one order open and I just want to get the profit, commission or any other information regarding the state of the last  order. Is the following code the right way to get it ? void OrderGetProfit()          {        Profit = 0;               for(int...
ok so im new to programing in mt4 so i don't know a lot of the functions yet but i think i understand most of it but i don't see where it adds the rsi value after the short name that gets displayed in the top left corner  i also added a rigged up alarm there probably is a better way to do the...
ok so the first ObjectCreate puts it in window 0 (main) and the second ObjectCreate puts it in the 2 i dont know why??? ObjectCreate ( "m5" , OBJ_LABEL , 0 , 0 , 0 ); ObjectSetText ( "m5" , "M5 " + iRSI ( NULL , 5 , 14 , PRICE_CLOSE , 0 )); ObjectSet ( "m5" , OBJPROP_CORNER , 0 );
Dear programmers, How to get market End time and Start time by mql4? I seen post about MODE_STARTING and MODE_EXPIRATION. But i can not able to get that information into chart. Please help me. Thank you.
Hi there, I tried this program, and has the following problem with it. When the price comes close to the action time, I get several buy or sell actions all ending in losses, they are not that big, but they all add up... Once the price have moved away from the cross, it is more stable and remains in...
[Deleted]
Hi all, I was just wondering if anyone could let me know if i am on the right track. I am trying to make an EA which measures the highest point and lowest point for the first 4 (1 hour) bars of each new day. I know how to check for new day : bool IsNewDay() { static datetime OldDay = 0 ; if (OldDay
Not going to argue about this. It's a bug. It's been confirmed by others. I'm done with this. MT4 is problematic, and I don't see it changing any time soon. So i'm deleting the original message.
Hello I'm beginner. I had many questions on this site. Always thank you. I have some ploblem about Interlocking Expert and Indicator. I'm using function of iMA in Expert. But chart and tester don't display graph. but If I push the stop button in tester, that display graph. I want to see the graph as...
Trying to figure out how to find the high between two points in time.  From January 1st to March 1st.  Going in circles.  Perhaps someone could look at the following code and tell me if I'm headed in the right direction. Thanks!...
Hi,  in just found this strategy: https://www.mql5.com/en/blogs/post/712016 Does anyone know as if there is allready a ea for mt4 for this, which gives automated signals`? Thanks!! LISA
hello, is it possible to add a new column to Optimization Results? : I would like to add "Loss Trades". I can use TesterStatistics(STAT_LOSS_TRADES) in Ontester() or Deinit() functions but I do not know how to add the value to Optimization results. thanks in advance.
Hi For some reason I can not get to MQL5. I have a job posted over there that i am trying to complete. I keep getting a not authorized error. I have a separate profile and have money deposited there waiting to complete this project. Is anyone else having an issue getting over there today. Thanks
[Deleted]
Dear Friends, I have a problem, in putting MACD indicator to the chart. As shown in the picture, why can not appears 2 line and 1 histogram as in theory (babypips)? Can anyone help me? Sorry, my question may be very easy for some people, but I am still a newbie. thank you
hi friends, I searched a lot for a code to prevent the EA from drawing arrow objects on opening new trades, without any success. I think it is compulsory to prevent the EA from drawing arrows on opening new trades as it is highly source intensive and would slow the process of back-testing. So I'd...
Hi I want to loop over the open positions in my account and not the open orders. How is that done as OrdersTotal() gives the total number of working orders plus the open positions. Thanks
I opened this topic because I'm searching for a list of different font types To display text with Objectsettext on Chart Who knows where I can find such a list with font types like "Verdana", "Arial",.....
Hello, do someone can help me to fix the code of this Grid EA please ? Its cannot be compiled due to errors.