Cosmic Wang:
Hi MQL5 Community,
I'm stuck in a slump. I'm new to creating EAs, and while attempting to put something together I noticed that the iCCI(), iStdDev(), and iMA() in-built methods do not change values over time during back testing.
To further isolate the issue, the back testing was run over this very simple EA 'test 00.mq5' and prints values for the above per tick. These values do not match the visual on-chart indicators at all.
A few details (could be irrelevant) about my account and configurations for backtesting:
- Account Type: Demo on AdmiralMarkets-Demo
- Timeframe: 15 minute
- Date: Custom period - 2023.04.01 - 2024.01.30
- Forward: No
- Delays: 20 ms
- Modelling: Every tick based on real ticks
- Deposit: 10000, Leverage: 1:50
- Optimization: Disabled, Visual Mode: Yes
They also return the same values over time in Journal, snippet of Journal is attached below. Here is a sample message:
This is the script.
I was hoping some of you experts could answer my questions:
- What are the in-built functions dependent on? (ie. "Quality" of broker data?)
- Why do they keep outputting the same values over time?
- How can I fix this issue?
The compiler is giving you warnings, respect them.
To fix your issue:
Read the manual.
And:
Cosmic Wang #:
Upon reading the documentation, I believe I've correctly applied the use of these methods in OnTick(). Do you have any other feedback that could be helpful?
Cheers.
This is giving warnings (on MQL5):Upon reading the documentation, I believe I've correctly applied the use of these methods in OnTick(). Do you have any other feedback that could be helpful?
Cheers.
double SMA = iMA
EDIT:
You are not reading the documentation.
These functions give a handle, you use the handle in CopyBuffer to get the data.
You create the handle only once, usually in OnInit.
Dominik Egert #:
This is giving warnings (on MQL5):
Okay, I did not understand the documentation. I have implemented the technical indicators correctly with the appropriate CopyBuffer to retrieve the data I need, thank you so much for leading me in the right direction!
This is giving warnings (on MQL5):
EDIT:
You are not reading the documentation.
These functions give a handle, you use the handle in CopyBuffer to get the data.
You create the handle only once, usually in OnInit.
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
To further isolate the issue, the back testing was run over this very simple EA 'test 00.mq5' and prints values for the above per tick. These values do not match the visual on-chart indicators at all.
A few details (could be irrelevant) about my account and configurations for backtesting:
They also return the same values over time in Journal, snippet of Journal is attached below. Here is a sample message:
"2024.02.02 15:00:27.503 2023.04.05 00:12:41 cciValue: 10.0 stdDev: 11.0 SMA: 12.0")
This is the script.
I was hoping some of you experts could answer my questions: