FORTS SL and TP - page 6

 
ottenand:
So you want a sell-limit order in the cup to stand amongst the buy-limits?

No, he wants to prove once again that he's the only D'Artagnan here.
 
prostotrader:


No, in order to place an order in the market (and it will be there) you should use

request.type_filling=ORDER_FILLING_RETURN.

Added

Change ORDER_FILLING_IOC to ORDER_FILLING_RETURN (in my example)

and the price to SYMBOL_SESSION_PRICE_LIMIT_MAX

and you will see the order in the market

:) And what order type should be used?
 
Yury Kulikov:
:) What type of order should I use?

void SetSyncOrder(const bool deffered)
  {
   MqlTradeRequest request={0};
   MqlTradeResult  result={0};
   order_ticket=0;
   request.magic=Magic;
   request.symbol=Symbol();
   request.volume=1;
   if(deffered)
   {
     request.type_filling=ORDER_FILLING_RETURN;  //Отложенный ордер
   }
   else
   {
     request.type_filling=ORDER_FILLING_IOC;  //Рыночный ордер
   }  
   request.type_time=ORDER_TIME_DAY;
   request.action=TRADE_ACTION_PENDING;
   request.type=ORDER_TYPE_SELL_LIMIT;
   request.comment="";
   if(deffered)
   {
     request.price = SymbolInfoDouble(Symbol(),SYMBOL_SESSION_PRICE_LIMIT_MAX);
   }
   else
   {
     request.price = SymbolInfoDouble(Symbol(),SYMBOL_SESSION_PRICE_LIMIT_MIN);
   }  
   if(OrderSend(request,result))
     {
      if(result.retcode==TRADE_RETCODE_DONE)
        {
         order_ticket=result.order;
         if(OrderSelect(order_ticket))
           {
            ENUM_ORDER_STATE order_state=ENUM_ORDER_STATE(OrderGetInteger(ORDER_STATE));
            switch(order_state)
              {
               case ORDER_STATE_STARTED:
               case ORDER_STATE_REQUEST_ADD:
               case ORDER_STATE_REQUEST_MODIFY:
               case ORDER_STATE_REQUEST_CANCEL:
                  Print(__FUNCTION__,": Order is busy! State: ",EnumToString(order_state));
                  break;
               case ORDER_STATE_CANCELED:
               case ORDER_STATE_PARTIAL:
               case ORDER_STATE_FILLED:
               case ORDER_STATE_REJECTED:
               case ORDER_STATE_EXPIRED:
                  Print(__FUNCTION__,": Order not found.");
                  break;
               case ORDER_STATE_PLACED:
                 Print(__FUNCTION__,": Sync Order place done and found in terminal.");
               break;
              }
           }
        }
     }
   else {Print("Order not sent.");}
  }
Prices are given as an example
Files:
 
prostotrader:


I don't want anything.

Read the entire thread carefully.

Don't explain, they are trying to help you, try to absorb and understand. Only buy-limits can be below the current price on the exchange. Everything else below the price may be a stop order on the broker's server. That Sell Limit order was filled at the next close ask, which is the market price, because you cannot put what you cannot put in, i.e., you put your Sell Limit order in the Buy Line below the price in the Stack. If you want to sell below the price with a condition, put a sell stop on the broker's server.
 
ottenand:
Don't explain, they are trying to help you, try to get into it and figure it out. Only buy-limits can be below the current price on the exchange. Everything else below the price can be in the form of a stop order on the broker's server. That Sell Limit order was filled at the next close ask, which is the market price, because you cannot put what you cannot put in, i.e., you put your Sell Limit order in the Buy Line below the price in the Stack. If you want to sell below the price with a condition - put a sell stop on the server to the broker.

Then you don't have to explain it either...
 
prostotrader:
   request.type=ORDER_TYPE_SELL_LIMIT;

Why quote such a long text to a simple question, i.e. your answer: Sell Limit order type.

 
Yury Kulikov:

Why quote such a long text to a simple question, i.e. your answer: Sell Limit order type.


:)
 
Heh, well, it's up to you =)
 

Correct me if I'm wrong somewhere =)

 
Yury Kulikov:

Why quote such a long text to a simple question, i.e. your answer: Sell Limit order type.


Yuriy!

I gave the file (Plaza II specification)

Nowhere in the specification is there half a line about limit, market or pending order.

Orders in the exchange are accepted according to 4 main parameters

1. Price

2. Order direction (buy/sell)

3. Volume .

Type(in MQL).

This is what the developers have called a limit, market or pending order.

To correctly place orders we must understand how these orders will be perceived by the Exchange

according to the specification.

Added

For example, in order for the order to remain in the stack

in the SELL area

It is sufficient to set one of the prices from the sell zone

and request.type_filling=ORDER_FILLING_RETURN;

But if you set a price from the Buy zone, your order will be executed immediately.

That's why I have named the orders as "pending" to be more or less consistent with the market specification:

Pending - an order that "stands" in the market

Market - this order can be executed at any price.

Limit order - this order will be executed at the price specified in the order.

Reason: