Automated Trading With Matlab via Nest Plus API

Note: This article is outdated because Nest Plus API has been discontinued by most brokers

Automated Trading with Matlab via Nest Plus API is easily configurable because it is available from most brokers. The Nest Plus API maybe available on broker’s discretion for both individual retail traders and Authorized Persons.


Available API Funtions

Main Article: Nest Plus Auto Trading Tutorial

Automated Trading With Matlab

The following functions from Nest Plus API can be called in Matlab:

  • PlaceOrder(): Place an order in exchange with custom order type, quantity, limit price, trigger price etc.
  • ModifyOrder(): Modify a pending order with given reference number
  • CancelOrder(): Cancel a pending order with given reference number

The following sample code can be appended in Matlab for automated order placing:

plus = actxserver(‘Nest.PlusApi’)

plus.SetObjectName(‘Matlab Client’)




For individual traders, the Nest Plus API asks a confirmation prompt for placing the order with a pop-up window. For Authorized Persons of Broker (Sub-broker or Dealer) no such pop-up appears and orders are placed completely automatically.

The live execution of orders can be monitored by opening the Nest Pulse window in Nest Trader. Go to Nest Trader->Nest Plus menu->Nest Pulse Script->Pulse Running Script.


The Nest Plus API is a primitive API which dows not allows expose several important functions for smooth trading. For example, there is no  function to test broker connectivity, login to broker network, or chech Net Position in a scrip. For a more professional automated trading with matlab, users are advised to go with the .NET Nest Dll from Omnesys.


If we consider the following requirements posted by one of our user’s

  1. Fully automatic trading or user can manually approve all orders.
  2. Customise order type (i.e Buy, Sell or SL) with customized order quantity in each trigger.
  3. Automatic auto-login if broker connection goes offline and back online.
  4. Error check to report if broker goes offline.
  5. Handles any symbols from all data feeds.
  6. Fast and easy manual order entry.
  7. Positions in all symbols is updated automatically.
  8. Fast access allows user to Cancel All open orders with one trigger.
  9. Fast access allows user to flatten all positions with one trigger.
  10. Constant updates of order status: Filled, Cancelled, Placed or Partial filled. Thus, to ensure a minimum slippage.
  11. Automatic trailing stop loss when the order will be filled.
  12. All position should be squared off at a specified time ( user input).

Nest Plus API can be deployed with programming for all above requirements except 4, 7 and 12.