Dissecting the Nest Plus Auto Trading API

Square

Active Member
:lol::lol::lol:

The brokers have made it increasingly difficult for retail to trade. There is no doubt they trade against retail and that Bigwigs have mentioned that at least 75% and approx 96% retail traders are in loss (on monthly basis).

They got the parameters changed and introduced monthly fixed charges for every piece of code.

e.g. If you need to make F1 work .. pay Rs 300.. if you need F1 and F2 then pay Rs 500 :clapping::clapping::clapping: .. and so on and so forth..

The api has introduced 3 additional parameters in the new version (making several older versions obsolete in a single stroke):

Sub PlaceOrder(bsTransType As String, bsUniqueRefNo As String, bsExchange As String, bsTradingSymbol As String, bsValidity As String, bsOrderType As String, lQty As Long, dPrice As Double, dTriggerPrice As Double, lDiscQty As Long, bsProductType As String, bsClientID As String, bsAlgoIdentifier As String, bsAlgoSeqNumber As String, bsVendorID As String)

The 3 newly intraduced parameters are:
bsAlgoIdentifier
bsAlgoSeqNumber
bsVendorID


In order to have the API enabled .. an additional Rs 300.

:rofl::rofl::rofl::rofl:
Am bit confused now. If I get Nest Plus API then I have to use it compulsorily or what. i.e. I then cannot use F1 /F2 to place order in NEST. Would using those key need additional charge of Rs. 300 or Rs. 500 for both you mentioned above. Pls clarify.
 

Raj232

Well-Known Member
Am bit confused now. If I get Nest Plus API then I have to use it compulsorily or what. i.e. I then cannot use F1 /F2 to place order in NEST. Would using those key need additional charge of Rs. 300 or Rs. 500 for both you mentioned above. Pls clarify.
Hey Square:
Thats just an example of what has ben going on. e.g. Using your own keyboard will cost extra every month. As of now there are no such issues with F1 F2 etc.

However, using an API on your own computer attracts extra charges without the broker moving a finger. The broker charges brokerage with they get anyways. :)
 

Raj232

Well-Known Member
This is why GetPlusVersion made sense to add -- to accommodate such changes that were bound to happen.

However, barring obvious name based interpretations, did you figure out the reason for the cardinality change?

The bsOrderRefNo here is the same as bsUniqueRefNo of the PlaceOrder.

Notice that the unique key remains the OrderRefNo, and the additional 3 parameters of PlaceOrder are cosmetic. Which brings up the question of why bsAlgoSeqNumber was needed in ModifyOrder at all.

So after all these changes is it possible to place an order from Amiborker directly to NEST3. I guess even if a popup comes up, the same can be clicked on via automation.

[It is obvious that to complicate things and reduce strategy based trading/algos that they introduced this. To keep the public loosing more and more to them]
 
Last edited:

yusi

Well-Known Member
So after all these changes is it possible to place an order from Amiborker directly to NEST3. I guess even if a popup comes up, the same can be clicked on via automation.

[It is obvious that to complicate things and reduce strategy based trading/algos that they introduced this. To keep the public loosing more and more to them]
That went from 10 to 1 pretty fast. You know the Visual Basic signatures of the calls, you have posted the dry run code in Excel to place an order. This thread, and so many other posts, have described Ami AFLs to place orders. Not the least, it would take one attempt to find out.

And, no, it is not obvious to me.
 

yusi

Well-Known Member
So how do we get the OrderRefNo from Nest Plus to Excel. Since the activities will happen in excel, I need to GET OrderRefNo into Excel from Nest Plus. Then only I can code a macro putting its value as String and Get the information about the order.
This OrderRefNo is *not* the exchange order number.

This OrderRefNo is a unique string you send to Nest when placing an order (e.g. "OrderNo_1"). See the second parameter of PlaceOrder().
 

Raj232

Well-Known Member
That went from 10 to 1 pretty fast. You know the Visual Basic signatures of the calls, you have posted the dry run code in Excel to place an order. This thread, and so many other posts, have described Ami AFLs to place orders. Not the least, it would take one attempt to find out.

And, no, it is not obvious to me.
Yep, all claim to be placing orders directly from AmiB to Nest, but it seems to be old threads which were probably possible with the older versions. However, with AmiB to NEST3 does not seems to work.

So basically looking for placing an order from AmiB to Nest3 without additional nest-plus subscription charges, etc.

So i thought I set this question open to you seniors who probably can throw some light on placing an order from AmiB to NEST3, or probably even a workaround :thumb:

Thanks in advance.
 
Last edited:

Raj232

Well-Known Member
Most of the Amibroker plugins available are using market orders fired to NEST/NOW

Combination of keys is being used for send Orders from Amibroker to NEST3
Example commands below:

Initially
FindWindowEx() --> Finds the Nest3 handle (title starts with "Welcome ")

