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
Perhaps so it should work, give me an opinion please?
control in the first candle that RSI is greater than 50, then I go back to look for the first candle with a lower RSI at 30, as soon as I find the cycle ends and I will have in the candle 0 buffer1
correct?!?
thanks to all and sorry my bad English!
if (iRSI(NULL,0,4,PRICE_CLOSE,1+i) > 50)
int I=2;
while (iRSI(NULL,0,4,PRICE_CLOSE,I) > 30 )
{I++;}
Buffer1[i] = High[i];
int I=2;
while (iRSI(NULL,0,4,PRICE_CLOSE,I) > 30 )
{I++;}
When RSI is below 30, the loop exits.
It's wrong?
until the RSI is above 30, the cycle goes on and increments of a candle the condition to be tested.
When RSI is below 30, the loop exits.
It's wrong?
It's not wrong, but what is its purpose?
You get a value for the variable I but then you do not do anything with it.
if( counted_bars > 0 ) counted_bars --;
limit = Bars - counted_bars;
for( i= limit;i>=0;i--)
{
if (iRSI(NULL,0,4,PRICE_CLOSE,i) > 50) // First condition true
{
int I=i+1;
Fleche_Up[i] = High[i];
for(int u = I;u< I+15;u++)
{
if(iRSI(NULL,0,4,PRICE_CLOSE,u) < 30) //Second condition true
{
Fleche_Down[u] = Low[u] ;
break;
}
}
}
}
That hardly resembles the code that you have been posting
if( counted_bars > 0 ) counted_bars --;
limit = Bars - counted_bars;
Where does counted_bars get its value? It is not declared or assigned a value in your code.
If counted_bars does = 0, limit will be assigned the value of Bars.
As the highest bar index is Bars-1, you risk an Array out of range error
if (iRSI(NULL,0,4,PRICE_CLOSE,i) > 50) // First condition true
do you really just want to check that the RSI for that bar is above 50 or do you only want to check for a cross above or bounce off 50? (see my earlier post)
for(int u = I;u< I+15;u++)