Expert Advisors and Automated Trading - page 393

please can someone help me with handy code to close all buy or sell when takeprofit is reached or hit please help me i didnt know all code loops please.thanks bellow is what i even i try to count down order but yet after that the countdown loop will not work with mt4 strategy test it hangs it so...
Hi Fellow Traders and Coders. I really wish that Meta Trader 4 Strategy Tester is like Meta Trader 5 Strategy tester because Meta Trader 5 terminal strategy tester is a lot faster. T T Really the slow speed of MT4 terminal strategy tester sometimes bottlenecking development work. I am sure it is...
Hello Masters in the house, Please I need your help seriously, I coded an EA and it works fine on demo accounts but it is not working effectively with real account, sometime it will open just one or two orders out of about 10 symbols on different charts. Sometimes it won't open any position at all,...
Hi Fellow Traders and coders. I have some interesting problem giving me some hard time to resolve several days. Recently I played with OBJ_LABEL on both MT5 and MT4. The code is shown below. The aim of this code is to write some text on indicator sub window (separate window from main window)....
Hi: Sorry for this - but I remember a few years ago there was a discussion around this (I hope I remember correctly). If certain criteria are met - the EA activates a function of some sorts in order to close the workstation. If one or more of you remember this discussion - would it be possible to...
How can I test an Expert Advisor in automatic trading mode using a ticks.csv file I have previously downloaded? Thanks Joe S.
I want to make an EA to execute automatic trades based on my custom indicator. How would I add this to an EA? Thanks Yes... I'm new to EA programming
  datetime sums  (1)
I'm hoping someone can confirm this for me, since I'm having a difficult time with an EA adjusting for timezones. if I have a datetime value, and I want to add for example, 3 hours to that time, could I use this? datetime RightNow=TimeCurrent();int Adjust=3; //3 hours adjustdatetime...
Hello, I'm looking for information if MT4 support MQL5, because I'm not sure for that. Thanks for reply.
[Deleted]
Good Afternoon ! Any one have a clue on this ? If I have an EA with 2 iMA (for example) and each one has its own ENUM_TIMEFRAMES/ period. If I want my EA to run both separated timeframes and unique timeframe using a key to compare my concern is when using single timeframe mode, Strategy tester...
[Deleted]
Hello community, this is my first topic.  I am trying to build my own DLL for Metatrader 5 using C++ and Microsoft Visual Studio Community 2013. I just coded this simple function here:   #include <string> using namespace std; #define _DLLAPI extern "C" __declspec(dllexport) _DLLAPI string __stdcall...
good evening, Im trying to add a costum optimazation paramater to the EA strategy tester and i have two questions about it, What i'm trying to do is to seperate my data from a single optimazation run, lets say from december 2014 till februari 2015 into data from single months. I'm trying to create...
Looking for an EA who is buying / selling based on earnings announcement of a stock immediately in the first second after release. Decision if buy or sell order is made depends on the fact if analysts expectations are beaten or not. The hardest thing is reaction time, I assume need some pretty...
Hi, i am Peter, i started yesterday my first DEMO-Trading on the MetaTrader 4 Platform of QTrade, but after a trial of 1 month i want to change in a Live-account. I am excited about the possiblities, and hope to find some advice on this platform. I am thankful for any advice, because i am a...
Hello. I would like to know if the code of a script is the same or at least similar with an EA's code. If for example i order a script, and then i want to attach it to an EA, can it be done, or it will need to be written all over so that it can be inserted in the EA? Thank you.
Hello, I have only been learning to code with MQL4 for a couple of months and I am looking to write an EA which opens a trade when MA cross and closes the trade when they cross again. I need a helping hand as the EA won't seem to close the trade. Thank you. Here is my code: extern double...
I am a new person to EA and have been playing around with back testing an EA i found. I have got it to the position now where i want to REVERSE the buy and sell instructions in the EA - so where currently it is set up to buy then i want to change that to sell short and where it is set up to sell...
  Error 132  (4)
Hello everyone, I'm new in the community and I am writing because I have a problem with the opening time. For example with the DJI, the first bar daily after the close of the market opens at 00:00, but my broker opens 01: 00. The problem is that I use an EA that opens only at the beginning of...
hi i dont understand how to find the high and the low of the last 2 minute candle i use this code: void OnTimer() &nbsp;&nbsp; {&nbsp;&nbsp; datetime thisTime = TimeLocal(); MqlDateTime tm; TimeToStruct(thisTime,tm);&nbsp;&nbsp; currentHour = tm.hour;&nbsp;&nbsp; currentMinutes = tm...
Hi guys, I'm new to MT5. I'm trying to demo a few paid expert advisor strategies in the Strategy Tester but when I hit start, I get no data in. I'm using the MT5 demo account so I'm not sure if that has something to do with it but essentially I can't test any of the EAs. I attached a screenshot...
My EA work at day time. It opens orders at the begining of the day. In jounal field: "2014.08.29 04:02:57.736 '8043706': instant order buy 0.01 EURUSD at 1.3183 2014.08.29 04:02:58.161 '8043706': order buy 0.01 EURUSD opening at 1.3183 failed [Market is closed]" It means market closed so...
Hi everyone   I have a simple question.  Why the EA from M5 work so well with poor tick like 25% data and work so bad with the same config with 99.90% tick quality? I can find in google many imgs of backtest very powerfull, but all have 25% of quality, so not close to real situation. The EAs normaly...
Hello, while testing my EA in the strategy tester, there are no Alert() (OK, they are found in the journal) or MessageBox() pop-ups. Also PlaySound() is ignored. In the MT4 "strategy tester" all these features were included. How is this with the MT5 strategy tester. Is there a way to pop up a...
Hello, I managed to make an EA to alert me when stochastic crossovers are being taken at oversold and overbought states. I made it by the following rules if the moving line is higher than the signal line and is below the 20 line its going to alert me through push notification. same concept for...
Hi, thanks for reading. I have this trailing stop, my problem is "PositionGetDouble(POSITION_SL)" is not working or only it work when "PositionModify" works? Here i am debugging and "pos_sl" is 0.0, why?...
  The danger of small numbers  (11   1 2)
Have some code that checks MA crossovers. I discovered that I only got one type (I think it was positive cross overs) but not the other one Changed the code and it works ok /* last = ShrtMA[1] - LongMA[1]; // No good. Yes, "last" is a double if(last>0) result = 1; if(last<0)
[Deleted]
Good Afternoon, Does any one know if there is an way to prevent .set file being read ? If I have 2 different EAs and .set files, nowadays, MT5 allows me to load the files and gives mo no warning if I switch them. Any idea ? Regards, Marcelo
I have a doubt with my EA . During the simulation the Lot % / profit do not change . For examble i have $ 1000 and i use 0.2Lots know $ 200 for 1max trade the profit is $ 50 every TP15Pips ( for example ) So: D1000,0.2minlot , 0.2maxlot , TP 15P = 50 D2000,0.2minlot , 0.2maxlot , TP 15P =...
hi there all, i recently started using this code here https://www.mql5.com/en/articles/344 to route orders out of MT5 using a socket bridge, and i wanted to route ORDERS, not DEALS, so there is no need to wait for the Orders to become Deals after execution (dont want to get slipped by the delay)...
Hello, Does anyone know a possible solution to use a OnTimer() alike system which works on the backtester. Right now the code doesn't get executed in OnTimer() as it is not functional in the strategy tester(Backtest). For my strategy it's an important part and i really need it for optimizing...