Actually I ran it on M1 DAX and on Tester.
Buy does not occur in whole year even with RSI overSold value 45
Thank you a lot in advance
kindest regards
Why are you calculating the RSI values every tick when you are only using them when a new bar forms?
Buffers are used in indicators, not EAs, naming an array with "Buffer" in its name can be confusing. Why use an array anyway, you only check 2 values.
You can cut out
i=RSIPeriod; //---- We here below fill buffer with RSI values while(i>=0) { RSIBuffer[i]=iRSI(NULL,0,RSIPeriod,ApplyTo,i); i--; }
completely
and just use
int OneCandleAgoCloseRSI = iRSI(NULL,0,RSIPeriod,ApplyTo,1); int TwoCandlesAgoCloseRSI = iRSI(NULL,0,RSIPeriod,ApplyTo,2);
instead of
int OneCandleAgoCloseRSI = RSIBuffer[1]; int TwoCandlesAgoCloseRSI = RSIBuffer[2];
Your code should place trades unless you have something like incorrectly sized array
-
Play videoPlease edit your post.
For large amounts of code, attach it.
- Just get the two values as GumRai suggested after you have a new bar.
- Does RSIBuffer have a size? It's not a buffer. Don't use misleading names.
- Check your return codes What are Function return values ? How do I use them ? - MQL4 forum and Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
GumRai
YOUR SOLUTION WORKS!!! Thank you a lot!!!
Pitty this forum does not have points,so I could give you highest grades
Is there anything I can do for you?
You saved me days od researching. Maybe you have email?
kindest regards

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Do you have a code which functiones (regardless of indicator). I need to find principle for "candle crossing"...
//--Below the criteria which check new bar started
//----closing area s new bar
}
//----closing start area