Hello everyone, I have little problem with an increase of a counter.
after my first condition, I try in the 1500 candles counted from the for loop, the close[1+i] is repeated at least 20 times in the history.
Global Scope:
after my first condition, I try in the 1500 candles counted from the for loop, the close[1+i] is repeated at least 20 times in the history.
Global Scope:
Inserted Code
int CountSell; double CloseSell; bool Sell;
Inserted Code
if(iCustom(NULL, PERIOD_CURRENT, "CCI", CCI_Periodo, 0, PRICE_CLOSE, i) > 60
&& iCustom(NULL, PERIOD_CURRENT, "CCI", CCI_Periodo, 0, PRICE_CLOSE, i) < 80
{ Sell=false; CloseSell=Close[1+i]; CountSell=0; }
if(Sell == false){
for(int I=0; I<1500; I++){
if(CloseSell==Close[2+I]){
CountSell++;
Print("CountSell: "+IntegerToString(CountSell));
Print("Price :"+ DoubleToString(CloseSell)); }
if(CountSell==20) { I=1500; Sell=true; }
}
}