Avalanche - page 466

 
And this is a real insta center I do not understand why my lot after 6.40 was 102.40 at night I forgot to turn off the EA in the morning was lost
 
baykanur:
And this is a real insta-center I do not understand why my lot after 6.40 was 102.40 at night I forgot to turn off the EA in the morning drained
You have to look at the code to find out the reason.
 
baykanur:
And this is a real insta center I do not understand why I have a lot after 6.40 was 102.40 at night I forgot to turn off the EA in the morning plum

I got a bad feeling about it. You can put a time limit on trade in the code. You can put a limit on the trading time that would not be such a crash. This is the easiest, in my opinion. One line of conditions + extern int, if only by hours to do the restriction.
 
Cmu4:

That's a shame. You can put a time limit on trade in the code. You may put a time limit in the code so that there would be no such cracks. This is the easiest, in my opinion. One line of the condition + extern int, if only by hours we do the limitation.


There is an error in the algorithm (in the code) calculating the next lot. What does time limit have to do with it - it could appear at any time... I don't know how it is - in my version of Avalanche - after optimizing the parameters - by time it turned out that the "start" - at 0 o'clock, "end" - at 23 hours, ie, work around the clock ... And indeed, there are interesting movements on the Eurobucks during the night... and the flat can also go up and down during the day... a different approach is needed... (see posts above)... I think the limitation (in this case (with Avalanche)) of owl's work by time is inappropriate... IMHO, of course.

P.S. In the screenshot above after 6.4 the volume should be 12.8, not 102.4 lots... - This is an error in the program.

 
Cmu4:

It is a shame. You may put a time limit on trading in the code. This would not allow for such problems. This is the easiest, in my opinion. One line of conditions + extern int, if only by hours to do the restriction.

For me it works best with avalanche 7 but with different brokerage companies it is totally different if they have execution delays like insta begins to malfunction even with the same corridors and with different results

i have a good working day at nord, it's working like clockwork

 
baykanur:

I don't know why I should dosomething with the restriction, otherwise my deposit will be ruined...

"The avalanche 7 is the best way for me to use avalanche and I don't understand why I lost a lot after 6.40 but I forgot to switch the EA off in the morning..." If you're using "initial" data, this increase in volume of next order and limitation of work by time - are things not related to each other in any way...

Avalanche 7 - is this the option you have in mind?

//+------------------------------------------------------------------+
//|                                                  avalanche 7.mq4 |
//|                                                 George Tischenko |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "George Tischenko"

extern bool Monitor=true; //в тестере при выключенной визуализации отключать (тормозит)
extern int Distance=25,   //расстояние в пунктах от цены до первого открытия позиции
           MinProfit=5,   //минимальный профит в пунктах, если открытых ордеров более 1
           Slippage=3;
extern double Lot=0.1;

int Trade=0;
double BLot,StartPrice;              
//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
  StartPrice=Bid;
  BLot=MarketInfo(Symbol(),15);      // MODE_LOTSIZE размер контракта в базовой валюте инструмента
//----
  if(Monitor==true)
    {
    int a,y;
    for(a=0,y=5;a<=3;a++)
      {
      string N=DoubleToStr(a,0);
  
      ObjectCreate(N,OBJ_LABEL,0,0,0,0,0);
      ObjectSet(N,OBJPROP_CORNER,3);
      ObjectSet(N,OBJPROP_XDISTANCE,5);
      ObjectSet(N,OBJPROP_YDISTANCE,y);
      y+=20;
      }  
    }
//----
  return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
  if(Monitor==true)
    {
    for(int a=0;a<=3;a++)
      {
      string N=DoubleToStr(a,0);
      ObjectDelete(N);
      } 
    }
//----
  return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
  int i;
