Dissecting the Nest Plus Auto Trading API

yusi

Well-Known Member
#1
While the Nest auto trading api has been available for some time, it really came to attention with GDFL launching their AmiBroker Trading Plugin in August / Sep 2012. So it can be imagined that the API was ready at least 3 month prior to that; though the rumblings find mention much earlier in 2012, for example by GTji.

At that time of the GDFL launch, the Nest Plus version was at 1.3

The API was tied up with Nest Trader earlier, and not available with NOW. With Zerodha offering Nest / Zerodha Trader to users, and Omnesys offering the Starter Pack free within Nest Plus, it was easier for most of us to take a closer look at it.

I first took a look at it in Oct 2012. Thought of putting in a 6 month subscription and deposited the money. Unfortunately, the cost at the Omneysys site was higher than that mentioned in Plus plugin (see image below), and also missed the 11+% tax. When trying to put in more money, both the payment gateways were timing out, and settled for a one month subscription. Lucky me. For there was nothing much to say beyond two posts.

One of these days, I will try to get my subscription money back on the ground of false claims about the product. Against me will be the fact that Omneysys never made any substantial technical claims. (On the other hand, maybe, one should let it pass -- they have been good enough to provide the free Starter Pack; and God knows that I've overused it.) In fact, it is the very absence of saying anything that got a request for documentation recently.

The aim to this thread is a) add to this new forum section in TJ, and b) take a deeper look at the auto-trading API in Plus.

 

yusi

Well-Known Member
#2
1. The Nest Plus installation file

The current download of Plus is either NestPlus_1.5.1.0.msi for Nest Trader, or NestPlus_2.5.1.0.msi for NOW. A look at these files.

As they are .msi files, a convenient way to view the contents of such files is via the funkily names Less Msierables. This is what it shows for the 1.5.x download:




If you ever happen to be stuck about installing/upgrading Plus, use the utility to extract the files (or google a command prompt equivalent). Those files in the SourceDir go to the Nest/Now installation folder, those in SourceDir/Nest Plugins go to the subfolder. You would have msiexec installed anyway. This is particularly handly if you have both Nest and NOW where installing for one nulls the other, and/or its late in the day ( the helpdesk at Omnesys only maintains regular hours ;) ). Has worked for me.
 

yusi

Well-Known Member
#3
1. The Nest Plus installation file ... 2

Taking a look at the files installed...

Read me.txt / Readme.rtf has late-breaking info. Relevant to auto trading, this is :

Code:
Nest Plus Version: 1.5.1.0 Build 2900
-------------------------------------------------------------------------------------------------------------------------------------------------------
New Features:
------------------------
* Market & SL_M order types removed for pulse & plus api orders
* MCX, MCXSX pulse, plus api Auto placement orders are allowed on exchange approval.

Issue Resolved :
------------------------
[19312] Plus trading plugin popup should be same as Pulse (ACT on Alert /Ignore).

Of files that go into the SourceDir, atl71.dll and libcurl.dll are standard libraries. PrimeCore.dll is interesting as it indicates that AMQP is the underlying transport protocol. PlusExcel.dll is confusing -- what additional Excel functionality exists in Plus that is not used in Nest/Now? The functionality of the rest of the files is obvious from their names.

Of files that go into the Nest Plugins subdirectory, the largest is NestPlus.nap and no prizes for guessing that it is the main file of Plus. What is surprising, however, is that the extension is .nap. Obfuscation? It is a standard .dll file with regular headers (details, if interested). There has been some cleaning up from prior versions -- for example, the banner graphic for the trading plugin has been removed.

[[An aside: anybody encountered the place where a Twitter integration applies? See dialogue ]]


There is little difference between the contents of the install files of 1.5 and 2.5. Both the readmes are ditto except for the version numbers. While most of the files are the same, PrimeCore, PlusExcel, NestPlus, and OptionStrategy show different sizes. The internals look similar, and the guess is that maybe a compilation flag, string or date differs, and not much else. Why have two branches ... time will tell.
 

yusi

Well-Known Member
#4
2. Exposed COM/OLE interfaces

When Nest or NOW is installed, it exposes two COM / OLE interfaces. These interfaces allow an extenal program to interact with them. COM / OLE is fairly common and allows an external program to, say, create a Word document in Office, or, nearer home, for AmiBroker to be externally manipulated.

Two COM classes are available: ScripRTD and Plusapi.

ScripRTD (RTD = real time data) enables passing topics and values from one application to another. For illustration, the functions exposed by ScripRTD are:
  • ServerStart
  • ConnectData
  • RefreshData
  • DisconnectData
  • Heartbeat
  • ServerTerminate
There are some others, but this is a Microsoft designed interface and well documented. Excel is the best (only well-known?) client for this server interface, and many would be more familiar with the RTD mechanism in action through the excellent work of josh1 and sudris her in TJ.
 

yusi

Well-Known Member
#5
2. Exposed COM/OLE interfaces ... [2]

Plusapi exposes functionality related to auto trading:
  • PlaceOrder
  • ModifyOrder
  • CancelOrder
  • SetObjectName
  • GetOrderStatus
