update - just found out my history quality is shocking 5%. Working on improving the history now. Hopefully that's why things fail...
That didn't fix it. History quality now at 100%. Still seeing arrows starting delayed by 18 days when backtesting three months, while the new bar journal messages in the same if statement start right away...
Really strange...
As you guys can see, trading live MT5 first prints an arrow and then all of a sudden switches to thumbs_up?
Files:
arrow_example.png
3 kb
arrow_label++; string label = IntegerToString(arrow_label);
You can't use an as-series index in names as they are not unique. As soon as a new bar starts, you will be trying to create a new name (e.g. "name0",) same, existing, previous, name (e.g. "name0" now on bar one.)
Use time (as int) or a non-series index:
#define SERIES(I) (Bars - 1 - I) // As-series to non-series or back.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Gents,
I'm currently playing with the new bar event handler lib (https://www.mql5.com/en/articles/159).
My goal is to simply draw a green arrow_up on a new bar. This is for testing and familiarising only ;-)
However, I'm seeing a lot of strange things happening:
1. Although the log shows that a new bar is detected from the very first second on, the arrows first time show up half a month after starting in strategy tester
2. In live testing the arrow is suddenly not an arrow like in strategy tester but a thumb up?
3. Often, the arrow does not get drawn at all, though in the same if statement and Print() is being run from the same if statement
My function to draw the arrow (for better readability I removed the error management):
my function call in the EA (OnTick):
I already considered my lack of coding knowledge (just started) as well as any possible bugs in MT5? The delayed start of arrow object creation in the strategy tester, could this possibly be related to poor history data?
Looking forward to your thoughts and ideas.