As and when orders are fired from AmiB to NEST3
Appactivate --> Activates the Nest3 application (i.e. bring it into focus as the active application)
sendkeys () --> using the windows sendkeys command, amibroker application send the keys "F1" for BUY and "F2" for SELL to NEST3. Immediately after that the "Enter" aka "return" key of the keyboard is sent. This places an order for the active security at the current available price.

Robo software suppliers prefer to send market orders so that the orders are filled completely.

Thats why Robo guys say that the computer should not be touched/used for any other applications while the trades are going on.

Hope this helps any programmer preparing to automate placing orders of Automated trades from Amibroker To Nest without activating any API and without any charges using software like Visual Basic / Visual Studio/ Visual C++, etc.

Thanks:thumb:
 

Square

Active Member
Most of the Amibroker plugins available are using market orders fired to NEST/NOW

Combination of keys is being used for send Orders from Amibroker to NEST3
Example commands below:

Initially
FindWindowEx() --> Finds the Nest3 handle (title starts with "Welcome ")

As and when orders are fired from AmiB to NEST3
Appactivate --> Activates the Nest3 application (i.e. bring it into focus as the active application)
sendkeys () --> using the windows sendkeys command, amibroker application send the keys "F1" for BUY and "F2" for SELL to NEST3. Immediately after that the "Enter" aka "return" key of the keyboard is sent. This places an order for the active security at the current available price.

Robo software suppliers prefer to send market orders so that the orders are filled completely.

Thats why Robo guys say that the computer should not be touched/used for any other applications while the trades are going on.

Hope this helps any programmer preparing to automate placing orders of Automated trades from Amibroker To Nest without activating any API and without any charges using software like Visual Basic / Visual Studio/ Visual C++, etc.

Thanks:thumb:
I have been using appactivate, sendkeys to automate my orders entry from excel. All the calculations are done in excel, including the order size, options strike selection (incase of options positions). And things are pretty good. The accuracy rate still is not 100% as with sendkeys they sometime at not stable. Effectively you cannot be away from your machine and need to oversee order execution, even it is automated or one key touch order placement. This is still not the bigger problem, the bigger one is you cannot extract any information from Nest. I even have macros which opens the trade book, order book copies the orders and places them back in excel. But again as with order placement, you need to oversee this thing happening. There can be at times when due to some system processing there could be delay in appactivate and hence the subsequent code goes into a different loop. Then you need to re run the macro or run some undo macro. The 'wait' or 'sleep' function can be used to pause code running to take care of some system delay and this can delay order execution by 2-3 or 4 seconds, which in most of the case is ok. Yes, one thing is you can either do all activities automated or by one key stroke on you key board. But as you mentioned, just like Robo guys, you need to execute everything at Market price, no such possibility of making any codes on Limit orders, unless you use IOC type limit orders.

Hence paying 300 odd rupees a month may not be a great deal since you are 100% sure of all automated/ semi automated activities happening in NEST either through Excel, Ami or whatever third party charting software one is using.
 
Last edited:

Square

Active Member
I am curious to know, if I have activate Nest API of one broker, say Zerodha, can I use it with RKSV's Nest? Or does the Nest Plus subscription have any linkages with brokers, I have not seen it. Because, with registering with Nest Plus, it did not ask any information about the broker.

Also, another question is, if I activate Nest API with a broker for one account. Can I use it for autamating/semi automating OMS for other trading accounts with the same broker. i.e. with one Nest Plus API account subscription, could OMS etc for different trading account of family members be handled?
 

yusi

Well-Known Member
I am curious to know, if I have activate Nest API of one broker, say Zerodha, can I use it with RKSV's Nest? Or does the Nest Plus subscription have any linkages with brokers, I have not seen it. Because, with registering with Nest Plus, it did not ask any information about the broker.

Also, another question is, if I activate Nest API with a broker for one account. Can I use it for autamating/semi automating OMS for other trading accounts with the same broker. i.e. with one Nest Plus API account subscription, could OMS etc for different trading account of family members be handled?
Yes, this is a useful way to go about it; though it is less well known.

Normally, the broker creates a Nest Plus ID (similar to your user ID) to enable the Nest Plus Starter Pack. This permits the "Launch Plus" option in the terminal login to work. By default, when subscribing to Nest Plus Add-ons through your broker, this broker created Nest Plus ID is used.

You could tell your broker to map the subscription to your own Omnesys registered ID. This has pros and cons.

Advantages:
  • Can be used to log into Nest Plus of different users
  • Can be used to log into Nest Plus of different terminals (NOW or Nest Trader / Zerodha Trader / Tr@de X`pro)
  • Can be used to log into Nest Plus of different brokers

Disadvantages:
  • The automatic "Launch Plus" option will not work / should be disabled. Or you would have to logout of Plus and relogin with the Omnesys ID.

It has proved useful to me for testing across two terminals, and providing support to users whose Plus was not not activated. Of course, it will not work simultaneously across multiple logins. Surely you were not clarifying that ;) A second Nest Plus login results in the first login to close. It would be hard to imagine one person subscribing, and all of TJ using it.

I notice that this has been cross-posted to the Zerodha thread. Please let us know the response you get.
 

Similar threads