Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1713

 
Alexey Viktorov opening time from the previous one. I activate it via bool. Please!
Документация по MQL5: Константы, перечисления и структуры / Торговые константы / Свойства позиций
Документация по MQL5: Константы, перечисления и структуры / Торговые константы / Свойства позиций
  • www.mql5.com
Свойства позиций - Торговые константы - Константы, перечисления и структуры - Справочник MQL5 - Справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
Alexey Viktorov #:

What the hell.........

How does this help?
 
Порт-моне тв #:

Replace this piece of code

   if(sb1 + sb1/100*LotRisk*(DayMultiplicatorProfit/100/2) > AccountBalance()  && TimeCurrent()>TimeCheck_a && TimeCurrent()<TimeCheck_ac && Ogranichitel > 0)
     {

      if(OrderOfSymbol<1)
         if(signal=="buy")
            if(Close[1]>Open[1])
              {
               ticket = OrderSend(Symbol(),OP_BUY, Lot, Ask, 3, SLbuy, TPbuy, "открыт ордер на покупку", Magic, 0, Green);
               Print("OpenOrderSuccess");
              }


      if(OrderOfSymbol<1)
         if(signal=="sell")
            if(Close[1]>Open[1])
              {
               ticket = OrderSend(Symbol(),OP_SELL, Lot, Bid, 3, SLsell, TPsell, "открыт ордер на продажу", Magic, 0, Red);
               Print("OpenOrderSuccess");
              }

     }

replace it with this one.

   if(sb1 + sb1/100*LotRisk*(DayMultiplicatorProfit/100/2) > AccountBalance()  && TimeCurrent()>TimeCheck_a && TimeCurrent()<TimeCheck_ac && Ogranichitel > 0)
     {
      if(CountOrders()==0)
        {
         if(signal=="buy"&&Close[1]>Open[1])
           {
            if(OrderSend(Symbol(),OP_BUY, Lot, Ask, 3, SLbuy, TPbuy, "открыт ордер на покупку", Magic, 0, Green))
              {Print("OpenOrderSuccess");}
           }
         if(signal=="sell"&&Close[1]>Open[1])
           {
            if(OrderSend(Symbol(),OP_SELL, Lot, Bid, 3, SLsell, TPsell, "открыт ордер на продажу", Magic, 0, Red))
              {Print("OpenOrderSuccess");}
           }
        }
     }

At the end of all code, add this

//+------------------------------------------------------------------+
//| Подсчет открытых ордеров                                         |
//+------------------------------------------------------------------+
int CountOrders() 
  {
   int cnt=0;
   int i=OrdersTotal()-1;
   for(int pos=i;pos>=0;pos--)
     {
      if(OrderSelect(pos, SELECT_BY_POS, MODE_TRADES))
        {
         if(OrderSymbol()==_Symbol) cnt++;
        }
     }
   return(cnt);
  }
 
MakarFX open time from the previous one. I activate it via bool

I'm willing to pay $5!

Документация по MQL5: Константы, перечисления и структуры / Торговые константы / Свойства позиций
Документация по MQL5: Константы, перечисления и структуры / Торговые константы / Свойства позиций
  • www.mql5.com
Свойства позиций - Торговые константы - Константы, перечисления и структуры - Справочник MQL5 - Справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
Порт-моне тв opening time from the previous one. I will activate it via bool

I'm willing to pay $5!

It won't break anything...try it
 
MakarFX #:
It won't break anything...try it

I've got

OrderOfSymbol<1)

a lot of them!


OrderOfSymbol<2 && OrderOfSymbol> 0
OrderOfSymbol<3 && OrderOfSymbol> 1

Martins. It's giving me whole blocks. It's a fucking theatre.

Once again I ask you, I needthe function to delete an order at the same lot, price andtime of opening from the previous one. I activate it with a bool.

I'm willing to pay $5! I ask you to bring me pilaf and you bring me dumplings.

Документация по MQL5: Константы, перечисления и структуры / Торговые константы / Свойства позиций
Документация по MQL5: Константы, перечисления и структуры / Торговые константы / Свойства позиций
  • www.mql5.com
Свойства позиций - Торговые константы - Константы, перечисления и структуры - Справочник MQL5 - Справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
MakarFX #:
And how would that help?
This is the answer to

Forum on trading, automated trading systems & strategy testing

Any questions from newbies on MQL4 and MQL5, help and discussion on algorithms and codes

MakarFX, 2021.11.03 12:20

Please tell me how to get the value

TerminalInfoString(TERMINAL_LANGUAGE)

before running OnInit()?

Maybe there is another way to get the interface language before running OnInit() .


Everything works BEFORE running OnInit() without any problems. Or should the same thing be repeated in the EA and shown?
 
Alexey Viktorov #:
This is the answer to

Everything works BEFORE running OnInit() without any problems. Or do you need to repeat the same thing in the EA and show it?
If you don't mind, show it in the EA... It didn't work for me(
 
Порт-моне тв #:

... You know how to piss people off. ...

Then take a tincture of motherwort or a tincture of flyswatter and get some rest. Perhaps tomorrow you will realize that you do not need to delete the erroneous warrants, but find the cause of double-crossing.

 
Alexey Viktorov #:

Then take a tincture of motherwort or a tincture of flyswatter and get some rest. Perhaps tomorrow you will realise that you don't need to delete the erroneous orders, but rather find the cause of the overlap.

I recently traded hands, I got a reversal popping up in the terminal just without an EA. So it was a year ago, the reason is not the robot but the crooked terminal. Fucking hell.

Reason: