You should learn to debug your own code.
Either use the built-in debugger in MetaEditor, or track values by printing them out to the Experts log.
- www.metatrader5.com
You should learn to debug your own code.
Either use the built-in debugger in MetaEditor, or track values by printing them out to the Experts log.
Thank you for your reply. Following your advice I tried to create some sort of tracking for values and discovered something. to get last three bar values of an indicator I've used CopyBuffer function and when I printed values of each bar I noticed that values inside the buffer are not the exactly the same as indicator has given on that date. For example : If Values from indicator for three days were :
DATE | 26.07.2022 | 27.07.2022 | 28.07.2022 |
---|---|---|---|
Indicator value on that date | 1,00251 | 0,99975 | 0,99810 |
Buffer[0] | 1,00218159 (should be data from 26.07.2022)* small difference but different value | 1.00001608 (should be data from 27.07.2022)* not the same as it should be | 0,99811960 (should be data from 28.07.2022) |
Buffer[1] | 1,00498193 (should be data from 25.07.2022) | 1,00250768 (should be data from 26.07.2022)*now it is correct value | 0,99975155 (should be data from 27.07.2022)* now it is correct as it should be |
Buffer[2] | 1,00684566 ( should be data from 24.07.2022) | 1,00498193( should be data from 25.07.2022) | 1,00250768 (should be data from 26.07.2022) |
as you can see on the table above on 27th of july indicator gave one value but buffer registered another ( as later I calculated it is interpolated value from 26th and 28th of July) but on the bar of 28th buffer value representing previous day value is showing what indicator showed on that day correctly. I can't understand why.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello, I am new to MQL5 and may be missing something, that is why I need your help. I have simple EA that checks the performance of the indicator and it seems to work fine, but I found that it has ignored indicator conditions and hasn't opened trades several times. Can't seem to find the reason for such behavior. in the screenshot below I have marked two skipped signals with red lines. On other places with similar conditions there is no problem and trades were placed. Can you help me find the reason?
https://www.mql5.com/en/charts/17771680/eurusd-d1-ftmo-s-r-missing-trades-in-backtesting