Expert Advisors and Automated Trading - page 297

is the following code fail-proof for the mentioned purpose? datetime RightNow;int SESSION_TIME_LIMIT = 3; // in hoursOnInit(){datetime StartTime = TimeCurrent();EventSetTimer(15); // timer tick set to 15 secondsvoid OnTimer(){        RightNow = TimeCurrent();        if(SESSION_TIME_LIMIT !=...
Hi, I am not a Professional in coding and I created an EA based on ZigZag and When I tested the EA I received the error code 4806 and the tester became very slow (5min candle took 20 minutes and more) because of double high or low as you can see in the photos: And MetaEditor tell me there are no...
Hit at all, I'm studying a simple EA taken from the example: Simple Expert Advisor https://book.mql4.com/samples/expert. I wrote the code from scratch (for a better understanding), following the same procedure of the framework, the same trading systems, same trading criteria, values parameter etc....
Hi, I need a simple EA to open a buy/sell order once it reaches '5' pips on any side from open price and close the trade at the end of the candle and repeat the same in the next candle. Also the stop loss and take profit to be defined. IF there already an EA available for this. Pls share, need it...
I am hearing from a couple traders that small brokers frown upon the use of trading robots and treat orders placed by robots differently; i.e.that orders placed by a robot get worse execution than those placed manually. Does anyone know anything to this effect? Have you ever had such an experience
Buy odh sell, how is the code for this? I have $ 10000 and I'm willing to risk type 2% (= $ 500) of this on a single trade. I want to calculate how much (lot) I can trade when StopLoss is placed. Also taking into account the existing spread. Can apply to both bay and sell orders. Thank you for tips,...
Hi!  I have recently developed (i think) good EA, but I need someone to help me improving the code. There are some errors, and the EA doesn't execute all orders. Would someone do the test for me too because i think i dont have a complete history data for GBPUSD for which this EA was designed.  I'll...
[Deleted]
Guys maybe you can help me with this code that in MQL4  is working as expect but in MQL5 I receive some chinnese characters that I dont understand: void OnStart()  {//---      int handle=FileOpen("test.csv"...
OnInit I have ChartSetInteger ( 0 , CHART_EVENT_OBJECT_CREATE , true ); Creating an object on millisecond timer uint Span= 1000 ; uint Next= GetTickCount ()-Span; int counter; void OnTimer () { if (Next<=( GetTickCount ()+Span)) { counter++; string name= "TestObj_" +(
Hi, My EA is trading without errors during tests. When I enable automatic trading in production environment it does not do anything and it does not prompt any errors. The only thing this EA is different from another ones is that it checks 64 other stock prices during every tick... is this a problem?...
Hi, hope you don't find my question funny or pointless. I want to write an EA to consider all possible known signal-detecting patterns and techniques. have considered the following : Indicators : MACD (using its signal line) , Parabol SAR (when the dots going below/above the chart) , Moving Average...
Hello my EA worked fine until i've change the broker XM The positions wont close and gives me 2017.03.13 08:24:53.670 2017.03.01 00:42:32   Error closing position by EURUSD : 'Unsupported filling mode'  Total Positions (1) ‌The problem is that i have already filled the mode (i have already opened...
hey guys... during the Backtest, my EA suddenly breaks and stops opening trades(because there's no margin)  one specific parameter uses ATR and giving me the problem... the calculation for takeprofit and stoploss using the indicators are correct... what is making me crazy is that it goes through...
so obviously drawing lines is easy and setting new values to them is easy.. What im trying to do is make a line on the chart that mirrors the bid line and moves with it... As prices moves the line moves with it... But if i manually move the line to a certain level-- it will then stay there..  So its...
Hi All, Recently finished optimising an EA that performed really well on back testing.  Didn't report a single loss. On it's first day of running today however it has drastically failed and has been quite painful to watch. The spread was set correctly on back testing as there is a fixed spread on...
Hi, writing my first EA, which is also my first try in MQL language. Have been programming in other languages for a few years now. The question is : How I can calculate the time difference, since the last time my EA was used ? let's say , I don't want the EA to start , if it's less than 12 hours...
if i create a custom symbol similar to DXY, but which contains all of the symbols in the expert that i want to test then set the back-tester to test on that custom symbol (making sure the symbols actually tested are hard coded into the algo), will i end up with a compiled time-series of ticks for...
Dear all, When I try to run EA on many symbols by attaching it to one chart in live trading, it shows the error about reading indicators like this but it can work in Strategy Tester mode. My code is mainly in OnTick() Please give me a suggestion what is the cause of this problem and how to fixed it....
Hello everyone! I've two questions: 1) Removing comments from source code would increase the performance of the EA in terms of back-testing speeds? 2) Could some one share a good course (free or paid) to learn MQL5 programming? Thanks! Best Regards, Fernando.
I am just starting to build my first EA. I have written an easy indicator, which is working perfect when attaching to a chart in Meta Trader 5. Also when I debug the indicator all is very fine. As a result from my indicator I can see the arrows plotted to the chart. But when I try to start the...
...like a MQL5 indicator could? Or like WHS Nanotrader can? Not just the default (straight) line, but a curve, e.g. that of a parabolic SL. If yes: how? If no: what‘s next best solution? And will they also show in the strategy tester (backtesting) visualization? Thank you very much!
Hello you all,  I have a problem and i dont know how to solve it.  I want to make an expert that opens trades bij some kinde of signal that comes out a text, or a CSV file. If somebody hase some kind of expert that uses this kind of Technic or has experiance with it please help me out!.  
Hi, I would like some help do code the following EA. I have noticed that EJ often bounce or get rejected at the 100 round numbers (136,135 etc) So what I would like is an EA that place a Sell limit at the upper round number and a Buy limit at the low. The orders should be created when price touch...
[Deleted]
I'm new to programming mql4. can you change trade comment when ordersend is rejected (ERR_NOT_ENOUGH_MONEY)? I send this order int OrderSent(symbol,OP_BUYSTOP,1,price,3,stoploss,takeprofit,"recoverBuy",magic,0,clrBlue); if so, how do I change trade comment?
Dear MQL5 community, First of all I'd like to say I'm not the kind of guy to randomly post a question every time I stumble upon an issue. As a matter of fact this is my first post here ever even though I've been using MQL5 for years and coded multiple EAs of varying complexity, some of which running...
Hi! I need to convert a .mql5 file into .mqh so that I can use it in the EA. Is it necessarily to convert the files? Can I just copy and paste it into a robot? Can you also direct me to the documentation to learn the conversion. Your help will be much appreciated. THANKS.
Hello, I would like to know if its possible to edit .mq4 file by script. The point is to permanently change default settings of EA because its to much time consuming work to do that for each EAs when I do massive loading on demo account. I would like to somehow load source code of mq4 file by script...
  EA demo  (2)
how to set datetime limitation on tester and real?
I'm currently coding my first binary ea which is based on price simply crossing above the upper and lower line of the Bollinger Bands. The problem I'm having is I want the order to executed as soon as the candle starts. So for example for a sell trade the previous candle cross the upper line and as...
Hello, does anyone have an idea  i want to selct positions and therefore i also check the Position_open_time with followng code datetime position_time = PositionGetInteger(POSITION_TIME); when i compile i get following message possible loss of data due to type conversion and i dont understand why....