- Questions about how to set up MetaTester 5 Agents Manager - MQL5 Cloud Network
- Group of OnTester events for optimization control
- Introduction to MetaTrader 5 Strategy Tester
Your topic has been moved to the section: Expert Advisors and Automated Trading
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
You have been informed of this multiples times. Please make sure to post in the correct section.
Okay, thank you.
Your EA code is only detecting a new bar event on the current time-frame (namely the daily chart as per your screenshot).
Hence, your M1 indicators are only updated "daily" and not on every M1 bar.
You need to detect both time-frames independently, and make sure to synchronise the data.
Correction: You are in fact detecting the M1. I missed that. I will look at the code more carefully and get back later.
Your EA code is only detecting a new bar event on the current time-frame (namely the daily chart as per your screenshot).
Hence, your M1 indicators are only updated "daily" and not on every M1 bar.
You need to detect both time-frames independently, and make sure to synchronise the data.
Correction: You are in fact detecting the M1. I missed that. I will look at the code more carefully and get back later.
I really do appreciate how helpful you have been to me! Thank you so much!
Ok, I think I spotted the bug ...
static datetime dtBarCurrentOneMinute = WRONG_VALUE; datetime dtBarPreviousOneMinute = dtBarCurrentOneMinute; dtBarCurrentOneMinute = iTime(_Symbol,PERIOD_M1, 0); bool bNewBarEventOneMinute = (dtBarCurrentOneMinute != dtBarPreviousOneMinute); if(bNewBarEvent) {
You are using the wrong variable. You are checking "bNewBarEvent" instead of "bNewBarEventOneMinute".
I did not look any further once I spotted the above bug. There may be other bugs. So, dedicate some time to look for any other bugs.
Ok, I think I spotted the bug ...
You are using the wrong variable. You are checking "bNewBarEvent" instead of "bNewBarEventOneMinute".
I did not look any further once I spotted the above bug. There may be other bugs. So, dedicate some time to look for any other bugs.
Thank you for all your help and wisdom!

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use