Dissecting the Nest Plus Auto Trading API

john302928

Well-Known Member
Yes ofcourse my Nest is running in the background
and I have correct version of Nest trader.

Hello dear friends
Can any one check and tell me if it works for you. I tried as per suggestions by "Square". But its not working for me. Please let me know if any one got success. Thanks
 

Square

Active Member
No need to put the date and time. The code works without that. Hope you are putting correct client id and zerodha broker id in your code.

e.g. the below code will open Nest Admin Position from Excel, then wait for 2 seconds and then bring back focus to your Excel workbook.

'...

Sub Position()

AppActivate ("Welcome XX1234,13906 To NEST Trader ( 3.11.4 ). Zerodha")

SendKeys "{F11}"

Application.Wait Now + TimeValue("00:00:02")

SendKeys "{Esc}"

AppActivate ("Excel")
Workbooks("MyBook.xlsm").Activate

End Sub

'...
Pls check the spaces in the highlighted line. Before the last word Zerodha there are TWO spaces. Similarly after the start and before the end of the bracket there is ONE space.

You check the Nest trader title and put spaces accordingly. This will work, I have my entire OMS and setups running in Excel, I donot have to see Nest Trader at all.
 

john302928

Well-Known Member
Hi Square
as you suggested, I added 2 spaces before the word Zerodha and I added one space after and before the end of the bracket. but once i move the cursor to the next line in excel macro after adding this space, excel macro removes this space automatically based on its syntax

I ran the macro now, but still I am getting the same error.


Pls check the spaces in the highlighted line. Before the last word Zerodha there are TWO spaces. Similarly after the start and before the end of the bracket there is ONE space.

You check the Nest trader title and put spaces accordingly. This will work, I have my entire OMS and setups running in Excel, I donot have to see Nest Trader at all.
 

Raj232

Well-Known Member
Pls check the spaces in the highlighted line. Before the last word Zerodha there are TWO spaces. Similarly after the start and before the end of the bracket there is ONE space.

You check the Nest trader title and put spaces accordingly. This will work, I have my entire OMS and setups running in Excel, I donot have to see Nest Trader at all.
@Square: If you are not using NEST trader, then which platform does your order get placed in from excel
 
Hi All,

I am getting error message when I tried to use this afl.


nestplus = Null;
if(IsNull(nestplus))
{
nestplus = CreateStaticObject("Nest.PlusApi");
nestplus.SetObjectName("RKRAutoTrade");

COM/object handle is null

Can someone help me to fix the issue?

Regards,
Kalpesh
 

yusi

Well-Known Member
Hi All,

I am getting error message when I tried to use this afl.


nestplus = Null;
if(IsNull(nestplus))
{
nestplus = CreateStaticObject("Nest.PlusApi");
nestplus.SetObjectName("RKRAutoTrade");

COM/object handle is null

Can someone help me to fix the issue?

Regards,
Kalpesh
What have you checked so far? I do not want to make wild guesses without any relevant clues from your side.

It is likely that the CreateStaticObject() call failed as the NestPlus Trading Plugin is not enabled. See
http://www.traderji.com/community/t...us-auto-trading-api.87324/page-24#post-970095
 
I will give you some basic Routines, which you can work upon. You will get ideas to create your own personality suiting auto systems, including time based OMS entry exit, SAR, auto position sizing basis volatility, monitored or non monitored OMS etc.

You can also use VB to manage OMS of multiple account on the same machine, like what you mentioned in the other post.

Examples:

Sub Enter_Position_Buy_Option()
AppActivate ("Welcome XXXXX To NEST Trader ( 3.11.4 ). Zerodha")
Application.Wait Now + TimeValue("00:00:01")
SendKeys "{Esc}"
SendKeys "{F1}"
SendKeys "+{TAB}"
SendKeys "+{TAB}"
SendKeys "+{TAB}"
SendKeys "+{TAB}"
If Range ("BO") = "L" Then
SendKeys "c" ' for Call Buy
ElseIf Range ("BO") = "S" Then
SendKeys "p" ' for Put Buy
End If
SendKeys "{TAB}"
SendKeys Range("B4") 'Strike price selection
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "{Enter}"
TalkIt ("Position Taken")
Application.Wait Now + TimeValue("00:00:01")
AppActivate ("Excel")
End Sub
'>>>>>>>>>>>>>>>>>>
Sub Exit_Position()
AppActivate ("Welcome XXXXX To NEST Trader ( 3.11.4 ). Zerodha")
Application.Wait Now + TimeValue("00:00:02")
SendKeys "{Esc}"
SendKeys "{F2}"
SendKeys "+{TAB}"
SendKeys "+{TAB}"
SendKeys "+{TAB}"
SendKeys "+{TAB}"
SendKeys "+{TAB}"
SendKeys "+{TAB}"
SendKeys "+{TAB}"
SendKeys "+{TAB}"
SendKeys "m"
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "c"
SendKeys "{TAB}"
SendKeys Range("B4")
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "{TAB}"
SendKeys "{Enter}"
Application.Wait Now + TimeValue("00:00:01")
AppActivate ("Excel")
End Sub
'>>>>>>>>>>>>>>>>>>>>

Sub Order_Trade_Book()
AppActivate ("Welcome XXXXX To NEST Trader ( 3.11.4 ). Zerodha")
Application.Wait Now + TimeValue("00:00:01")
If Range("AM20") = 99 Then
SendKeys "{F8}" ' for viewing Trade Book
Else: SendKeys "{F3}" 'for viewing Order Book
End If
Application.Wait Now + TimeValue("00:00:05")
SendKeys "{Esc}"
AppActivate ("Excel")
Workbooks("Mybook.xlsm").Activate
End Sub
'>>>>>>>>>>>>>>>>>>
Sub One_Key_Touch_Activate()
Application.OnKey "b", "Enter_Position_Buy_Option" ' alphabet b
Application.OnKey "e", "Exit_Position" ' alphabet e
Application.OnKey "o", "Order_Trade_Book" ' alphabet o
End Sub
'>>>>>>>>>>>>>>>>>>

Can you Provide Complete Excel File/VBA/vb6 . I will also ready to pay for it.
 
Thanks Yusi for the update.

I currently use Excel vba to send orders from excel using Sendkeys. Order placement is manual from Excel. But at times this is not stable and may skip orders. I would like to know the following:
Though Nest API subscription, would it only allow placing/modifying/cancelling orders from excel OR does it also have GET functions to access order book, trade book, position book from Nest to excel.
Hi, Could you share me the Excel vba to send orders from excel using Sendkeys.
 
Has anyone tried Fyers API? Looks like a lot of people on Traderji are asking them on the thread. How is it compared to Nest Plus API? I want to try that but my developer is not an expert to judge api so looking for feedback.
 

Similar threads