//---- 
  if(OrdersTotal()==0)
    {
    RefreshRates();
    if((Ask-StartPrice>=Distance*Point && Trade==0) || Trade==1) 
      {
      OrderSend(Symbol(),OP_BUY,Lot,Ask,Slippage,0,0,"",1307,0,Blue);
      }
    if((StartPrice-Bid>=Distance*Point && Trade==0) || Trade==-1)  
      {
      OrderSend(Symbol(),OP_SELL,Lot,Bid,Slippage,0,0,"",1307,0,Red);
      }
    }
  else //OrdersTotal()>0
    {//узнаем размер максимального лота, тип и цену открытия последнего активного ордера
    double lots=0, Type=-1, OpenPrice=0;
    for(i=0;i<OrdersTotal();i++)
      {//самый последний ордер имеет самый большой объем
      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)
        {
        if(OrderSymbol()==Symbol())
          {
          if(lots<OrderLots())
            {
            lots=OrderLots();
            Type=OrderType();
            OpenPrice=OrderOpenPrice();
            }
          }
        }
      }
      
     //возможно, ордера надо закрыть - проверим это:
    int C=0; //флаг закрытия всех позиций
    if(OrdersTotal()==1) //ЭТО ДЛЯ ПАР ТИПА XXX/USD
      {
      if(AccountProfit()>=BLot*Lot*Point*Distance) 
        {
        switch(Type)
          {
          case 0 : Trade=1; break;
          case 1 : Trade=-1;
          }
        C=1;
        }
      }
    else //OrdersTotal()>1
      {//лишь бы без убытка...
      if(AccountProfit()>=BLot*Lot*Point*MinProfit)
        {
        switch(Type)
          {
          case 0 : Trade=1; break;
          case 1 : Trade=-1;
          }
        C=1;
        }
      }
     
    switch(C)
      {
      case 0 : //закрываться рановато...
        {
        lots*=2; //опять Мартин :-(
        RefreshRates();
        switch(Type)
          {
          case 0 :
            {
            if(OpenPrice-Bid>=Point*Distance*2) 
              {if(OrderSend(Symbol(),OP_SELL,lots,Bid,Slippage,0,0,"",1307,0,Red)>0) return(0);}
            break;
            }
          case 1 :
            {
            if(Ask-OpenPrice>=Point*Distance*2)
              {if(OrderSend(Symbol(),OP_BUY,lots,Ask,Slippage,0,0,"",1307,0,Blue)>0) return(0);}
            }
          }
        break;
        }
      case 1 : //закрываем все позиции
        {
        while(OrdersTotal()>0)
          {
          int ticket_buy=0,  //тикет ордера BUY (не может быть=0)
              ticket_sell=0; //тикет ордера SELL (не может быть=0)
          for(i=0;i<OrdersTotal();i++)
            {
            if(OrderSelect(i,SELECT_BY_POS)==true)
              {
              if(OrderSymbol()==Symbol())
                {
                switch(OrderType())
                  {
                  case 0 : ticket_buy=OrderTicket(); break;
                  case 1 : ticket_sell=OrderTicket();
                  }
                }
              }
            }
          //проверка тикетов на некорректность:  
          bool OCB=ticket_buy>0 && ticket_sell>0;
          if(OCB) OrderCloseBy(ticket_buy,ticket_sell,White); // Цикл закрытия
          else
            {//закрываем оставшиеся одиночные ордера
            for(i=0;i<OrdersTotal();i++) //если total==0, цикл просто не сработает
              {//закрываем оставшиеся ордера
              if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)
                {
                if(OrderSymbol()==Symbol())
                  {
                  RefreshRates();
                  switch(OrderType())
                    {
                    case 0 : 
                      {
                      while(!OrderClose(OrderTicket(),OrderLots(),Bid,Slippage,White)) 
                        {
                        Sleep(10000);
                        RefreshRates();
                        } 
                      break;
                      }
                    case 1 : 
                      {
                      while(!OrderClose(OrderTicket(),OrderLots(),Ask,Slippage,White)) 
                        {
                        Sleep(10000);
                        RefreshRates();
                        } 
                      }
                    }
                  }
                }
              }
            }
          }//end while 
        }
      }
    } 
//==== БЛОК МОНИТОРИНГА
  if(Monitor==true)
    {
    string str="Balance: "+DoubleToStr(AccountBalance(),2)+" $";
    ObjectSetText("0",str,10,"Arial Black",White);
    
    str="Profit: "+DoubleToStr(AccountProfit(),2)+" $";
    ObjectSetText("1",str,10,"Arial Black",Silver);
    
    str="Free Margine: "+DoubleToStr(AccountFreeMargin(),2)+" $";
    ObjectSetText("2",str,10,"Arial Black",Yellow);
    
    str="OrdersTotal: "+DoubleToStr(OrdersTotal(),0);
    ObjectSetText("3",str,10,"Arial Black",Aqua);
    }
//----
  return(0);
  }
//+------------------------------------------------------------------+

 
baykanur:

my avalanche 7 works best...

This option?

 
Roman.:

"And this is a real insta cent I do not understand why my lot after 6.40 was 102.40 at night I forgot to turn off the Expert Advisor in the morning wasted" - based on "initial" your data "such " increase in volume of the next order and limitation of the Oven by time - are things not related to each other in any way ...

Avalanche 7 - is it this variant you are referring to?

For me it is 5 and the timeframe is m1.

for sure it has nothing to do with time limit - it should be found by lot although I am not sure if DT has nothing to do with it because this avalanche effect has worked on other accounts

accounts and they doubled in a week

Here's the report for the evening

 

What a theme. Brainwashing.

Hello, everyone.

 
baykanur:

Yes, this variant is the only difference in Distance at me is now 5 and the period of m1 and the errors appear in the delayed execution of DT and at the expense of the time limit

I think it has nothing to do with time limit - it's time to find an error in the lot although I am not sure if it has nothing to do with the dealers.

accounts and they doubled in a week

Here's the report for the evening


I had a similar case. The brokerage house opened a lot bigger than the maximum. I don't trade on that brokerage house anymore.

I don't think we have found the error in the programme, although I have an idea what was wrong (orders were recalculated several times due to delays and lot got very big) - brokerage company was greedy for money.