Using BadHoursOfDay to filter trades

 

Hello everyone,


I've generated a strategy using the EA Wizard, and also included the intraday time filter module. I've converted my bit mask for my preferred trading hours (101000000001111110001101=10493837), but the advisor completely ignored the value and still trades all hours. Even if the conversion to binary is not correct, if I have at least one "1" in there, I expect seeing that hour not being traded in the backtest, but that's not the case. What am I doing wrong?


Thanks for your time!

 

It may be many reasons.

May be you're not testing properly hour candles

 
Chris Sthojan: What am I doing wrong?
Do you really expect an answer? We can't see your broken code. There are no mind readers here and our crystal balls are cracked.
 
paul selvan:

It may be many reasons.

May be you're not testing properly hour candles

Is there a certain way to test hourly candles? I mean I have the data, and I'm selecting H1 to test it. I've generated another EA and that one works properly. I thought there might be something that I missed (perhaps a difference between the two, but I haven't found it) or common pitfalls that people fall into. In the backtest tab the Entries by hours is still full across the table, and I've confirmed this behavior in the visualization as well.

 
whroeder1:
Do you really expect an answer? We can't see your broken code. There are no mind readers here and our crystal balls are cracked.

I've seen your posts in multiple threads when looking up information in the past and you have valuable information that you're willing to share with the community, but why are you so aggressive? Have you even read my post?

I specifically stated that the EA is generated, there is no code that I've written myself that I can post. All the logic is contained in ExtExpert.OnTick()/OnTrade()/OnTimer(). I haven't modified the internal generated workings, or otherwise I would've posted it here and asked for directions. I thought that maybe I'm using that filter improperly, that there might be a bug I don't know about, or the information I found on a forum post dating back to 2014 might be inaccurate. Thank you for your help.

 

It is very simple.

Without code we can not help you.

This would be a guessing game where the odds of hitting on the correct error would be stacked against you.

Furthermore the usage of EA generators/builders is discouraged. 

 
Marco vd Heijden:

It is very simple.

Without code we can not help you.

This would be a guessing game where the odds of hitting on the correct error would be stacked against you.

Furthermore the usage of EA generators/builders is discouraged. 

Hello, could you please elaborate on why that is discouraged? I've used MQL5's built in generator and the only problem I've had so far is this one glitch that doesn't even happen on another generated EA.

It seems to me like it has real potential, especially during the incipient phases of an EA. I can understand code, I can understand the technical indicators that I add to it, I can understand the rules that are implemented after reading the mql5 documentation. I'm pretty sure I can modify the code to add/remove trading signals if I deem the strategy worth the time. If the code is already there, should I really spend time reinventing the wheel?

 

Ah ok i thought you was referring to some EA builder which are usually useless.

Good to see you used the wizard, but the problem remains, without code we can not help you.

No need to re-invent the wheel so check Codebase first to see if it's already exists.
 
Chris Sthojan: could you please elaborate on why that is discouraged? I've used MQL5's built in generator
EA builder, EATree, fxDreema, FxPro, Molanis, Online Forex Expert AdvisorGenerator, 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.
  • 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 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.

  • EA builder makes bad code counting up while closing multiple orders.
    EA builder makes bad code Bars is unreliable (max bars on chart) volume is unreliable (miss ticks) Always use time. New candle - MQL4 forum
    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.
    EATree uses objects on chart to save values - not persistent storage (files or GV+Flush.) No recovery (crash/power failure.)
Learn to code it or or pay (Freelance) someone to code it.
 
whroeder1:

I thought this was a "Expert Advisors and Automated Trading" category in the forum, relating to all expert advisor issues, not only code. If I'm mistaken, could a moderator please move it to the appropriate category?

Thank you for taking the time to copy-paste this reply, but it seems to me like you're not reading what I write. In any case, this forum's a dead end for my issue and I have better things to do with my time than arguing. I'm grateful for the YouTube link though, interesting channel.

 

Without code, we can not help you.

I am reading what you write, there isn't any code, so i am not able to point you to an error in the code.

You can write a million more words, but without code we can not help you.

We have better things to do with our time then trying to figure out why your EA isn't working.

If you really want help, post the relevant code.

Reason: