[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 446

 
sanyooooook >>:

нормализуйте цену

Isn't Bid normalised? at start it works

 
keekkenen >>:
попробуй прогнать цикл из конца в начало

Still a closing error

 
qwerewq >>:

воткни вот это в старт, закроет все с гарантией, только впиши условия..

Why doesn't it work as a function and why does it work at startup?

 

Correction, please. Not closing

Close at crossing of RSI level 60


extern int Level_2 =60;

rsi_0=iRSI( NULL,0, RSI_Period_0, PRICE_CLOSE, 0 );
rsi_1=iRSI( NULL,0, RSI_Period_0, PRICE_CLOSE, 1 );

if(rsi_1 > Level_2 && rsi_0 < Level_2) OrderClose(OrderTicket(),OrderLots(),Bid,3,White);
break;

 
gince >>:

Поправте, пожалуйцта. Незакрывает

Закрытие по пересечению RSI уровня 60 ц верху в низ


at RSI - levels from bottom to top. bottom 0 from top 60.

 
sergeev >>:


у РСИ - уровни снизу вверх. снизу 0 сверху 60.



I know

It's a buy close.

Upper level 60, lower level 40

 
for(int i=0; i<OrdersTotal(); i++)
     {
      if(OrderSelect( i, SELECT_BY_POS, MODE_TRADES)==false)        break;
      if(OrderMagicNumber()!= MAGICMA || OrderSymbol()!=Symbol()) continue;
      //---- check order type 
      if(OrderType()==OP_BUY)
        {
         //if(Open[1]>ma_2 && Close[1]<ma_2) OrderClose(OrderTicket(),OrderLots(),Bid,3,White);
         if( rsi_1 > Level_2 && rsi_0 < Level_2) OrderClose(OrderTicket(),OrderLots(),Bid,3,White);
         break;
        }
      if(OrderType()==OP_SELL)
        {
         //if(Open[1]<ma_2 && Close[1]>ma_2) OrderClose(OrderTicket(),OrderLots(),Ask,3,White);
         if( rsi_1 < Level_1 && rsi_0 > Level_1)OrderClose(OrderTicket(),OrderLots(),Ask,3,White);
         break;
        }
     }
 
 
Vinin >>:

А перейти в конец файла не пробовали? FileSeek()

Thank you very much. It's working now.

It seems to me, though, that common sense, in file add mode, the default pointer should automatically move to the end of the file when you open it, or the documentation for this mode could at least provide a link to this function to do it manually each time.

 
gince >>:


Your algorithm is correct. make a debriefing of possible errors and find out where the Expert Advisor reaches when executing this code.

+ print the calculated rsi values.

Reason: