Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 460

 
Здравствуйте!Никто не видит здесь недоразумения?Просто при тестировании параметра n всего два разных варианта исхода...
  double L_GBPUSD=Low[iLowest("GBPUSD",0,MODE_LOW,n,0)];
  double L_EURUSD=Low[iLowest("EURUSD",0,MODE_LOW,n,0)];
  double L_USDJPY=Low[iLowest("USDJPY",0,MODE_LOW,n,0)];

  double H_GBPUSD=High[iLowest("GBPUSD",0,MODE_HIGH,n,0)];
  double H_EURUSD=High[iLowest("EURUSD",0,MODE_HIGH,n,0)];
  double H_USDJPY=High[iLowest("USDJPY",0,MODE_HIGH,n,0)];
//////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                                              //
//                                         Покупка                                              //
//                                                                                              //
//////////////////////////////////////////////////////////////////////////////////////////////////  
      if
    (
      kolpos==0&&
      Volume[0]>Volume_A&&
      Volume[0]<Volume_B&&
      iOpen("GBPUSD",0,0)>iHigh("GBPUSD",0,H_GBPUSD)&&
      iOpen("EURUSD",0,0)>iHigh("EURUSD",0,H_EURUSD)&&
      iOpen("USDJPY",0,0)<iLow("USDJPY",0,L_USDJPY)&&
      DayOfWeek()!=5
    )OrderSend(Symbol(),OP_BUY,Lot,Ask,slippage,Ask-SL*Point,0,NULL,OrderMagicNumber(),0,Green);
//////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                                              //
//                                         Продажа                                              //
//                                                                                              //
////////////////////////////////////////////////////////////////////////////////////////////////// 
      if
    (
      kolpos==0&&
      Volume[0]>Volume_A&&
      Volume[0]<Volume_B&&
      iOpen("GBPUSD",0,0)<iLow("GBPUSD",0,L_GBPUSD)&&
      iOpen("EURUSD",0,0)<iLow("EURUSD",0,L_EURUSD)&&
      iOpen("USDJPY",0,0)>iHigh("USDJPY",0,H_USDJPY)&&
      DayOfWeek()!=5
    )OrderSend(Symbol(),OP_SELL,Lot,Bid,slippage,Bid+SL*Point,0,NULL,OrderMagicNumber(),0,Red);
 
That's it...just posted it and saw it right away...sorry!
  double H_GBPUSD=High[iHighest("GBPUSD",0,MODE_HIGH,n,0)];
  double H_EURUSD=High[iHighest("EURUSD",0,MODE_HIGH,n,0)];
  double H_USDJPY=High[iHighest("USDJPY",0,MODE_HIGH,n,0)];
 
Hi! Could you please tell me how to edit a file created with the FileOpen function, e.g. delete a byte from the current position and insert another in its place!
 

Help to solve a problem!

The EA in the tester hangs when using the ICustom function. Any solutions to the problem?

bool b_start = false,
  b_stop = false,
  s_start = false,
  s_stop = false,
  ready_s = false,
  ready_b = false;
  int i = 0,
  ord,
  ticket;
  double high,
  low;
int OnInit()
  {
  
//---
   
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
  ord = OrdersTotal();
  
  //------------------Открытые ордера-----------------------------------------------
  if (ord>0)
   {
   for (i=0; i<=ord; i++)
      {
      if (OrderSelect(i,SELECT_BY_POS)==true)
         {
         if (OrderType() == 0)                  //есть ордера на покупку
            if (b_stop == true)
               {
               OrderClose(OrderTicket(),0.1,Ask,5);   //закрыть если есть условие 
               b_stop = false;
               }   
         }
      if (OrderSelect(i,SELECT_BY_POS)==true)
         {
         if (OrderType() == 1)                  //есть ордера на продажу
         if (s_stop == true)
               {
               OrderClose(OrderTicket(),0.1,Bid,5);   //закрыть если есть условие 
               s_stop = false;
               } 
         }
      }
   }
   //--------------------------------------------------------------------------------
 high = iCustom(NULL,0,"PB Channel","current time frame",25,6,3.0,TRUE,TRUE,FALSE,FALSE,TRUE,FALSE,FALSE,1,0); 
 low = iCustom(NULL,0,"PB Channel","current time frame",25,6,3.0,TRUE,TRUE,FALSE,FALSE,TRUE,FALSE,FALSE,2,0);

if ((Bid+5*Point) < low )  //если цена ушла ниже границы, готовимся к покупке
{
   ready_b = true;
   s_stop = true;
} 
else
{
   if ((Bid-5*Point) > high )  //если цена ушла выше границы, готовимся к продаже
   ready_s = true;
   b_stop = true; 
}

if ((Bid < high)&&(Ask>low) )
   if (ready_b == true)
      {
      ticket = OrderSend(Symbol(),OP_BUY,0.1,Ask,5,Bid-1500*Point,Bid+1500*Point);
      ready_b = false;
      }
      else if (ready_s == true)
         {
         ticket = OrderSend(Symbol(),OP_SELL,0.1,Bid,5,Ask-1500*Point,Ask+1500*Point);
         ready_s = false;
         }

  }

 
wolfovik:

Help to solve a problem!

The EA in the tester hangs when using the ICustom function. Any solutions to the problem?


And the indicator name is exactly the same as in ICustom function 3 parameter
 
r772ra:

And the name of the indicator is exactly the same as the name of the ICustom 3 parameter

Yes, it is exactly the same. And it is called by script separately. But it takes about 2-3 seconds
 
wolfovik:

Help to solve a problem!

The EA in the tester hangs when using the ICustom function. Any solutions to the problem?


The names do not coincide:

 high = iCustom(NULL,0,"PB Channel","current time frame",25,6,3.0,TRUE,TRUE,FALSE,FALSE,TRUE,FALSE,FALSE,1,0); //не стоит в именах файлов пробелы ставить

   PBkChannel.ex4  
 
evillive:

Somehow the names don't match up:


The forum probably won't let you attach the file with a space. Everything matches. The problem is deeper than that...
 
Who has been able to open multiple terminal windows on one PC after updating MT4, to trade with multiple accounts???
 
wolfovik:

Help to solve a problem!

The EA in the tester hangs when using the ICustom function. Are there any solutions to the problem?

Also, in the Strategy Tester, there is a constant error PB Trade EURUSD,H1: OrderSend error 130

Although stops are at 300 points!

ticket = OrderSend(Symbol(),OP_BUY,0.1,Ask,5,Bid-300*Point,Bid+300*Point);

It doesn't work like this!

RefreshRates();
ticket = OrderSend(Symbol(),OP_BUY,0.1,Ask,5,Bid-300*Point,Bid+300*Point);

Where did I go wrong?


Reason: