Expert Advisors and Automated Trading - page 33

To post a new topic, please log in or register
Useful snippets go here. 
Hi ! I'm wondering how to do that ...:/ the warning appeared @ the last update //--- preparing a request MqlTradeRequest request; ZeroMemory(request); //--- placing an immediate order request...
Hi all I am using TimeGMT() method in EA...  with I attached to live market (not in stratigee tester) in shows time one our back from current GMT time. please help me...
Hi all,  Is it possible to do this? I'm opening a position with a order like this. 10 lots with stop loss and no take profit. CTrade t_buy;t_buy.OrderOpen(_Symbol, ORDER_TYPE_BUY_LIMIT, 10, 0, p, sl, 0, ORDER_TIME_DAY); Now when the order gets in (creates a position) I want to have 5 partial take...
I am newbie in EA system and it's the first time I am trying to write one of them, So a question came up to me: Should we write sell request for our EA, if we have specified take profit in our buy request? I mean the EA won't sell our stock when the market price reached to our bought price+ take...
Moin Moin, I wrote an EA which goes in for a position always Fridays  if some conditions are given. With the conditions everything is good, but with the 'time term' I have some trouble. the code is as follows:   //Wochentag/Stunde/Minute der Woche/Stunde bestimmen     MqlDateTime lokalzeit;...
Hi there, I encounter this dilemma on doing a "more than" comparison. FYI I'm having a 5 digit broker. I would assume 1.14644 > 1.14644 would fail, as there are the same values. However, the result shows TRUE instead. Can anyone clarify that ">" is actually more than?
Good day traders, when i place orders i also place the takeprofit and the stoploss, I can also  determine if the transaction has been closed by: if (myPositions.Select (_Symbol) == false) But I do not know how to determine if the price has touched my takeprofit or stoploss, since I ask  the question...
hi! I have a script,and I want to run and test it, but I don't know how to do.
  Learning MQL (10)
Hi guys.. I'm a C & PHP languages programmer and I would like to learn MQL Does anyone know how and where to start? Is there a difference between MQL4 and MQL5?. If yes, then which is better to learn?
Happy and successfull new year, fellow Traders! Did anyone yet have the problem of the Strategy Tester giving you zero trades / zero results in the overall optimization window? When I start the optimization (as seen in the screenshot below) it does some optimization step and instantly finished with...
Hello everyone, I read about different pending orders in MT5 but unfortunately I couldn't find what I need. What I need is putting buy orders exactly when the market price reached to a specified point. For example, consider market price of stock_a is $100 at the moment. I guess it will goes down up...
I want to create a text box square 1. All messages are in the box square. 2. I can move the text box square with the mouse I want an example or a way to create it. I try to use Obj_label or OBJ_Text but they can show only Once Line and long text. Thank you.
Hi, I have recently purchased subscription for $190 on 04/01/2019. There were 7 trades since the subscription started with growth of -0.57%. I messaged the gentleman if he was placing trades which are not copied on my account. He has confirmed that he's been trading successfully and advised me to...
Hi! Can I speak with a programmer? I need an alert indicator.
Hello everyone, Recently I work and backtest 204060 EA that is in top of famous and profitable experts in Mql5.com, I starting to get backtest of it but in some markets situations the account has been called,  What's best setting of this EA?  Below link related 204060 EA: https://www.mql5...
Hey guys, Is there a simple code that I can test on my MT5 application to see if my broker allows automatic trading or not? (I am not in Forex market and just like to see does automatic trading work in our market(Iran market) or not? I know my broker allows conditional orders on MT5) ***I also seek...
Hello, iam trying to load historical data this way: iClose(Symbol(), PERIOD_M1, iBarShift(Symbol(), PERIOD_M1,-more than 2 years ago- )); Normally its no Problem to get any data. But if iam loading data about 2 years before from testing start, it returns 0.0.  If i start the backtesting earlier it...
I want to write an EA that reads a text file with contents like bellow and do automatic trading upon it.  Name: stock_a Range: 122 - 124 cost: 1000  Type: buy (IT means today buy the stock_a in prices between 122-124 with total volume of 1000 dollar for example). And the text file will be update...
Hi all,  I have questions on MT4's 'Open prices' testing mode. I understand that the open of the current bar gives the signal that the previous bar has closed. Trading decisions are then made based on the CLOSE price of the bar that was just completed, or the OPEN price of the bar that just opened?...
I want to set the Magic Number in my robots in Metatrader 5 (MQL5). In MQL4 was easy, on OrderSend() I just put the Magic number in order to identify what orders are from each expert advisors (I want to use several different robots, and each robot can only close the positions the same robot open,...
According to this link, https://www.mql5.com/en/docs/files/fileopen, if I use FileOpen my file should be created under my MQL5\files\ directory, but I do not have a files directory. Under \MQL5 I have \experts, \images, \include, \indicators, \scripts. I am not getting an error from an invalid...
I have been using it fine for the past month and suddently it stopps working suddenly. Please help and see the attached screenshot for the journal for the VPS and my MT4 journal.
Hi there, I started with a complex strategy and it would not trade in any tests. So I made simpler ones, right down to a simple average trader.  1 indicator, 1 symbol. (XRPBTC) I didn't play with any settings on these later attempts, just ran the generate, added the most basic things I could, and I...
When first downloading data for EUR/USD and GBP/USD for backtesting the download appeared to start at 49%. It then produced these errors in the log and did not complete the backtest: 2018.12.23 10:33:34.195    Core 1    EURUSD 2018.02.27 03:23:00: corrupted history detected (s:-2100596776, o:121546,...
Hi, I am new to programming in MQL and have had a good look on the site to try and answer this question but to no avail.  I only want to enter one trade per candle but if, on the next candle, the signal still holds the EA should make another trade up to a maximum number of lots.  I think I...
Hi, im using standard Mq5 library CPositionInfo I would like to ask what is the difference between CPositionInfo.identifier() and CPositionInfo.Ticket(); I have found that some ppl are using Ticket(), but I didnt found it in code. But it is working. For me it looks those values are same. Thank you.
Can I declare variables in a loop, each with a different name? for(int i=0; i<OrdersTotal(); i++)  {   if(OrderSelect(i, SELECT_BY_POS))     {      double var + OrderTicket() = OrderOpenPrice()     }  } So I would end up with a variable for each order ie. varXXXXXXXX = 1.2548 varYYYYYYYY = 0.8849...
Hello, My broker doesn't allow automatic trading, but I can send buy/sell commands(also conditional commands) manually. So I like to know, if I write an external program, how can I send buy/sell commands from my external program to my MT5? 
I'm trying to convert this code from mql4 to Mql5 but id does return the desired result; MT4 code-  if(!OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) continueMT5 code Im using:      if((ticket=OrderGetTicket(i))!=0)    continue; What is the mistake?