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

 
MakarFX #:

Try

It's highlighted in yellow. Is that how it's supposed to be?

I didn't change anything. That's how the birds were turned. I don't understand. Do you want me to remove them, rotate them, or delete this line altogether?

 
Порт-моне тв #:

so I didn't change anything. That's how the birds were turned. I don't understand. Do you want me to remove them, rotate them, or delete this line altogether?

I asked about "birds" because the condition is the same for both buy and sell.

 
Порт-моне тв #:
you are still trying to find a bug, but I've been asking you for hours to do something else. Why so?

after a successful OrderSend, the OrderOfSymbol variable must be updated.
or exit and wait for the next tick.

 
MakarFX #:

I asked about "birds" because the condition is the same for both buy and sell.

Only buy or sell-sell, no sell-buy or buy-sell type of doubletake takes place.

 
Taras Slobodyanik #:

after a successful OrderSend, the OrderOfSymbol variable needs to be updated.
or exit and wait for the next tick.

ok, and how do you do that?

 
Порт-моне тв #:

Well, I can see from the history in the tester where the tailing happened, when, what parameters. What does that give you?

You do not need to look for where the tailing took place, but for what reason it took place. I was suggesting to print not the fact of opening, but the conditions of opening. This will help you determine the reason... Deleting such a duplicate order will only give you an additional loss.

 
Alexey Viktorov #:

You don't need to look for where the tailing is, but for what reason it is tailing. My suggestion was not to print the fact of opening, but the conditions of opening. This will help determine the reason... Removing such a duplicate order will only give you an extra loss.

Thanks, but I realised that last night.

 
MakarFX #:

Can you tell me how to get the value

before running OnInit()?

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

Vitaly Muzichenko #:

There is no way, only inside the Functions. InOnInit() or after it, but not before it.

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

string terminalLanguage = TerminalInfoString(TERMINAL_LANGUAGE);

/********************Script program start function*******************/
void OnStart()
 {
  Print(terminalLanguage);
 }/******************************************************************/
2021.11.03 16:25:08.033 00 EURJPY,M15: Russian
 
So I understand that no one here will write me a function to delete an order at the same lot, price and opening time as the previous one. Stubbornness is a sin, guys.
 
Порт-моне тв opening time as the previous one. Stubbornness is a sin, guys.

Check like this

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

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

     }
Reason: