To be honest, I really do not understand what it is you are trying a accomplish!
All I can say, is that your code is probably not correct in terms of coding syntax. The "while" loop is not set out correctly and maybe it should be more like this:
while( iRSI(NULL, PERIOD_CURRENT, Periodo, PRICE_CLOSE, 1+i) < 50 ) { i--; Buffer2[i] = Low [i] - 1 * myPoint; }
However, even thou the above code is more syntactically correct, I don't understand the coding logic or what it is you are trying to achieve.
RSI must be above 70 (RSI Max), then with the while loop I want to raise a candle until the RSI drops to 50 so I get out of the while loop and then have the buffer1.
sorry for my English!!!
inserting i--; inside the braces solve?
// Indicator Buffer 1 if(iRSI(NULL, PERIOD_CURRENT, Periodo, PRICE_CLOSE, 1+i) > RSI_Max //1) First condition ) while (iRSI(NULL, PERIOD_CURRENT, Periodo, PRICE_CLOSE, 1+i) > 50) //2) Second condition whit cycle while { i--; Buffer1[i] = High[i] + 1 * myPoint; //2) when the while loop condition is not met, then the RSI is below the value of 50 out Buffer 1 } //Indicator Buffer 2 if(iRSI(NULL, PERIOD_CURRENT, Periodo, PRICE_CLOSE, 1+i) < RSI_Min //Relative Strength Index < fixed value ) while (iRSI(NULL, PERIOD_CURRENT, Periodo, PRICE_CLOSE, 1+i) < 50) { i--; Buffer2[i] = Low [i] - 1 * myPoint; } } return(0); }
1) RSI > 70
2)I look the while loop RSI < 50
3) Out Buffer 1
where am I wrong?
thank you
No, it will not solve your problem. All I did, was show you a possible correct construct for a "while" loop. That is all!
As for the rest, I also said that your code does not make sense to me. I don't understand your code and also I don't understand what it is you are trying to achieve!
One operator, the cycle body // Cycle body is one operator
My Condition is iRSI(NULL, PERIOD_CURRENT, Periodo, PRICE_CLOSE, 1+i) > 50
Cylce body is one operator is i--;
I do not understand where I'm wrong, the while loop looks correct!
I would wait with a while loop that the condition is no longer fulfilled for the buffer output
while ( Condition ) // Header of the cycle operator
One operator, the cycle body // Cycle body is one operator
My Condition is iRSI(NULL, PERIOD_CURRENT, Periodo, PRICE_CLOSE, 1+i) > 50
Cylce body is one operator is i--;
I do not understand where I'm wrong, the while loop looks correct!
I would wait with a while loop that the condition is no longer fulfilled for the buffer output
If it looks correct, why did you place the next statement inside a code block? Is it supposed to execute only once after the loop or many times inside the loop?
{
Buffer1[i] = High[i] + 1 * myPoint;
}
Also, why are you decremented "i" in the "while" loops, when it is clearly being controlled by the the parent "for" loop?
for(int i = limit-1; i >= 0; i--)
I do not understand this step .. sorry
I declare this: Int a=bars; and operator Cylce body is a--;
Ok?

- 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 everybody, I'm trying to learn while loop and in this my code I would like the RSI, when it comes to 70/30, must await the descent / ascent to 50 then give me back the Buffer / Cue Ball.
i--; It is correct for the increase of a future candle?
The code does not give me errors but does not work, you could kindly help me?
Thank you