Questions from Beginners MQL5 MT5 MetaTrader 5 - page 300

 
sergeev:
invent your own exchange and write your own terminal for it
By the way, I know guys in Cyprus who do that.
 
sergeev:

Nazar, I can see you're not a trader.

Buy orders are executed on the ack.

You can see in the picture that the trade was successful and well above the prices on the chart. The gap is not there either. The price of the trade is outside the chart at all.


If I send the wrong order to the exchange, it simply will not be executed or passed in the market. I was just going through all possible price variants in the asc code to bypass the error, but it did not work. The transaction is not correct either way. I can't bypass 10 o'clock either, as it's the movement I need. Different timeframe doesn't solve the problem either.

 
mavar:

You can see in the picture there that the trade was successful and well above the prices on the chart. The gap is not there either. The price of the deal is outside the chart at all.


If I send the wrong order to the exchange, it simply will not execute or go through the market. And in the asc code I was just going through all possible price options to bypass the error, but it didn't work. The transaction is not correct either way. I can't bypass 10 o'clock either, as it's the movement I need. Different timeframe doesn't solve the problem either.

We buy at Ask and sell at Bid. At the moment, the Bid price is shown in your picture. The Ask price is equal to the Bid+Spread.
 
mavar:

You can see in the picture there that the trade was successful and well above the prices on the chart. The gap is not there either. The price of the deal is outside the chart at all.


If I send the wrong order to the exchange, it simply will not execute or go through the market. And in the asc code I was just going through all possible price options to bypass the error, but it didn't work. The transaction is not correct either way. I can't bypass 10 o'clock either, as it's the movement I need. Different timeframe doesn't solve the problem either.

Forgive me for the remark, but you should study the basics first - you've written nonsense (in the quoted). Why - do not ask.
 
Good afternoon!

Help an ignoramus ) In the tester no orders open error 10013 Wrong request, look at the code where the error is.

All the numbers in the journal are showing on the order and the order does not open.

2014.10.19 12:14:34.984 2014.02.03 00:06:00 failed request buy 0.10 at 102.31100 sl: 102.27200 tp: 102.33600 [Invalid request]

2014.10.19 12:22:17.928 2014.02.03 00:06:00 ticket =0 retcode =10013

MqlTradeRequest Req;
MqlTradeResult  Res;
   string TradeSmb;
   if(TradeSmb=="") TradeSmb=_Symbol;
   Req.action=TRADE_ACTION_DEAL;
   Req.symbol=TradeSmb;
   Req.volume=0.1;
   Req.type=ORDER_TYPE_BUY;
   Req.type_filling=ORDER_FILLING_IOC;
   Req.price = SymbolInfoDouble(_Symbol,SYMBOL_ASK);
   Req.sl= NormalizeDouble(sym_bid - (StopLoss*sym_point),sym_digits);
   Req.tp= NormalizeDouble(sym_ask + (TakeProfit*sym_point),sym_digits);
   Req.deviation=3;
   Req.comment="777";
if(OrderSend(Req,Res))
{
      Print("Sent...");
}
      Print("ticket =",Res.order,"   retcode =",Res.retcode);
      if(Res.order!=0)
     {
      datetime tm=TimeCurrent();
      //--- request all history
      HistorySelect(0,tm);
      string comment;
      bool result=HistoryOrderGetString(Res.order,ORDER_COMMENT,comment);
      if(result)
        {
         Print("ticket:",Res.order,"    Comment:",comment);
        }


 
PokrovMT5:

This makes the code look much clearer. If you insert the code correctly in your forum posts, your posts will be easier to read.Inserting the code correctly in the forum
 
alph:
Can you tell me please, is this tester figure realistic in life? And is it a good or bad result for a year with a deposit of $3000?
 
PokrovMT5:
Good afternoon!

Help an ignoramus ) In the tester no orders open error 10013 Wrong request, look at the code where the error is.

All the numbers in the journal are showing on the order and the order does not open.

2014.10.19 12:14:34.984 2014.02.03 00:06:00 failed request buy 0.10 at 102.31100 sl: 102.27200 tp: 102.33600 [Invalid request]

2014.10.19 12:22:17.928 2014.02.03 00:06:00 ticket =0 retcode =10013
https://www.mql5.com/ru/code/1574
Скрипты для открытия длинных позиций
Скрипты для открытия длинных позиций
  • votes: 27
  • 2013.03.06
  • Nikolay Kositsin
  • www.mql5.com
Данные скрипты предназначены для совершения покупок с фиксированными значениями стоп-лосса и тейк-профита в пунктах от текущей цены
 
If you meant ZeroMemory(), it didn't help. Can you tell me where the error is, it's hard for me to navigate on my own.

 
PokrovMT5:
If you meant ZeroMemory(), it didn't help. Can you tell me where the error is, it's still hard for me to navigate on my own.

to buy

   MqlTradeRequest request;
   MqlTradeCheckResult check;
   MqlTradeResult result;
   ZeroMemory(request);
   ZeroMemory(result);
   ZeroMemory(check);
   request.type   = ORDER_TYPE_BUY;
   request.price  = SymbolInfoDouble(Symbol(), SYMBOL_ASK);
   request.action = TRADE_ACTION_DEAL;
   request.symbol = Symbol();
   request.volume = 0.1;
   request.deviation=30;
   request.type_filling=ORDER_FILLING_FOK;
   //---- Открываем BUY позицию и делаем проверку результата торгового запроса
   if(!OrderSend(request,result) || result.retcode!=TRADE_RETCODE_DONE)
     {
      Print("Не удалось открыть Buy позицию по ",Symbol());
      return(result.retcode);
     }
   else
      Print("Buy позиция по ",Symbol()," открыта! ");
Reason: