Example:


I discovered this bug when I found there was no year block in time filters.
Using the conditions block I attempted to compare chart time with a specific month and year in time/timemode/components. The idea was to select a specific month in a specific year to trade from within the expert.
What I discovered is that not all the operands behave as expected. This can be demonstrated by using the components time condition to select one month in one year. The same month and year is then also selected in strategy test setup. These were the results of one test for the various possibilities (time mode/server time on one side of operand, time mode/components selecting the date on the other). Note, these should all generate the same number of trades because time is restricted to match in strategy tester.
no condition set, 34 trades
'==' operand, 8 trades
'>=' operand, 8 trades
'<=' operand, 34 trades
There are filters for months, days etc, but no year. If you add a year block, it will be possible to specify backtesting at any point in time from within an expert. Without this option, all non sequential calendar backtesting needs to done by hand in MT5 which is a huge of waste of time and recombining the data to do analysis is almost impossible.
I have not been able to get any of these objects to appear on a backtesting chart nor has anyone else in the forum shown me any success in being able to do this. This also includes not being able to change the colors of the arrows in the buy/sell and close position blocks.
Obviously these are major problems.
As you've pointed out, it's probably a bug which means that 100 posts would not be too many get to the bottom of it. If I've identified a bug then I've just saved who knows how people a lot of time.
Astonishing that such a major bug could go unnoticed by the developer for so long!!
In the left panel click on Check Trading Conditions then use the Check Profit (Average) block. I've never tried this but seems like it's a solution.
In MT5 you can choose to use one indicator's data to control another. You could then do something like apply a moving average to a momentum indicator that sits below the chart.
If not, I'm assuming that writing a custom indicator is the other option..
I can't make the code any simpler but it still won't work - Is there a bug in fxdreema?
Thanks, tried that previously with all 4 combos, here were the results for backtest restricted to Jan 2020:
I don't get why 2 and 3 don't work. if you limit the dates on the backtest setup to Jan 2020 then shouldn't they generate the same result?
They all contain '=' and the block should filtering for dates equal to Jan 2020!
I tried drawing it on an indicator, I tried without, I tried commenting, I've tried 50 things which don't work - which is why I'm asking repeatedly for someone to send me a couple of blocks of code where comments and drawings work so I can see what I'm doing wrong.
Hi. This is about the simplest example I can make. The left and right should be compiled and run independently. I did it this way because I don't know the correct way to wire shapes or comments.
Neither of these produces and shapes or text in MT5 for me
If you backtest your project at every stage as you build it the way I said, you wont have this problem.
I'll help you get started. Backtest the project below then start adding the other components and remember to test after each change you make.
Since you are new, I'll say this to you. If someone picks through this for you, it can take them a lot of time to find the problem plus you will have learned nothing.
What I suggest is that:
You start from scratch and build this expert again using only the most necessary parts. Eg. get rid of the trailing stop, just build the buy side branch to begin with, use fixed pips stop etc. Test it at every stage to check if it's doing what you think it should.
When you're satisfied that your expert is doing what it should at that stage, then add another piece and so on.
If you get stuck using the above method, then post again. Because you built it from the ground up, you will be able to tell where exactly it's going wrong (ie which piece that you added caused it to go wrong) and I think you will have a much better chance of getting help.
Cheers
I haven't been able to get any object or comment to appear on a chart after a backtest. I don't need a whole project, just a branch that will definitely produce the output so I can see where I'm going wrong.
Thanks
@ambrogio LOL, how did you figure that out, is it in the manual? I didn't see it mentioned.
Thanks
Sorry, I'd like to help, but I can't understand your explanations. I think you need to be more clear, or maybe someone else can understand what you're trying to say.
The project bellow contains two EAs. If I run the one on the left (by turning the one on the right off), The EA makes multiple trades. However, the one the right only makes the first trade.
The only difference is that I put a condition block on the right side one which checks to see if the month on the chart during the backtest is January 2014, before allowing a trade. I can't understand why it will follow the date condition, but only once.
Thanks
Do you mean you only want to start increasing your position size after your initial 3000 account reaches 5000?
Maybe I don't understand your question.
What I think you mean is that you want to increase or decrease your lot size as balance/equity increases or decreases. I believe (because I've never used it myself) that if you use % of equity method, this is what will happen.
Tried following your instructions but nothing happened again. At the moment I just need a working example to see what I'm doing wrong. Can you share any example where any comment and any shape work for you?