These five are what is available if you have installed Nest 3.10 or the current Zerodha Trader. NOW 1.8 exposes one more:
  • GetPlusVersion
A thing to note is that while a Nest Plus version may have the functionality built-in, the underlying must support it. GetPlusVersion has been available since Nest Plus 1.4, yet not available till NOW was upgraded. We can expect the next version of Nest to support it.

Nest has one more interface class: NestBridge, whose application is unclear. It is not available in the latest NOW, so one can presume that it will be discontinued.
 

mastermind007

Well-Known Member
#6
Re: 2. Exposed COM/OLE interfaces ... [2]

Plusapi exposes functionality related to auto trading:
  • PlaceOrder
  • ModifyOrder
  • CancelOrder
  • SetObjectName
  • GetOrderStatus
These five are what is available if you have installed Nest 3.10 or the current Zerodha Trader. NOW 1.8 exposes one more:
These 5 are not enough. You also need to be able to query whether or not a particular scrip was already ordered, if ordered, its status. amount of money available and so on...

Best thing to do is to study Interactive Broker's API. It is complete and everything they have must have a counter-part in another API. Names can change, functionality must exist
 

yusi

Well-Known Member
#7
Re: 2. Exposed COM/OLE interfaces ... [2]

These 5 are not enough. You also need to be able to query whether or not a particular scrip was already ordered, if ordered, its status. amount of money available and so on...

Best thing to do is to study Interactive Broker's API. It is complete and everything they have must have a counter-part in another API. Names can change, functionality must exist
Certainly, one can study the IB API. I hope that somebody takes up the mantle to do so, and presents it here. As you say, it is the current state of the art, but that person could also comment on what practitioners think are its shortcomings or expect additionally.

Perhaps you are aware that six months back, 3 of these 5 were practically non-functional. GDFL took the two that were available and saw the opportunity to launch a product. Whether you look at it as amazing marketing or its converse is upto you.

Also, certainly Omnesys knows this. Whether they will, in future, provide the money management functionality which is broker specific, and the holding functionality which is DP specific, or even the scrip specific functionality which is present in the scrip masters, remains to be seen.

Lots of opportunity here...
 

mastermind007

Well-Known Member
#8
Re: 2. Exposed COM/OLE interfaces ... [2]

Certainly, one can study the IB API. I hope that somebody takes up the mantle to do so, and presents it here. As you say, it is the current state of the art, but that person could also comment on what practitioners think are its shortcomings or expect additionally.

Perhaps you are aware that six months back, 3 of these 5 were practically non-functional. GDFL took the two that were available and saw the opportunity to launch a product. Whether you look at it as amazing marketing or its converse is upto you.

Also, certainly Omnesys knows this. Whether they will, in future, provide the money management functionality which is broker specific, and the holding functionality which is DP specific, or even the scrip specific functionality which is present in the scrip masters, remains to be seen.

Lots of opportunity here...

Yes.... I understand what you mean and I honestly did not mean to criticise anyone or praise anyone. IB with its price tag of few thousand dollars is not where I'd attempt automation even if I had money lying around.

Nevertheless, the functionality that I've mentioned is bare minimal. You cannot create any automated strategy using just ability to place orders. NSE ticks come in fast,thick and heavy (at peak, you can get close to 4 ticks per scrip per second) and you need to be able to know where you stand. If you cannot know status of existing orders, you cannot automatically send a TP or SL order. You can only create a signalling software!!!!
 

yusi

Well-Known Member
#9
Re: 2. Exposed COM/OLE interfaces ... [2]

Nevertheless, the functionality that I've mentioned is bare minimal. You cannot create any automated strategy using just ability to place orders. NSE ticks come in fast,thick and heavy (at peak, you can get close to 4 ticks per scrip per second) and you need to be able to know where you stand. If you cannot know status of existing orders, you cannot automatically send a TP or SL order. You can only create a signalling software!!!!
Anybody who even partially agrees with you, and has subscribed, may want to try to get subscription money back on the ground of false claims about the product. Maybe, other folks (who have not) will want some on the grounds that their auto-trading API is short-changing the current practice.

But, to be fair, when did Omnesys ever claim anything? It was we who saw a rainbow and ran to get the proverbial pot of gold at the end of it.

A signalling software!!! ... read their banner writeup carefully; they say nothing different
Nest Plus API is an interface that allows you to trade based on signals generated from charting applications like AmiBroker ...
 
Last edited:

Algo

Active Member
#10
Re: 2. Exposed COM/OLE interfaces ... [2]

Yes.... I understand what you mean and I honestly did not mean to criticise anyone or praise anyone. IB with its price tag of few thousand dollars is not where I'd attempt automation even if I had money lying around.

Nevertheless, the functionality that I've mentioned is bare minimal. You cannot create any automated strategy using just ability to place orders. NSE ticks come in fast,thick and heavy (at peak, you can get close to 4 ticks per scrip per second) and you need to be able to know where you stand. If you cannot know status of existing orders, you cannot automatically send a TP or SL order. You can only create a signalling software!!!!
Well..i have never seen someone earn profit just by auto sending buy sell orders..if you are you might have just found the holy grail..
 

Similar threads