Errors, bugs, questions - page 2400

 
Slava:

If OnTimer is not looped, there should be no Abnormal termination.

Can you give your expert to check the behaviour of the client terminal?

There's a lot of rubbish there, the code is not optimal and is built on the basis of 7000 lines template. I'll try to figure it out myself and let you know. This is a builder of graphical objects by the way, it's not trade.

Thank you!

 
Vitaly Muzichenko:

It's a builder, by the way, he's not a tradesman.

Got it. Removal of graphical objects in OnDeinit().

This has already been fixed

 
Slava:

Got it. Removal of graphical objects in OnDeinit().

It's already fixed.

Can you tell me when there will be a new build with fixes?

 
uint lev[1] = {};
ArrayInitialize(lev, UINT_MAX);  // warring: truncation of constant value
Alert(lev[0] == UINT_MAX);       // Alert: true
 

I had to create a new page in MQL5 to register the signal, but it is not enabled

https://www.mql5.com/ru/signals/new

 

Can you tell me how to correctly form the price for Nikkei CFD orders (other CFDs are opened by the bot).

Let's say we have ask 19661.15, ticksize = 1.

We need to round it but in what direction? For example, the codeMathRound (price / tickSize) * tickSize; gives price 19661, i.e. better than the market. This gives an error.

Adding one tickSize from above also gives an error.

If I try to send ask as it is, same error.

The tester writes in logs:

failed market buy 1.00 NI225 [Invalid price] // стандартный вывод
OrderSend failed NI225 0 1.0 19662.0 0.0 0.0 with error 4756 // бот выводит параметры ордера и код ошибки
 
Stanislav Korotky:

What kind of server with these settings?

 
fxsaber:

What is the server with these settings?

LiteForexInvestments-MT5.com


 
Stanislav Korotky:

Can you tell me how to correctly form the price for Nikkei CFD orders (other CFDs are opened by the bot).

Let's say we have ask 19661.15, ticksize = 1.

We need to round it but in what direction? For example, the codeMathRound(price / tickSize) * tickSize; gives price 19661, i.e. better than the market. This gives an error.

Adding one tickSize from above also gives an error.

If I try to send ask as it is, same error.

In logs tester says:

Use this function (transfers points to instrument price).

//+------------------------------------------------------------------+
//| Expert Points to price function                                  |
//+------------------------------------------------------------------+
double PointsToPrice(const long a_points)
{
  double step_price = SymbolInfoDouble(Symbol(), SYMBOL_TRADE_TICK_SIZE);
  double a_price = (double(a_points) * Point() ) / step_price;
  if(a_points < 0)
  {
    a_price = MathFloor(a_price) * step_price;
  }
  else
  {
    a_price = MathCeil(a_price) * step_price;
  }
  return(NormalizeDouble(a_price, Digits()));
}

Then, you just add (subtract) what thePointsToPrice() function returned to the price

Added by

If it doesn't work correctly, then this symbol

is translated bySYMBOL_TRADE_TICK_SIZE

 
Stanislav Korotky:

LiteForexInvestments-MT5.com

So it's the server's crooked hands, which the Tester is unable to straighten now. At the same time in Terminal everything will open, as TickSize is not taken into account there.