Errors, bugs, questions - page 2401

 
prostotrader:

Use this function

Then, simply add (subtract) whatPointsToPrice() returned to the price.

Added

If it doesn't work correctly, then by this symbol

is translatingSYMBOL_TRADE_TICK_SIZE

Pardon, but I don't understand what long points should be input, especially considering that this parameter can be either positive or negative.

 
Stanislav Korotky:

Okay, but I didn't understand what the long points were for input, especially since this parameter can be either positive or negative.

I just pulled the code from my EA

long points is how many points you want to increase (decrease) the price

 
prostotrader:

I just pulled the code from my EA

long points - how many points do you want to increase (decrease) the price

To buy on ask - ceil, to sell on bid - floor? I want to open on the market.

 
fxsaber:

So it's the server's crooked hands, which the Tester can't straighten right now. At the same time, everything will open in Terminal, as TickSize is not accounted for there.

Is there a workaround for the tester now? Specify ticksize in bot input parameters?

 
Stanislav Korotky:

For bid-ask purchases - ceil, for bid-ask sales - floor? I want to open on the market.

For market, just send the order without the price.

Request.action = TRADE_ACTION_DEAL;

And consequently Buy or Sell.

request.type = ORDER_TYPE_BUY;

request.type = ORDER_TYPE_SELL;

 
prostotrader:

By market, simply send an order without price.

request.action = TRADE_ACTION_DEAL;

And respectively Buy or Sell

request.type = ORDER_TYPE_BUY;

request.type = ORDER_TYPE_SELL;

In this bot, it works through MT4Orders.

I have now tried zero in price. The library sends the correct types of course. The error remains the same.

 
Stanislav Korotky:

In this bot - through MT4Orders goes to work.

I have now tried zero in price. The library sends the correct types of course. The error remains the same.

Well, then to you to fxsaber.

Did you try to open the market using your hands?

Tried it myself

The server is not working properly.


 
Stanislav Korotky:

In this bot - through MT4Orders goes to work.

I have now tried zero in price. The library sends the correct types of course. The error remains the same.

#include <MT4Orders.mqh>

#define Ask SymbolInfoDouble(_Symbol, SYMBOL_ASK)

void OnTick()
{
  if ((int)Ask != Ask) // Дождались дробной цены
  {
    Print(OrderSend(_Symbol, OP_BUY, 1, Ask, 100, 0, 0)); // Тестер не даст сделать BUY по Ask - ошибка TickSize-настроек.
    Print(OrderSend(_Symbol, OP_BUY, 1, 0, 100, 0, 0));   // 0 - прокатит, т.к. настройки символа для маркет-ордеров позволяют.
    
    ExpertRemove();
  }
}
MT4Orders has no effect on trade request settings. What the user has written, that is what is sent. Everything is the same as with MT5-OrderSend.
2018.12.03 00:56:01   failed market buy 1.00 NI225 [Invalid price]
2018.12.03 00:56:01   -1
2018.12.03 00:56:01   market buy 1.00 NI225 (22489.84 / 22722.15)
2018.12.03 00:56:01   deal #2  buy 1.00 NI225 at 22722.15 done (based on order #2)
2018.12.03 00:56:01   deal performed [#2  buy 1.00 NI225 at 22722.15]
2018.12.03 00:56:01   order performed buy 1.00 at 22722.15 [#2  buy 1.00 NI225 at 22722.15]
2018.12.03 00:56:01   2
2018.12.03 00:56:01   ExpertRemove() function called
 
fxsaber:
MT4Orders has no effect on trade request settings. What the user has written, that's what is sent. It's the same as with MT5-OrderSend.

Does MT4Orders work with history?

 
Vladislav Andruschenko:

Does MT4Orders work with history?

Yes.

Reason: