← Назад к списку файлов

rsi_ea (4).mq4

Поиск по коду файла

#property version   "1.00"
#property strict

input bool   OpenBUY=True;
input bool   OpenSELL=True;
input bool   CloseBySignal=True;
input double StopLoss=0;
input double TakeProfit=0;
input double TrailingStop=0;
input int    RSIperiod=14;
input double BuyLevel=30;
input double SellLevel=70;
input bool   AutoLot=True;
input double Risk=10;
input double ManualLots=0.1;
input int    MagicNumber=123;
input string Koment="RSIea";
input int    Slippage=10;

int OrderBuy,OrderSell;
int ticket;
int LotDigits;
double Trail,iTrailingStop;

int init()
  {
      // код доступен только после оплаты
   }

int deinit()
  {
   return(0);
  }

int start()
  {
      // код доступен только после оплаты
   }
   double stoplevel=MarketInfo(Symbol(),MODE_STOPLEVEL);
   OrderBuy=0;
   OrderSell=0;
   for(int cnt=0; cnt<OrdersTotal(); cnt++)
     {
      if(OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES))
         if(OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber && OrderComment()==Koment)
           {
            if(OrderType()==OP_BUY) OrderBuy++;
            if(OrderType()==OP_SELL) OrderSell++;
            if(TrailingStop>0)
              {
               iTrailingStop=TrailingStop;
               if(TrailingStop<stoplevel) iTrailingStop=stoplevel;
               Trail=iTrailingStop*Point;
               double tsbuy=NormalizeDouble(Bid-Trail,Digits);
               double tssell=NormalizeDouble(Ask+Trail,Digits);
               if(OrderType()==OP_BUY && Bid-OrderOpenPrice()>Trail && Bid-OrderStopLoss()>Trail)
                 {
                  ticket=OrderModify(OrderTicket(),OrderOpenPrice(),tsbuy,OrderTakeProfit(),0,Blue);
                 }
               if(OrderType()==OP_SELL && OrderOpenPrice()-Ask>Trail && (OrderStopLoss()-Ask>Trail || OrderStopLoss()==0))
                 {
                  ticket=OrderModify(OrderTicket(),OrderOpenPrice(),tssell,OrderTakeProfit(),0,Blue);
                 }
              }
           }
     }
   double rsi=iRSI(Symbol(),0,RSIperiod,PRICE_CLOSE,0);
   double rsi1=iRSI(Symbol(),0,RSIperiod,PRICE_CLOSE,1);

   if(OpenSELL && OrderSell<1 && rsi<SellLevel && rsi1>SellLevel) OPSELL();
   if(OpenBUY && OrderBuy<1 && rsi>BuyLevel && rsi1<BuyLevel) OPBUY();

   if(C

Показано первые 50% кода (символов: 3372)

Как получить полную версию?

Введите ваш email и нажмите кнопку, чтобы перейти к оплате.