Expert Advisors and Automated Trading - page 459

The title says it all, how can I find out whether my last order was stopped (reached the stop loss) with MQL5? Is there an event, is there a way to find out within the onTick method? Thanks in advance.
Hello, I have written an EA which uses a few technical indicators to give signals. I want to print certain important figures, such as account balance at certain points or the number which represents the conviction of the indicators at a time when a trade is put on The problem I encounter is...
Hey, I have four one dimensional arrays, would like to write them to a csv file, one column per array. I'm not sure how to do this, I cannot find a function to create a new file with.   Any idea how to do this? 
Hey everyone, I was wondering if the following is possible: I would like to retrieve all trade data at the end of the test in my EA code, do some statistical calculations with the trade data, and export to a text or excel file. For instance I would like to retrieve each executed trade's...
As frustrated as I have been teaching myself enough C++ to migrate my EA from MT4 to MT5, I really like the new platform...especially the Strategy Tester.  Remote agents ROCK! But I have not been able to get the Automatic Optimization working.  Can anyone tell me if this works in MT5...
Hello again. Actually I'm searching for a solution for weeks. I've been posting this problem in another way before. Now it's urgent ;-) I try to build an EA with the following function: 1. One basis variable called "trend" 2. If the next tick is higher than the last, the variable "trend" increases...
Can someone give me a starting help on how to use two custom indicators and create a EA based on their cross over. How would I reference their current value on the current tick? Any articles or post already on this? -Thanks in advance
...From the MQLTick Structure...example: SymbolInfoTick() ...From the CSymbol Trade Class...example: CSymbolInfo() ...From the Environment State Function...example: SymbolInfoInteger() Would someone please explain the advantages and disadvantages of using each technique? Is there a preferred...
Hi guys, Is it possiable to know when is the market weekly opening and closing time by MQL5 code?
Hello everyone, I just started coding MQL some weeks ago and there's a lot of work to be done to get an fine EA. Until now, there're a lot of questions I need some help on. Perhaps I can get some skill of yours ;-) 1. I'm trying to create a simple label, displayed in the chart window. I tried to use...
Hello, Im wondering if the mt5 terminal has a better trading context behavour; in mt4 sometimes takes too long to close multiple trades at the same time, I have little experience with mt5, so I was wondering if this issue has been improved over mt4. Regards
Hi Guys, Why did not assign value to these parameters (double price,sl,tp) in the functions CheckOpenLong() and CheckOpenShort? //+------------------------------------------------------------------+ //| Expert.mqh | //|...
Hi, I'm looking to write a function that returns the number of periods (in terms of the _Period) between two datetimes. Right now I can't figure out how to interpret the result of _Period or GetPeriod because I've only used it to pass in to other functions. Would be awesome if someone could advise...
Hi, How can i open a new sub windows from expert advisor I found the command to open new chart but not sub windows. BR chatnis.
In MT5 when you start the terminal with the configuration file command line: terminal.exe /config:FileName.ini a script or an expert advisor loads which is specified in the section of INI file such as: [StartUp] Script=ScriptName Expert=ExpertName Symbol =EURUSD Period =M15 In this case, if the
Hi, I am looking for a reliable way to know why OnTrade() is called: 1. How do I know (for particular call of OnTrade()) what list is changed (orders, deals, etc)? 2. How do I know which entry was added, removed or updated? Is it possible to add an additional API that can be called from
While installing mt5setup.exe; the setup could NOT download the files, the error is: FAILED TO CONNECT TO UPLOAD SERVER: Pls, what can I do further??
Hi, While looking through the code generated by the EA Wizard, I came across several variable declarations in this style: CSignalCrossMA *signal=new CSignalCrossMA; .... CMoneyFixedMargin *money=new CMoneyFixedMargin; ... I'm a Java (and a bit of Ruby) developer by profession so I roughly know my
Is there a way that we can check the 1minute data integrity of the EURUSD & GBPUSD? If the provided data is corrupted, then we will get false results from our backtesting.
  Backtesting MT5  (1)
I miss some thinks: 1. backtest in visual mode 2. overwiev from the orders history 3. a equity grahp during backtest are this thinks not avaible in mt5 or come they later?
  MetaTrader 5 and MetaTrader 4  (65   1 2 3 4 5 6 7)
My EA in MT5 is making a profit When I transfer it to MT4 it's at a loss What is the problem? 1. Incorrect code in mt4 2. Incorrect mt5 code 3. other Programmer says mt5 is translated into mt4 completely and without errors
Hi I'm wanting to make a MACD histogram indicator where the bars are either thick or thin depending. I've found how to do multiple colors but not multiple widths. Help
Hi, I wrote a custom indicator to use in an EA, but the stupid thing won't load and I can't figure out why. I've attached its code if you want to help :D Oh, it seems it only happens in the strategy tester, I get the error "Expert removed because indicator 43 cannot load [4802]" #property...
I'm almost embarrassed asking this seemingly trivial question, as I am an experienced programmer, however the answer has evaded me for over a week now. I am trying to get to the bottom of an EA of mine, and I was wanting to plot some graphics objects on the chart where I'm running the EA. I'm...
Hello everybody, first of all sorry for my poor English. My name is Lucas and I'm a programmer and I want start to make some EAs. Searching in google I found that metatrader and mql are the current leaders in automated trading market but with the recent launch of metatrader 5/mql5 and the well
Hi, simple question, I'm wondering if its possible to have a test automatically reset the principle each year, or just to queue up multiple testing runs. I'm trying to do a take-one test set to finish optimizing a model without picking a 'lucky' value set with some ridiculous SL and TP. Anyone know...
I run my expert and indicators in GBPUSD , some time all chart in MT cannot show correctly, please review the picture, what is the error ? how to slove it? thanks in advance. hongbin.fei
I just sell GBPUSD , try test the code for modify stoploss, bool Robot::ModifyPosition() { bool res=false; if (m_position.Select( Symbol ())) { if (m_position.Type()== POSITION_TYPE_BUY ) { //the robot run this code for a sell order what is the wrong
Hi all !! next code is just a sample to check deal history. Backtesting an Ea including this code should Print "magic ok", but journal shows both "magic ok" and "magic". Hmm... so whats wrong ?  void DealMagicTest()   {   uint total=0;   long ticket;   long magic;   HistorySelect(0,TimeCurrent());...