[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 598

 
Dimka-novitsek:
How do I get the meta-editor out of the glitch? Preferably without shutting down the computer, preferably saving the information - the last ten to fifteen lines that have not been compiled.
Are you again with your "favourite rake"?! Waiting for "development" Metaquotes-products > 2-3 minuts = (may the owner of the avatar not be offended). ;)
 
Thank you!
 

Hi all,

please advise how to find out the maximum price that was after the formation of a fractal

 

Here is the trading function that opens positions:

//+-------------------------------------------------------------------------------------+
//| Открытие позиций                                                                    |
//+-------------------------------------------------------------------------------------+
bool Trade (int signal)
{
  double sl = 0, tp = 0;

  if(signal == SIGNAL_BUY && FindOrders() == 0)                                     // Если сигнал на покупку и открытых ордеров нет...
  {
    g_ticket = OpenBuy();                                                           // открываем лимитный ордер на покупку
  
    if(g_ticket > 0 && OrderSelect(g_ticket,SELECT_BY_TICKET,MODE_TRADES) == true)  // Если ордер есть и он выбран..
    {
      if(i_sl != 0)                                                                 // Если входной параметр стоп-лосса не равен 0, то..
        sl = NormalizeDouble(OrderOpenPrice() - i_sl*Point,Digits);                 // Получаем значение стоп-лосса для выбранного ордера
      if(i_tp != 0)                                                                 // Если входной параметр тейкпрофита не равен 0, то..
        tp = NormalizeDouble(OrderOpenPrice() + i_tp*Point,Digits);                 // Получаем значение тейкпрофита для выбранного ордера
    }  
  }  
  else if(signal == SIGNAL_SELL && FindOrders() == 0)                               // Если сигнал на продажу и открытых ордеров нет..
  {
    g_ticket = OpenSell();                                                          // Открываем лимитный ордер на продажу
  
    if(g_ticket > 0 && OrderSelect(g_ticket,SELECT_BY_TICKET,MODE_TRADES) == true)  // Если ордер есть и он выбран..
    {
      if(i_sl != 0)                                                                 // Если входной параметр стоп-лосса не равен 0, то..
         sl = NormalizeDouble(OrderOpenPrice() + i_sl*Point,Digits);                // Получаем значение стоп-лосса для выбранного ордера
      if(i_tp != 0)                                                                 // Если входной параметр тейкпрофита не равен 0, то..
         tp = NormalizeDouble(OrderOpenPrice() - i_tp*Point,Digits);                // Получаем значение тейкпрофита для выбранного ордера
    }
  }
  if(sl != 0 || tp != 0)                                                            // Если полученные значения sl и tp не равныы 0, то..
  {
    OrderModify(g_ticket,OrderOpenPrice(),sl,tp,OrderOpenTime() + 86400,Lime);      // Модифицируем ордер
    return(true);
  }
  return(true);
}

All clear and concise. Error 130 keeps popping up in the tester, although the Expert Advisor works, but error 130 keeps popping up. What is the reason for that?

This function uses position opening functions, here they are:

//+-------------------------------------------------------------------------------------+
//| Открытие длинной позиции                                                            |
//+-------------------------------------------------------------------------------------+
int OpenBuy()
{
  g_ticket = -1;
  string myNote = "сов баянул";
         
  g_ticket = OrderSend(Symbol(),OP_BUYLIMIT,0.1,GetPriceToInput(),3,0,0,myNote,myMagic,0,Blue);
  if(g_ticket > 0 && OrderSelect(g_ticket,SELECT_BY_TICKET,MODE_TRADES) == true)
  
  return(g_ticket);
}
//+-------------------------------------------------------------------------------------+
//| Открытие короткой позиции                                                           |
//+-------------------------------------------------------------------------------------+
int OpenSell()
{
  g_ticket = -1;
  string myNote = "сов шортанул";

  g_ticket = OrderSend(Symbol(),OP_SELLLIMIT,0.1,GetPriceToInput(),3,0,0,myNote,myMagic,0,Red);
  if(g_ticket > 0 && OrderSelect(g_ticket,SELECT_BY_TICKET,MODE_TRADES) == true)
  
  return(g_ticket);
}

I thought it had something to do with stop level, I added check, but it's not the same. I removed it for now as on Alpari this level is 0. Please hint what needs to be corrected to avoid this error.

 


 double min=Low[iLowest(NULL,PERIOD_M15,MODE_LOW,32,0)];

how to record in 1.30320 format for EURUSD for example?
 
if(OrderTakeProfit()!=0&&OrderTakeProfit()!=OrderOpenPrice()+2*kio*Point&&Bid>OrderOpenPrice()+50*kio*Point)
               OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),OrderOpenPrice()+2*kio*Point,0);
Hi all. Can you tell me what's wrong with Error #1 how to fix it? thank you!
 
rigonich:

Declare a variable of datetime type and assign it the valueTime[0]. After the order has been opened, if it is not equal toTime[0], you may open the next order and if it is equal to Exit. As for the criteria, I haven't looked at the code, but it seems that if it is a stochastic, it should trigger at crossing at overbought/oversold levels (usually >80 and <20%). For clarity, set the levels at 20 and 80 % in the stochastics settings
Rigonich:

Declare a variable of datetime type, assign it the valueTime[0], after opening an order, then if it is not equal toTime[0, you can open the next order, if it is equal to --exit from start. As for the criteria, I haven't looked at the code, but it seems that if it is a stochastic, it should trigger at crossing at overbought/oversold levels (usually >80 and <20%). For clarity, set levels of 20 and 80 % in the stochastic settings.
Thank you)
 
Good afternoon please help, I can't understand why unnecessary orders are opening ((, circled in red in the screenshot, here are the criteria
// Торговые критерии
   M_1=iStochastic(NULL,0,Kperiod,Dperiod,Slowing,MODE_SMMA,Price_field,MODE_MAIN,  0);
   M_2=iStochastic(NULL,0,Kperiod,Dperiod,Slowing,MODE_SMMA,Price_field,MODE_MAIN,  1);
   S_1=iStochastic(NULL,0,Kperiod,Dperiod,Slowing,MODE_SMMA,Price_field,MODE_SIGNAL,0);
   S_2=iStochastic(NULL,0,Kperiod,Dperiod,Slowing,MODE_SMMA,Price_field,MODE_SIGNAL,1);
 
   if (M_2 < S_2 && M_1>=S_1 ) 
      { 
       if (Total==1)
         {
          if (Vremya== Time [0]) 
          return; 
          T=Close_Order (Lts,Tip);
          Vremya= Time [0];
          if (T==true)
           { 
           Total=0;
           }
         } 
       if (Total==0)         
         { 
         if (Vremya== Time [0])  
         return;                                     
   
          Open_Order_B (Lts); 
          Vremya= Time [0];
            
         }                                      
      }
   if (M_2 > S_2 && M_1<=S_1 ) 
      { 
       if (Total==1)
          {
           if (Vremya== Time [0]) 
           return; 
           T=Close_Order (Lts,Tip); 
           Vremya= Time [0];
           if (T==true)
             {
             Total=0;
             }
          }
       if (Total==0)         
          {                                          
          if (Vremya== Time [0]) 
          return;                                     
          
          Open_Order_S (Lts); 
          Vremya= Time [0];                                              
          }
       }   
 
Equilibrium:
Good afternoon please help, I can't understand why unwanted orders open ((, in the screenshot they are circled in red, here are the criteria

Try to take indicator values from 1 and 2 bars. Something like this.
 
i999i:

Hi all,

please advise how to find out the maximum price that was after the formation of a fractal


Next top fractal.
Reason: