Print the values of the indicator so that you can check them.
What time frame are you using for the test?
Thanks for the reply.
I'm testing the daily timeframe.
I almost always print values to double check my code and test issues. No idea why I didn't do that for this 🤦♂️
I did as you suggested and had the code print the value of the indicator for each day at the time the EA is supposed to execute a trade. I then ran the tester twice with the code taking trades at the 1 minute mark and the other at the 10 min. mark. I then compared the two reports side by side to see what extra trades were taken or what trades were missed.
The difference is by a few trades so I went to those days and the indicator is giving the correct value and the EA acts accordingly. The issue seems to be the strategy tester as it looks like it just completely misses even going over the day/candle that the trade was taken/missed (if that makes sense).
First screenshot (1 minute after daily close) of the strategy tester journal doesn't show data for March 6, 2017 as if the tester didn't run through it, therefore no trade was taken, when it was supposed to, when the DPO indicator crossed over the zero line. The second screenshot (10 minutes after daily close) shows data for that day, and the trades were opened as intended.
The strategy tester is completely not "running through" the day/candle. Is this normal or is there something I can do to fix this?
Using hour and minute are untrustable, specially in low liquidity periods like the beginning of the day.
Ah duh, that makes sense.
Considering implementing the following code to resolve the issue. Do you have any recommendations outside of what I suggested below?
if (Hour()==00 && Minute()>=00 && Minute()<=10) { dpobuy(); }
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
My EA is designed to make a trading decision right at the start of the new daily candle based on the value of certain indicators from the previous candle that just closed. The EA will run the trade function at a certain time on the new candle as seen below:
I normally have the Minute value at 1 because I want the trade to execute close to the closing price of the previous candle. I have changed the value of the Minute function to different numbers (5, 10, 15 etc.) for data purposes and ran it through strategy tester and noticed that I get extremely different results in the amount of trades taken.
I understand that price will be different based on that time so that will of course affect your end profit/loss. But my main concern is the number of trades taken which is always very different.
Once a candle closes, the value of the indicator tested for that previous candle should be "locked" in, unless of course the indicator repaints and I am confident the indicators I've tested do not repaint. I am having this issue on multiple different indicators. And yes the value is shifted to test the previous candle:
All other variables remain constant (i.e spread, timeframe tested, etc.). I only change the value of the minute function.
When looking through the journal results of the strategy tester, there are trades that are either not taken that should have been or new trades that are when the value of the indicator says otherwise when you look at it for the previous candle that gave the signal.
Knowing that the indicators I'm testing don't repaint, why am I getting a different amount of trades taken for my results? Is the strategy tester known to change the value of the indicator tested and "make it" repaint or is it something else?
What am I missing here?
Thanks in advance for your help.