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

 

People help, please....

I cannot understand why this indicator works fine on H4, but it lags on other timeframes...

I have already reinstalled the terminal, but I still do not understand what the problem is.

Files:
test3v2.mq4  4 kb
 
clubsmi:

People help, please....

I cannot understand why this indicator works fine on H4, but it lags on other timeframes...

I have already reinstalled the terminal, but I still do not understand what the problem is.


I have to count many bars, or there are no quotes in the history for all symbols, that's why I have lags; what does the terminal have to do with it? Try to limit the drawing depth to 1000 bars, say.
 
evillive:

You have to count many bars, or there are no quotes in the history for all symbols, so you get lags; what does the terminal have to do with it? Try to limit the drawing depth to 1000 bars, say.

Thank you very much for the tip. Fixed it. thanks again!
 
Hi all! When a certain condition occurs, the Expert Advisor opens a trade and closes it at Take or Stop Loss accordingly. That is all, the Expert Advisor does not open trades anymore, despite the fact that the conditions for opening trades are fulfilled. Please advise what is the reason? I would really appreciate it.
 
alexey1979621:
Hi all! When a certain condition occurs, the Expert Advisor opens a trade and closes it at Take or Stop Loss accordingly. That is all, the Expert Advisor does not open trades anymore, despite the fact that the conditions for opening trades are fulfilled. Please advise what is the reason? I would really appreciate it.
If you don't have source code, go to a telepath...
 

I need an owl martin, on the history (test) gives 10-15% per month with an average 15% max drawdown. Max drawdown = 50%, thus drains half of depo once in a year or a year and a half, and before that every month gives 10-15%.
The highlight of the owl is in the filtering of movement. The owl looks for a no-failure movement, recalculating the last X bars on M1, and if it finds a movement>50 pips, it applies the following filters:
1) there should be no M15 candle with a range of more than 25 pips (news has come out)
2) there should not be a pullback of more than 40% to the current impulse (formula - pullback value/impulse value*100% - if more than 40%, cancel the order)
3) There was not a prolonged flat, i.e. all the hai breached in no less than X number of candles at M15 (I will not go into details here)
If all conditions are met, the scoop places a buy order, then at a distance of 20 points away from it one more buy order with a lot 2 times larger, 20 points later one more with a lot 4 times larger than the first order. And some more technical points
As a result we get an owl that starts working only when it sees a long non-stop movement and no no news, so it would be very difficult to get lost.

 
evillive:
Without the source code, go to the telepaths...

Source

