Modifying Associated Orders (GAIN Only)


After placing associated orders, users can modify these orders the ModifyOrderAssoc() function. Assocated orders are typically STOP or PROFIT TARGET orders that are placed and "associated" to an original entry order. This function includes parameters that allow you to configure/modify the order price and type.  This function will return a valid (positive #) order ID is successful or an error code (negative #) if the order was rejected.


MTS developers are not limited to placing single orders.  Developers can place multiple orders into MTS without any difficulties.  Remember to use GetOrderStatus() , GetFillAmount() and GetFillPrice() to check the order status and other variables..


For example, let's say we wanted to execute the following order structure..


Buy Signal = MARKET entry order

      20 pip fixed stop

      50 pip fixed profit target


This complex order would be accomplished by


  A.  Placing the inititial BUY MARKET order (with PlaceOrder() ), then

    A1. using GetOrderStatus() to wait for a "FILLED" status, then

    A2. using GetFillAmount() and GetFillPrice() to determine the # of shares and actual order price, then

  B.  Place the 20 pip stop order (with PlaceOrderAssoc() ), then

  C.  Place the 50 pip profit target order (with PlaceOrderAssoc() ).


At this point, our system has effectively place a complex order structure.  Now, we have to fall back onto GetOrderStatus() to check the status of our stop and profit target orders.