Hi Everyone,
This is my first forum post so apologies if my question is vague and/or explained incorrectly.
I have a bollinger band strategy that has a int period of over 1100 in the iBands (weird I know, just work with me here)
double bbMid03 = iBands(NULL,0,1100,bbStd03,0,PRICE_CLOSE,0,0);
Each time I start the expert Advisor however it always opens a trade at the start of the modelling timeframe and will close that same trade at the end of the modelling timeframe. So only 1 trade can happen in a timeframe of 1 year!
However, whenever the int period is less than 1100 multiple trades open and close within the modelling timeframe.
double bbMid03 = iBands(NULL,0,500,bbStd03,0,PRICE_CLOSE,0,0);
Any explanation as to why this is happening will be appreciated, and even more so how to overcome this issue. Regards
What is the tested timeframe and
have you got any deflective provisions regarding the bollingerBands period in the code ?
[also i dont know if the bands function will straight up reject the request if there are not enough bars in the chart in the tester,will need to check the return value there]
What is the tested timeframe and
have you got any deflective provisions regarding the bollingerBands period in the code ?
[also i dont know if the bands function will straight up reject the request if there are not enough bars in the chart in the tester,will need to check the return value there]
Hi Lorentzos,
The tested timeframe is across any. from 7 days to 2 years, the same issues arise
No deflective provisions as right now as I am just editing the period in the code and then testing
Ah, this may be the problem! I guess I will need to find out what the maximum number of bars in a chart is
Hi Lorentzos,
The tested timeframe is across any. from 7 days to 2 years, the same issues arise
No deflective provisions as right now as I am just editing the period in the code and then testing
Ah, this may be the problem! I guess I will need to find out what the maximum number of bars in a chart is
Yeah , i havent tested that ever either .Let me know what it returns .thanks
-
Why did you post your MT4 question in the MT5 EA section instead of the MQL4 section, (bottom of the Root page?)
General rules and best pratices of the Forum. - General - MQL5 programming forum?
Next time post in the correct place. The moderators will likely move this thread there soon. -
double bbMid03 = iBands(NULL,0,1100,bbStd03,0,PRICE_CLOSE,0,0);
You don't have a MA or bands until you have 1100 bars (past your shift (of zero)). You are reading garbage. The tester starts with only 100 bars (IIRC) before the start date.
-
Why did you post your MT4 question in the MT5 EA section instead of the MQL4 section, (bottom of the Root page?)
General rules and best pratices of the Forum. - General - MQL5 programming forum?
Next time post in the correct place. The moderators will likely move this thread there soon. - You don't have a MA or bands until you have 1100 bars. You are reading garbage. The tester starts with only 100 bars (IIRC) before the start date.
1. Thanks for the advice, I will move it onto the mt4 thread shortly
2. Sorry, please explain in more detail. What do you mean I am reading garbage? Are you saying the tester cannot capture up to 1100 bars?
Thank you
- How can you generate a 1100 bar moving average and a 1100 bar standard deviation when you don't have 1100 bars initially?
- Once you've tested through the initial 1000 bars, then and only then can you use iBands and get a valid value.
- What part of "The moderators will likely move this thread there soon" was unclear?
-
Don't double post! You already had this thread open.
General rules and best pratices of the Forum. - General - MQL5 programming forum 2017.07.19
- How can you generate a 1100 bar moving average and a 1100 bar standard deviation when you don't have 1100 bars initially?
- Once you've tested through the initial 1000 bars, then and only then can you use iBands and get a valid value.
- What part of "The moderators will likely move this thread there soon" was unclear?
-
Don't double post! You already had this thread open.
General rules and best pratices of the Forum. - General - MQL5 programming forum 2017.07.19
3&4. Thanks for the explanation I understand now.
1. So my only question is how can I get the 1100 bars initially to use iBands to get a value value?
Thank you
NO! NO! NO! You can not read the future. You can not read the nonexistent past. Stop trying! Deal with it!
If you do not have enough, return until you do.
What part of "Once you've tested through the initial 1000 bars, then and only then can you use iBands and get a valid value" is unclear to you?
What part of "Test if you have 1100 bars" is unclear to you?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi Everyone,
This is my first forum post so apologies if my question is vague and/or explained incorrectly.
I have a bollinger band strategy that has a int period of over 1100 in the iBands (weird I know, just work with me here)
double bbMid03 = iBands(NULL,0,1100,bbStd03,0,PRICE_CLOSE,0,0);
Each time I start the expert Advisor however it always opens a trade at the start of the modelling timeframe and will close that same trade at the end of the modelling timeframe. So only 1 trade can happen in a timeframe of 1 year!
However, whenever the int period is less than 1100 multiple trades open and close within the modelling timeframe.
double bbMid03 = iBands(NULL,0,500,bbStd03,0,PRICE_CLOSE,0,0);
Any explanation as to why this is happening will be appreciated, and even more so how to overcome this issue. Regards