int start()
{
 double SL,TP;
 int slv=MarketInfo(Symbol(),MODE_STOPLEVEL);
 if(Step<=slv || StepOtl<=slv) {Print("Step или StepOtl слишком мал"); return(0);}
 
 CountTrades();   //подсчет ордеров по типам.
 BU();
 
 //если нет рыночных ордеров-----------------------------------------
 if(bs+ss+bsts+ssts+blms+slms==0)                                     
 {
  if (Open[1]>Close[1] && Open[2]<Close[2] && High[1]>High[2] && Low[1]<Low[2])  // продажа
  {
   TP=NormalizeDouble(Bid - TakeProfit * Point, Digits);  
   SL=NormalizeDouble(Bid + StopLoss*Point,Digits);
   if(TakeProfit==0) TP=0;
   if(StopLoss==0) SL=0;                       
   ticket1=OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,SL,TP,"Pattern_1",Magic,0,Red);//Сразу с тейк-профитом, магик в настройках
   if(OrderSelect(ticket1,SELECT_BY_TICKET,MODE_TRADES)) price1=OrderOpenPrice();//цена первого ордера
   SL=NormalizeDouble(Bid+StepOtl*Point-StopLoss*Point,Digits);
   if(StopLoss==0) SL=0;
   ticket2=OrderSend(Symbol(),OP_BUYSTOP,Lots,NormalizeDouble(Bid+StepOtl*Point,Digits),0,SL,0,"Pattern_1",Magic,0,Blue);//тикет для BuyStop
   if(OrderSelect(ticket2,SELECT_BY_TICKET,MODE_TRADES)) price2=OrderOpenPrice();//цена второго ордера
  }
  
  if (Open[1]<Close[1] && Open[2]>Close[2] && High[1]>High[2] && Low[1]<Low[2]) // покупка
  {
   TP=NormalizeDouble(Ask + TakeProfit * Point, Digits); 
   if(TakeProfit==0) TP=0;
   SL=NormalizeDouble(Ask-StopLoss*Point,Digits);
   if(StopLoss==0) SL=0;
   ticket1=OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,SL,TP,"Pattern_1",Magic,0,Blue);//с тейком, магик в настройках 
   if(OrderSelect(ticket1,SELECT_BY_TICKET,MODE_TRADES)) price1=OrderOpenPrice();//цена первого ордера
   SL=NormalizeDouble(Bid-StepOtl*Point+StopLoss*Point,Digits);
   if(StopLoss==0) SL=0;
   ticket2=OrderSend(Symbol(),OP_SELLSTOP,Lots,NormalizeDouble(Bid-StepOtl*Point,Digits),0,SL,0,"Pattern_1",Magic,0,Red);//тикет для SellStop
   if(OrderSelect(ticket2,SELECT_BY_TICKET,MODE_TRADES)) price2=OrderOpenPrice();//цена второго ордера
  }
 }
 

 return(0);
}
     
 //+------------------------------------------------------------------+
void CountTrades() // количество открытых ордеров
   {
    for(int i=OrdersTotal()-1; i>=0; i--) 
    {
     if (OrderSelect(i, SELECT_BY_POS,MODE_TRADES))
     { 
      if (OrderSymbol()!=Symbol() && OrderMagicNumber()!=Magic) continue;//отделяем свои ордера. Магик задается в настройках
      int typ=OrderType();      //однократный вызов функции ускоряет работу
      switch (typ)
      {
       case 0: bs++;
       case 1: ss++;
       case 2: blms++;
       case 3: slms++;
       case 4: bsts++;
       case 5: ssts++;
       default: break;
      }        
     }
    }
    return;  
   }
 //+------------------------------------------------------------------+
 
Frangatic:

I need an owl martin, on the history (test) gives 10-15% per month with an average 15% max drawdown. Max drawdown = 50%, thus drains half of depo once in a year or a year and a half, and before that every month gives 10-15%.
The highlight of the owl is in the filtering of movement. The owl looks for a no-failure movement, recalculating the last X bars on M1, and if it finds a movement>50 pips, it applies the following filters:
1) there should be no M15 candle with a range of more than 25 pips (news has come out)
2) there should not be a pullback of more than 40% to the current impulse (formula - pullback value/impulse value*100% - if more than 40%, cancel the order)
3) There was not a prolonged flat, i.e. all the hai breached in no less than X number of candles at M15 (I will not go into details here)
If all conditions are met, the scoop places a buy order, then at a distance of 20 points away from it one more buy order with a lot 2 times larger, 20 points later one more with a lot 4 times larger than the first order. And some more technical points
As a result we get an owl that starts working only when it sees a long non-stop movement and no no news, so it would be very difficult to get lost.

This is where you get the job! Will do it well, quickly and cheaply!
 
borilunad:
This is the right place for you ! It's good, it's fast and it's cheap!
Well, that's a bit of a stretch. And if it's fast, it's a long shot... And if it's cheap, see point 1.
 
alexey1979621:

Source



Why count pending orders? And who is BU();?

      if (OrderSymbol()!=Symbol() && OrderMagicNumber()!=Magic) continue;//отделяем свои ордера. Магик задается в настройках

A strange method of "separating" one's positions from those of others, wouldn't it be better to

      if (OrderSymbol()=Symbol() && OrderMagicNumber()=Magic) отделяем свои ордера. Магик задается в настройках
        {сюда пересчёт рыночных позиций и отложек}