Stock market. Stocks. Speed of trade order execution. - page 3

prostotrader
10736
prostotrader  

I checked execution and fill orders on the stock section of MT-5 and it turns out that it is not possible to use

market order and fill IOC.

Which fill type should I choose so that the limit order is triggered as a market order?

JRandomTrader
1065
JRandomTrader  
prostotrader #:

I checked execution and fill orders on the stock section of MT-5 and it turns out that it is not possible to use

market order and fill IOC.

What type of fill should I choose so that a limit order triggers as a market order?

RETURN should work. The price should be close to the bar in order to be sure it will be executed and will not hang. This will practically work as a market order.

prostotrader
10736
prostotrader  
JRandomTrader #:

RETURN should work anyway. And to make sure that it will perform and not hang around, the price should be close to the bar. Practically, it will be the market price.

I do so in my application for Quick (trans2quik.dll does not fill FOK), but sometimes there is a problem, when prices of shares move abruptly,

it still stays standing in the cup.

I'm now moving my application to MT-5, linking the 2 terminals with a named channel.

There is still some complexity in MT-5 as the Expert Advisor for the stock market is a Pipe Server.

OnTrade and OnTradeTransaction is not possible.

On the one hand, a RETURN fill is much more likely to be executed, but still, the order may not be immediately

On the other hand, if we execute a FOK,

On the other hand, if we execute a FOK, we may get a situation where we always run out of volume to execute.

I wonder what would be the best course of action?

JRandomTrader
1065
JRandomTrader  
prostotrader #:

I do so in the Quick application (no FOK fill in trans2quik.dll), but sometimes there is a problem, when stock prices move sharply,

it still stays standing in the cup.

I'm now moving my application to MT-5, linking the 2 terminals with a named channel.

There is still some complexity in MT-5 as the Expert Advisor for the stock market is a Pipe Server.

OnTrade and OnTradeTransaction is not possible.

On the one hand, a RETURN fill is much more likely to be executed, but still, the order may not be immediately

On the other hand, if we execute a FOK,

On the other hand, if we execute a FOK, we may get a situation where we always run out of volume to execute.

I wonder what would be the best course of action?

We mean the situation when the order does not have enough liquidity up to the bar?

We can try to watch it even using the timer and remove it if it is ORDER_STATE_PARTIAL and the price is on the bar.

Or maybe watch SYMBOL_SESSION_*_ORDERS_VOLUME

Andrey Miguzov
2532
Andrey Miguzov  
prostotrader #:

Currently moving my application to MT-5, linking 2 terminals with a named channel.

Hello!

Can you tell me please (if it's not a secret) why you don't consider trading with another broker? Where there is a single brokerage account.

For your tradingAction-Futures, which you wrote about in other posts, turns out to be much more convenient, right? + would solve a lot of the associated problems of linking the two terminals.

My only options are execution delay and commission...

prostotrader
10736
prostotrader  
Andrey Miguzov #:

Hello!

Can you please tell me (if it's not a secret) why you are not considering trading with another broker? Where there is a single brokerage account.

For your tradeShare-Futures, which you wrote about in other posts, it turns out much more convenient, right? + would solve a lot of the associated problems of linking the two terminals.

I have only execution delay time and commission from the options...

I wrote that Quick works very slowly and MT-5 only in Otkritie and BCS, I don't consider Finam at all.

On the fund do not need a reserve of funds, and for futures, when scalping, not so much extra money to keep.

The goal is to make scalping on classic arbitrage with zero risk.

prostotrader
10736
prostotrader  
JRandomTrader #:

Are we talking about a situation where the order lacks liquidity up to the bar?

You can try to watch it even by timer, and if it is ORDER_STATE_PARTIAL and the price is on the bar, then shoot it.

Or maybe watch SYMBOL_SESSION_*_ORDERS_VOLUME.

You cannot use other functions on the Pipe server because the only implementation on

MT-5 (single thread) is to hang server EA in command standby mode, receive a lyser command, execute it,

and send result.

//+------------------------------------------------------------------+
//| Expert Listen Pipe channel function                              |
//+------------------------------------------------------------------+
void ListenPipe()
{
  bool result; 
  bool can_close = false;
  while((IsStopped() == false) && (lsn_exit == false))
  {
    result = Pipe.ReadData();
    if(result == true)
    {
      switch(Pipe.in_data.pipe_com)
      {
        case P_LSNR_EXIT:
          Pipe.out_data.pipe_com = P_DONE;
          can_close = true;
          result = false;
        break;
        case P_SET_MAGIC:
          Pipe.out_data.pipe_com = P_DONE;
          result = false;
        break;
        case P_SELL_SPOT:
          spot_ticket = SpotSetOrder(Pipe.in_data.spot_trade_lot, Pipe.in_data.spot_trade_price, spot_magic, SELL);
          if(spot_ticket > 0)
          {
            Pipe.out_data.pipe_com = CheckDeal(spot_ticket);
          }  
          else Pipe.out_data.pipe_com = P_REJECT;
          result = false;
        break;
        case P_BUY_SPOT:
          spot_ticket = SpotSetOrder(Pipe.in_data.spot_trade_lot, Pipe.in_data.spot_trade_price, spot_magic, BUY);
          if(spot_ticket > 0)
          {
            Pipe.out_data.pipe_com = CheckDeal(spot_ticket);   
          }  
          else Pipe.out_data.pipe_com = P_REJECT;
          result = false;
        break;
        case P_CHECK_DEAL:
          if(spot_ticket > 0)
          {
            Pipe.out_data.pipe_com = CheckDeal(spot_ticket);
          }
          else Pipe.out_data.pipe_com = P_ORDER_N_FOUND; 
          result = false;
        break;
        case P_GET_DATA:
          GetData();
          Pipe.out_data.pipe_com = P_DONE;
          result = false;
        break;
        case P_ORDER_REMOVE:
          if(SpotRomoveOrder(spot_ticket) == true)
          {
            Pipe.out_data.pipe_com = P_ORDER_REMOVE_DONE;
          }
          result = false;
        break;
      }
      if(result == false)
      {
        result = Pipe.WriteData(Pipe.out_data);
        if(result == true)
        {
          if(can_close == true) lsn_exit = true;
        }
      }
    }
    else Print("Error resived data!"); 
  }
  Print("Listener exit.");
}

result = Pipe.ReadData(); hangs server-advisor, waits for command from client.

All server management comes from the Expert Advisor-client

In this mode, communication between terminals is incredibly fast and the

structure with a set of ready data in both directions.

Dmitriy Skub
13792
prostotrader #:

In this mode, communication between terminals is incredibly fast, and the

structure with a set of ready data in both directions is transmitted at once.

Pipe is a superstructure on top of the shared memory, so (within the same PC) the exchange can be considered as having zero lag.

prostotrader
10736
prostotrader  
Dmitriy Skub #:

Pipe is an add-on to the shared memory and therefore (within the same PC) the exchange can be considered as having zero lag.

What I meant was that there is no need to communicate via your application.

Andrey Miguzov
2532
Andrey Miguzov  
prostotrader #:

I wrote that Quick is very slow and MT-5 is only at Otkritie and BCS, I don't consider Finam at all.

That's what I wrote about Finam. I'm going to open an account there just because of EBS.

It's a pity brokers cannot be discussed on the forum. I would be very grateful if you could write in your personal message why not to go there.

In any case, thanks for the information!