MQL4 and MetaTrader 4 - page 729

I can select last opened order using <decompiled code removed >. But I can't select first Ticket. I have tried more time but failed to do. Give me any suggestion please
I know a bit of programming. Now,mql4 & mql5 use  same programming. So,I think I need learn about the OOP Programm.  But I can't find on the OOP documentation.I found MT4's own include file.     I think that these files are very useful. But can't the Document about these file. However,I have a...
[Deleted]
Hey guys, Ive got a little problem with my mql4 script. I wanted to detect the market for special candlestick patterns. So I wrote a code with a specific condition(1). To keep it easy and short, Ive declared period[x] with all the different timeframes and witha specific chart symbol(2). To check
What's wrong with this?, total = CountTrades(); if (total == 0) flag = TRUE; for (cnt = OrdersTotal() - 1; cnt >= 0; cnt--) { OrderSelect(0, SELECT_BY_POS); if (OrderSymbol() != Symbol() || OrderMagicNumber() != MagicNumber) continue; if (OrderSymbol() == Symbol() && OrderMagicNumber() ==
I want to use time for stop entry order this is my code: int d =TimeDay(TimeCurrent()); int h=TimeHour(TimeCurrent()); if(OrdersHistoryTotal()>0){ for(int i=OrdersHistoryTotal(),i>0,i--)   {OrderSelect(Symbol(),h,MODE_HISTORY);       intD=TimeDay(OrderCloseTime());...
Hi, I recently realized that the clock of my vps is delayed by ~30 seconds per hour. After some searching I found the reason. Acc. to Einsteins's fomula ;) delay² = 1 / (1 - x²/c²); // c = speed of light, x = speed of the server-farm   ... // as one can see easilyx² = c² * ( 1-1/delay² )x  =...
1. It seems that, in automatic settings, an Expert Advisor is run tick by tick. In stock or futures applications, a tick typically means a trading order. However, the historical data are all based on Open-High-Low-Close prices (plus Volume) of a one-minute bar.  Does it mean that the minute bar...
I want to make changes to the attached indicator, but I have zero coding skills .... so, basically I always do such things with an trial-error approach ... I tried hard the last days, but all I managed to do, is to break the code ... so I am really stuck now ... What I want to have: #1 most
I have a problem with the wrong sl and tp tester everything is working properly int OrdSend(string _symbol, int _cmd, double _volume, double _price, int _slippage, double _stoploss, double _takeprofit, string _comment="", int _magic=0, datetime _expiration=0, color _arrow_color=CLR_NONE) {//Send...
[Deleted]
how to make new order in MT4 working again?
Hello I'm Trademenot, I  been studying & Training  on writing E.A.'s  Since Last December 2013. I back tested , now I'm Forward testing my E.A.'s Live  and I have 2 Demo Account's. If I log out of "Demo Account 1" by signing into "Demo Account 2"  & Each "Demo Account" is running a Different EA...
  Statistics of a anti-grid like system  (62   1 2 3 4 5 6 7)
Hi fellow traders, One of my current projects has reached a state where i don't know how to progress. I simply don't know how to categorize an anti-grid like system. The system uses no indicator, and is based on the assumption that the market will not be sideways forever. The overall target is
I'm having this dilemma of actually quantifying a strategy as accurately as possible. Speaking more precisely; if I back-test 12 different pairs and I wanted to build a simulated model of all those trades in chronological order to see what the equity curve over that time looked like; how would I go...
  Ordertype based on indicator  (22   1 2 3)
Hello, I need your help. I want that the ea open an order in the direction which the ea has give his signal but it doesent worked for any reason. Can someone help me?    The EA onTick void OnTick()  {if(check == false){   double Equity = AccountEquity();   Verlust = -Equity*RiskPercent*0.01;...
[Deleted]
Hi everybody !   As u can see in the title, i need some help to convert a PRT code into MQL4 (indicator). It would be amazing if someone could help me !   The question is : Does this code is correct ? And secondly, why i couldn't display MemTop1[] variable ? I tried a lot of thing.... Thank you very...
Hi All: I have two questions:  1. When I apply an EA to a chart to run in real time, is it possible to extract the historical test trading result on the first run please?  For example, I want to have a logic that detect the previous trading winning percent, if the winning rate is lower than 30%, I...
  Initial Deposit  (3)
Hi. Do you have any idea on how to get the initial deposit on the client terminal? Thanks.
Hello, I would like to know if someone can help me with ideas about my next problem: I am opening a pending order at 1:30:00, after 30 min at 2:00:00 it will turn to sell/buy. I have the next code to close the position after 10 hours, it will use OrderOpenPrice from sell/buy position not from my...
Dear community, A strategy is more than running the best of the EAs on one symbol. I was wondering where is the limit with MetaTrader in terms of number of charts where one can attach an EA? Let's say you have developed an expert doing a few dozens of operations (which is more or less what is needed...
Hi, as everybody I see the rectangle at the bottom line of the terminal. Now I find it sometimes on the right corner sometimes on the left corner. One broker shows a green triangle above a black one, the other broker a green one above a red one. If it is on the right side I can (all the time?) click...
[Deleted]
Hello, Ive got a little Problem with the mql4 array funktion. I want to open a chart with the ChartOpen() funktion in different timeframes . To make it easy, Iv set up an array with all the different timeframes. Then, Ive inserted it into the ChartOpen() funktion, like int the Article: ,,Mql4 for...
The converted time frame(in this case m4) is stuck on 'waiting for update' for any period you input for. 'Offline chart' is selected as well so this ins't the problem....
[Deleted]
anyone any ideas why a dll call to fnTest(double d, long l) causes stack damaged but e.g. fnTest(long l) or fnTest(double d) or fnTest(double d, int i) are ok
[Deleted]
  MACD greater than 0 bug  (12   1 2)
Dear people, I have been struggling with this problem the whole day yesterday. It seems such an easy task, but apparently it is not. I just want to look at 3 MACD values and when they all 3 are above zero, I want to plot blue dots on the 0 line. And when all 3 are below zero I want to plot red dots...
Hi, answering the question of  deysmacro  I saw this link (https://www.mql5.com/en/articles/1540) between his question and the first answer: File Operations via WinAPIEnvironment MQL4 is based on the conception of safe "sandbox": reading and saving...
Hi Everybody. I dont understandin why my script that ran perfectly now have erros. My metaeditor was updated to 5 but not to mql5, continue being mql4. But now I have an error here: string PipeName = "\\\\.\\pipe\\Perpendicular_as_Client";        int PipeMode =...
I continue to find that charts lose data over time. And I use the Charts/Refresh menu option to restore the missing bars, and it works. Q: Does RefreshRates() restore the missing bars like Charts/Refresh, or is there another MQL4 method that does?   Thanks!   
I have been testing this EA for a while now. But it's not Performing as Expected.   My requirement was that the EA should Open trade just Once after fulfilling a trading condition. Like if the 'Buy' condition is met, it'll Open Buy trades just Once. It wont open any more trade if the current trades...
Hi guys, Hope you all are doing great, I want to know whether there is a way to stop a custom indicator from working when the internet connection is offline or not ? thanking in advance; Parham 
HOW TO CLOSE all the remaining openorders of the same symbol when the first trade is closed? Here is the ordersend for the first trade with unique takeprofit and comment. OrderSend(Symbol(),0,b_lot,Ask,3,0,Ask+tp,"L"+1,magic,0,Blue); i thought for a long time but could not find a way. best way i...