I have my EA ready, but doesn't work properly, could you help me understanding why?

 
Hi

I have this EA working, I didn't code it myself, I used an EA builder tool, It should work fine but it doesn't, maybe someone could tell me if there is another way to code it to work better (just want to know if it's possible so I can look into it)

The EA purpose is to help me execute my stategy, which is is following: 

As soon as the 13:31 bar opens (exactly 1 min after index session begins) open a long if market goes x ticks up, or a short if market goes (same) x ticks down. Is that simple.

The problem is, when the 13:31 bar opens, there are a few seconds (almost half minute) that the EA behaves like we are in the previous bar... So lets say if the 13.30 bar closed the necessary x ticks above the 13.29 close, then as soon as 13.31 open, and for like 20 seconds, it will open a long even if the price didn't move at all... 

So I don't know if it's a server time issue or what... But is there a way to specify that it only open a trade on that specific bar? I tried specifying the "trading session" (startopening at 13:31), it works perfect but has the same delay problem I stated before...

I would be very grateful if someone could point me in the right direction!

I attach the mq5 in case someone want to look at it 

Files:
13_31_EA.mq5  98 kb
 
Austin Baier :

It's not interesting to dig into this heap of code.

My advice: start writing an advisor yourself or find it in CodeBase or order in the Freelance service.

 
Vladimir Karputov:

It's not interesting to dig into this heap of code.

My advice: start writing an advisor yourself or find it in CodeBase or order in the Freelance service.

Yes sorry, I figured that it's a long code, don't know why because is really simple what it does...


Anyway, I don't think the problem is in the code... I hoped someone would know where the problem is likely to be, or even better how to avoid it. It seems like a server time thing... But I couldn't find anything about it and broker can't help either...


 
Austin Baier: I have this EA working, I didn't code it myself, I used an EA builder tool, It should work fine but it doesn't, 
  1. Using a tool means nothing about working fine.

    EA builder, EA Builder Pro, EATree, Etasoft forex generator, Forex Strategy Builder, FOREXEADVISOR STRATEGY BUILDER, FX EA Builder, fxDreema, FxPro, Molanis, Online Forex Expert Advisor Generator, Strategy Builder FX, Strategy Quant, Visual Trader Studio, MQL5 Wizard, etc., are all the same. You will get something quick, but then you will spend a much longer time trying to get it right, than if you learned the language up front, and then just wrote it.

    1. Since you haven't learned MQL4/5, therefor there is no common language for us to communicate.
      If we tell you what you need, you can't code it.
      If we give you the code, you don't know how to integrate it into yours.
      We are willing to HELP you when you post your attempt (using SRC) and state the nature of your problem, but we are not going to debug your hundreds of lines of code. You are essentially going to be on your own.

    2. EA builder makes bad code counting up while closing multiple orders.
      EA builder makes bad code Bars is unreliable (Max bars in chart), volume is unreliable (miss ticks.) Always use time.
      EA builder makes bad code, not adjusting for 4/5 digit brokers, TP/SL and slippage.
      EA builder makes bad code, not adjusting for ECN brokers. pre-Build 500)
      EA builder makes bad code, not checking return codes.

    3. EATree uses objects on chart to save values — not persistent storage (files or GV+Flush.) No recovery (crash/power failure.)

    4. FX EA Builder makes bad code, not checking return codes.
      FX EA Builder makes bad code, loosing open tickets on terminal restart. No recovery (crash/power failure.)
      FX EA Builder makes bad code, not adjusting stops for the spread.
      FX EA Builder makes bad code, using OrdersTotal directly.

    5. FOREXEADVISOR STRATEGY BUILDER makes bad code, non-updateing global variables.
      FOREXEADVISOR STRATEGY BUILDER makes bad code, compilation errors.
      FOREXEADVISOR STRATEGY BUILDER makes bad code, not checking return codes.

    Learn to code it, or pay someone (Freelance) someone to code it.
              Hiring to write script - General - MQL5 programming forum #1 2019.08.21

  2. Use the debugger or print out your variables, including _LastError and prices and find out why. Do you really expect us to debug your code for you?

  3. input double OpenBuy_Const_0 = 1;
    ⋮
          if ((Ask_LibFunc() > (iClose(Symbol(),PERIOD_M1,1) + OpenBuy_Const_0)
    
    This hard coded constant breaks most symbols. AUDCAD is 0.953ºº, so it represents 100,000 PIPs.

  4. Austin Baier: The problem is, when the 13:31 bar opens, there are a few seconds (almost half minute) that the EA behaves like we are in the previous bar...
    13:31 tells us nothing, we have no idea what time zone your broker uses.
  5. Your code only executes between [13:31:ºº and 13:32:ºº) What if there are no ticks during a specific candle period? There can be minutes between ticks during the Asian session, think M1 chart.
 
William Roeder:
  1. Using a tool means nothing about working fine.

    EA builder, EA Builder Pro, EATree, Etasoft forex generator, Forex Strategy Builder, FOREXEADVISOR STRATEGY BUILDER, FX EA Builder, fxDreema, FxPro, Molanis, Online Forex Expert Advisor Generator, Strategy Builder FX, Strategy Quant, Visual Trader Studio, MQL5 Wizard, etc., are all the same. You will get something quick, but then you will spend a much longer time trying to get it right, than if you learned the language up front, and then just wrote i

THANK YOU, you already solve my problem, now I know my best option is to hire somebody, thanks for your counselling, I hope you're getting paid for this! (although you seem to enjoy it very much anyway!)





Reason: