Dissecting the Nest Plus Auto Trading API

Square

Active Member
Sounds too good to be true. Can you provide a excel file, if that's OK.
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
'>>>>>>>>>>>>>>>>>>
 

Square

Active Member
@Square : is it with the Zerosha.. API activated costing Rs 2000 per mth ?
If you are asking about Zerodha API, 2k per month then you can get info here https://kite.trade/ . Programing in python, java, C#, .net etc. Also can be used with Excel VB

If you are asking how I am doing it, then I am not using any API as of now, something similar to third party OMS like Robotrade, but all my activities are routed through Excel. Excel gives me full hands on liberty for customise the way I want, including charts, like all type of charts. Also if you are trading in Options then you can install Prof JRVarma, IIMA, excel add in (google and download). Then you can create your own real time Options Oracle in excel, integrate it with Routines and OMS.
 

pannet1

Well-Known Member
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
'>>>>>>>>>>>>>>>>>>
Thanks Square.

What does BO stand for.
 

Square

Active Member
Thanks Square.

What does BO stand for.
It is cell name, actually it is BO1, accidently deleted "1". So don't go by the absolute, it was just a sample. I had to take some macros edit it and paste it here.

The file is large and has many VB script so if there are some cell reference just ignore them. The idea is this all can be programed in excel and no need to buy any software. You can do it in .net, C# etc, but excel suit my front end requirement too, so I use it over other. The only thing I need to run all this is RTD data, which again I pull from Link to Excel free of cost from Nest. Essentially my entire handling has no cost.

Since my file has my setups, triggers, sound alerts, SAR, round number price alerts, as well as my own information, I will be a task to do an edit and make a copy for public viewing.

Btw Excel has WithEvent function too, using which you can click on chart to place order directly from charts. You can also put trailing stop, target levels etc by clicking at a required point on the chart itself.

This has to be placed in "Class Module"

>>>>>>>>>>
Public WithEvents myChartClass As Chart
Public WithEvents myChartClass_1 As Chart
Private Declare Function sndPlaySound32 Lib "winmm.dll" _
Alias "sndPlaySoundA" (ByVal lpszSoundName _
As String, ByVal uFlags As Long) As Long
Private Sub myChartClass_1_MouseDown(ByVal Button As Long, ByVal Shift As Long, ByVal x As Long, ByVal y As Long)

...your code here....

>>>>>>>>
 

pannet1

Well-Known Member
It is cell name, actually it is BO1, accidently deleted "1". So don't go by the absolute, it was just a sample. I had to take some macros edit it and paste it here.

The file is large and has many VB script so if there are some cell reference just ignore them. The idea is this all can be programed in excel and no need to buy any software. You can do it in .net, C# etc, but excel suit my front end requirement too, so I use it over other. The only thing I need to run all this is RTD data, which again I pull from Link to Excel free of cost from Nest. Essentially my entire handling has no cost.

Since my file has my setups, triggers, sound alerts, SAR, round number price alerts, as well as my own information, I will be a task to do an edit and make a copy for public viewing.

Btw Excel has WithEvent function too, using which you can click on chart to place order directly from charts. You can also put trailing stop, target levels etc by clicking at a required point on the chart itself.

This has to be placed in "Class Module"

>>>>>>>>>>
Public WithEvents myChartClass As Chart
Public WithEvents myChartClass_1 As Chart
Private Declare Function sndPlaySound32 Lib "winmm.dll" _
Alias "sndPlaySoundA" (ByVal lpszSoundName _
As String, ByVal uFlags As Long) As Long
Private Sub myChartClass_1_MouseDown(ByVal Button As Long, ByVal Shift As Long, ByVal x As Long, ByVal y As Long)

...your code here....

>>>>>>>>
Hi Square,

Thank you very much. It was very kind of you.

It has been nearly 2 decades since I saw VB code. I think i took a separate path with PHP and MQL.

I now came to a conclusion that its better to stick with PHP rather than learning VB all over again.

You will laugh because I thought BO is some Bracket Order or Break Out. My mind had become corrupt with trading :eek:
 

yusi

Well-Known Member
Took their demo last year but found some trojan along with it being detected by antivirus software. On questioning the person, he disconnected the call. On calling back, he said that many customers are using it as it.

He mentioned "If you want you take it.. else forget it." .. i thought it is quite risky as it was my office computer.

Not sure if they have improved the software now. :thumb:
Cannot comment on their attitude, or whether their utility has a trojan or no. But basically, if one program is reading or manipulating the internals of another program, it is a red flag. This would be the case if Robotrade is accessing Nest. Either the OS would require elevated or administrative privileges, or some antivirus would block the call unless an exception was added. Particularly since Win 7, the OS has become more and more restrictive in this regard.

This would be true of data extraction utilities, or AmmyAdmin, as well. Excel to Nest macros (native or AutoIt types) would be flagged too.

It is hard for support to explain it to a user, specially one who is cautious. At some point, the user would have to take a leap of faith to proceed.
 

Square

Active Member
Hi Square,

Thank you very much. It was very kind of you.

It has been nearly 2 decades since I saw VB code. I think i took a separate path with PHP and MQL.

I now came to a conclusion that its better to stick with PHP rather than learning VB all over again.

You will laugh because I thought BO is some Bracket Order or Break Out. My mind had become corrupt with trading :eek:
On the contrary, I have chosen the path less travelled. :lol:

I guessed it right when you put query relating to the "BO"

If you are interested in hands free trading, then check out dragon speech reco software http://www.nuance.com/dragon/index.htm. This is simply the best along with some investment in a good quality microphone.
 
If you are asking about Zerodha API, 2k per month then you can get info here https://kite.trade/ . Programing in python, java, C#, .net etc. Also can be used with Excel VB

If you are asking how I am doing it, then I am not using any API as of now, something similar to third party OMS like Robotrade, but all my activities are routed through Excel. Excel gives me full hands on liberty for customise the way I want, including charts, like all type of charts. Also if you are trading in Options then you can install Prof JRVarma, IIMA, excel add in (google and download). Then you can create your own real time Options Oracle in excel, integrate it with Routines and OMS.
Sounds very interesting !
Can you plz point out what could be the starting point and path that need to be taken for a new learner.

Thanks
:)
 

Similar threads