Expert Advisors and Automated Trading - page 370

int LotDigits; //initialized in OnInit int MagicNumber = 937422; double TradeSize = 0.1; int MaxSlippage = 3; //adjusted in OnInit int MaxSlippage_; bool crossed[2]; //initialized to true, used in function Cross int MaxOpenTrades = 1000; int MaxLongTrades = 1000; int MaxShortTrades = 1000; int...
Hi there, I recently installed a new MT5 software and I am getting the following error messages:  Toolbox/Experts - loading Moving Average failed Strategy Tester/Journal - Moving Average.ex5 failed I have tried to re-install MT5 trading platform several times but no avail. 
  Speed up my code  (1)
I have an imaginary code -  First question : I have to get just "bid" and "ask" value for each tick, it's faster with the "MqlTick" structure, or "SymbolInfoDouble" ?  Second question : I have (for example) 3 indicator : a moving average "MA" - an average true range "ATR" - an average directional...
Hello every one I have a question about back test in MT4 Back test using MT4 test only one time frame as example we can test EA on M5 or H1 frame but when my EA use for example moving AV for M5 and moving AV for H1 test fail IS there any way to test EA witch use multi time frame in calculation, is
The data from the broker has some big errors in the data.  I want to edit this data myself and correct it.  In MT5, is there a way to do this?  Thanks. 
Hi, I have coded a very simple EA to trade on gold. I'm use to code some EA for EURUSD but while back-testing this new one on Gold I have been really surprise by the result. Usually when coding EA, I focus on reward:risk ratio. This one gives a reward:risk of 10:1 which is... too good to be true :)...
Hello everyone, Friends, my ea gives a warning. I wonder why? Can someone please help me? Thanks in advance.
Hi coders, This code is to get the TP, SL and Gain/Risk ratio from opened Positions. It works in Hedge but not in Netting accounts. Can anybody help me? Thank you in advance! int pos_total = PositionsTotal(); if (pos_total > 0) {  for(int pos = pos_total - 1; pos >= 0; pos--) {  ulong PosTicket =...
I have an EA that have 3 Moving Average , called MA_1, MA_2, MA_3. My question is: I have to optimize juts the period of the 3 MA, such that MA_1 goes from 3 to 100, MA_2 goes form 4 to 100, MA_3 goes form 3 to 100, but I need to avoid the calculation of all the result that have MA_1>MA_2 &&
I don't understand where is the error because i get an invalid stake . //+------------------------------------------------------------------+//|Funzione Investimento                                             |//+------------------------------------------------------------------+...
Hey all, I'm new to MT and to this forum, so any and all help is appreciated. I would like to do something simple and straightforward - calculate various retracements from the current daily hi/lo as price continues to update throughout the day. So for example, if at 10am central the current range in...
Hey all, I have been searching for a long time for an EA that moves SL to break even at a set target price while also closing 1/2 of my position at that price (so it does 2 things at once).  Does anyone know of an EA? And it must work for MT5 because that's the software I use.  Thanks in advance
I had an idea - to show how at the last three bars the direction changed. And at the same time for all 21 timeframes. That is to show on the screen what bar - bull or bear.
I‘mtrying to close a position but I get always the ERROR: invalid fill. Thecode is basically as follows: ...CpositionInfo PInfo;CTrade Trade;...for(uint i=0; i<PositionsTotal(); i++) { if(PInfo.SelectByIndex(i)) { if(...) { Trade.PositionClose(PInfo.Ticket()); } } } Whichproduces the...
Hi, I'm new to this market and program so I started a couple of demo accounts each with its own signal subscription. I always have the metatrader4 program opened on my computer as well as on my phone and I've noticed I've missed many trades that my signals have performed. I'm not sure if I can only...
Hi all Is there a way for the active EAs to communicate with eachother or for some hierarchy in the order they run . For example 5 EAs running on the same MT4, where in order for eachone to run,it has to wait for the previous one to complete itsoperations. What I think is to have the EAs create a...
Hey there, I recently found some pretty good Youtube Tutorial about EA programming. It's absolutely free and in english. I wondered if there is a sticky thread with a link to that playlist on this board here. If so, then it is not very easy to find... Youtube search "Mql4 Lesson", you will not be...
i scrolled to many pages but the moor i read them the less i understand. Basicli it is simple math Balance in USD Distance 500 Points myBalance is 10000 USD myRisk 2% myRiskMoney 200 USD myLot is then 200USD / 500 Points Job done! (Help me if the code is wrong so far:) double myBalance
Hello everyone, I ve been using WebRequest code provided by mt4 support and it was running perfectly, until today... Server returns 200 which means authorization is ok, but even if i put wrong log/pass it is still 200. And cookie does not creates an auth= field, therefore authorization fails. So...
The math is simple: 155/32 = 4.84375 Not here: void OnTick()  { double tmp = 155/32; Print(tmp); MessageBox(DoubleToString(tmp,3));} I do not have any clue wath went wrong here!
"You can use the explicit casting to convert the base class pointers to the pointers of a derived class. But you must be fully confident in the admissibility of such a transformation, because otherwise a critical runtime error will occur and the mql5 program will be stopped." Is there any way to...
Please tell me meaning of column "ID" in MT5. I searched about it on the internet, docs guide. But i can't see any of my search results. Thank you very much!!!
Hello, I am trying to validate my EA for market, but each time I became an error, but in my system in on other systems it works fine. I think it is a problem of the test system if mql or have someone an idea what I'm doing wrong? I used an article for resource binding in mql: https://www.mql5...
Dear  I use the " icustom " function to invoke custom indicators and to use them in ea. What buffers should I bring when I put them in " *************** "? example) double arrup=iCustom(NULL,0,"custom indi",0,0);double arrup=iCustom(NULL,0,"custom indi",1,0);double arrup=iCustom(NULL,0,"custom indi"...
Dear I have a MQL4 EA, now i am plan to convert MQL5. i did all coding. just i can't convert only below MQL4 coding for ( int i = 0 ; i < OrdersHistoryTotal (); i++) { if ( OrderSelect (i, SELECT_BY_POS , MODE_HISTORY )) { if ( OrderSymbol () == Symbol () && ( OrderType () ==
  Signal volumes  (4)
I follow a signal but the volumes of the positions that coming to me it is diferrent from those the signal appears to his history trasaction. Why is this happens
Hello everyone! For past 2 years I've been now working on a project an automated currency trader what (should) over perform a human. My project is almost finish, whats left is to code and I need help with it. Soon my internet access and over all computer access will be fairly limited and I'm kind of...
Hi Can someone explayn to my where this comes from: input double SL = 1.23400;uint mySL = 0;void OnTick(){mySL  = uint(NormalizeDouble(SL,5)/_Point);Comment( IntegerToString(mySL));  } This code with a 1.23400 prints a value 123399 >> so i miss 1 point - i can not finger out why. Wath i am  missing...
(Please help me) Change display buy/sell arrow default in the MT5 Strategy Tester. (When Close position in the MT5 Strategy Tester) Purpose: - Distinguish the difference between BUY arrow of open position and BUY arrow of close position. - Distinguish the difference between SELL arrow of open...
  error in testing  (3)
dear all ...what means this error? 2017.04.08 21:42:25.620 TestGenerator: 917 generating errors, logged 100 first error records many thanks