Dissecting the Nest Plus Auto Trading API

Raj232

Well-Known 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:
Everyone has a whole lot of programming techniques and insights .. very little is actually available for executing a strategy without any hassles. :D:D:D
Either the broker or the exchange wants a piece of the action whether or not you are making any money :D:D:D

All this would be OK if we are running an infotech or technology company, but not for a trader looking to automate a basic strategy
:clapping::clapping::clapping:
 

Square

Active Member
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
:)
Building OMS is not that difficult, the difficult part is the setups. So first you need to code your setup, entry and exit triggers and charting the way you like it, eg what time frame, or if multiple time frame than accordingly make charts. Also there will be different setups or strategies for different market conditions or market structures. So you have may have 2 -3 or 4 etc setups. This you can invoke at the click of a mouse or on the buttons on charts. e.g. Strategry 1, Strategy 2 etc. So once you have "decided" which strategy you think is suiting the particular day then you can click on that button and then your system will give you entry / exit alerts etc. This can then be executed through OMS.
The other point which is important is MM, so first define this part and link it with historic volatility in the market. So you calculations of position is automatically done as per 'historic' volatility (not future, because we do not know anything in future). So when you run OMS you are not bothered about position size and your MM is taken care of. This I think is paramount to trading success.
Then the last part is analytics, what you have done (actual trade) has to be recorded for analysis. Like what zerodha shows in quant. Here you can create anything you want. Like I have a candlestick chart of my P&L. It is like any any chart of nifty or stock. Has high lows, close. The high shows my profit which went till that level (though I did not book it) and the lows shows my loss which went till that leve (though I did not book it). Every trade is one candle, every day P&L is one candle, every week too. So seeing this chart too gives a net idea of how well my own Stock is doing and when to take pause or actively participate in markets. So this is one thing. Similarly on day type basis you can have data, what happens on Monday, on Friday, on expiry day. Long or short what is best for you. etc etc. The list is long.

Because it is possible to code all what you need and suits your trading behaviour you can benefit. To conclude what will suit me may or may not suit you.

Hope this helps.
 

Square

Active Member
Building OMS is not that difficult, the difficult part is the setups. So first you need to code your setup, entry and exit triggers and charting the way you like it, eg what time frame, or if multiple time frame than accordingly make charts. Also there will be different setups or strategies for different market conditions or market structures. So you have may have 2 -3 or 4 etc setups. This you can invoke at the click of a mouse or on the buttons on charts. e.g. Strategry 1, Strategy 2 etc. So once you have "decided" which strategy you think is suiting the particular day then you can click on that button and then your system will give you entry / exit alerts etc. This can then be executed through OMS.
The other point which is important is MM, so first define this part and link it with historic volatility in the market. So you calculations of position is automatically done as per 'historic' volatility (not future, because we do not know anything in future). So when you run OMS you are not bothered about position size and your MM is taken care of. This I think is paramount to trading success.
Then the last part is analytics, what you have done (actual trade) has to be recorded for analysis. Like what zerodha shows in quant. Here you can create anything you want. Like I have a candlestick chart of my P&L. It is like any any chart of nifty or stock. Has high lows, close. The high shows my profit which went till that level (though I did not book it) and the lows shows my loss which went till that leve (though I did not book it). Every trade is one candle, every day P&L is one candle, every week too. So seeing this chart too gives a net idea of how well my own Stock is doing and when to take pause or actively participate in markets. So this is one thing. Similarly on day type basis you can have data, what happens on Monday, on Friday, on expiry day. Long or short what is best for you. etc etc. The list is long.

Because it is possible to code all what you need and suits your trading behaviour you can benefit. To conclude what will suit me may or may not suit you.

Hope this helps.
The reason I did not go for any external charting or OMS software is that since I can code whatever is needed, I can make it suiting my need and I can tweak it around till I am fully satisfied with it. This you cannot do with anything which is sold over the counter. No doubt this is effort but it will definitely help better even if your strategy is not so sound. Which is in my case presently. The hunt get hold of some good strategies and setups is on and will continue forever. Here the good and stable backend to manage all your trading related activities help a lot to put all your efforts on the main job - 'trading'.
 
Building OMS is not that difficult, the difficult part is the setups. So first you need to code your setup,
....
Then the last part is analytics, what you have done (actual trade) has to be recorded for analysis. Like what zerodha shows in quant. Here you can create anything you want. Like I have a candlestick chart of my P&L. It is like any any chart of nifty or stock. Has high lows, close. The high shows my profit which went till that level (though I did not book it) and the lows shows my loss which went till that leve (though I did not book it). Every trade is one candle, every day P&L is one candle, every week too. So seeing this chart too gives a net idea of how well my own Stock is doing and when to take pause or actively participate in markets. So this is one thing. Similarly on day type basis you can have data, what happens on Monday, on Friday, on expiry day. Long or short what is best for you. etc etc. The list is long.

Because it is possible to code all what you need and suits your trading behaviour you can benefit. To conclude what will suit me may or may not suit you.

Hope this helps.
This idea of plotting trades as candle sticks is nice :thumb:

Of course I was talking not about learning setup but OMS etc which appear easy to you !!

Thanks
 

john302928

Well-Known Member
@John 302928, your PM Inbox is full, delete few messages. Cant reply.
@square
Hi , I have cleared inbox. Waiting for your reply
 

john302928

Well-Known Member
Hi
The below code is not working. Because the application has date and time at the heading like ""Welcome XXXXX To NEST Trader ( 3.11.4 ). Zerodha 28/02/2017 05:30:45"

How can we add those date and timer details in this code to activate the application.

AppActivate ("Welcome XXXXX To NEST Trader ( 3.11.4 ). Zerodha")
 

Square

Active Member
Hi
The below code is not working. Because the application has date and time at the heading like ""Welcome XXXXX To NEST Trader ( 3.11.4 ). Zerodha 28/02/2017 05:30:45"

How can we add those date and timer details in this code to activate the application.

AppActivate ("Welcome XXXXX To NEST Trader ( 3.11.4 ). Zerodha")
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

'...
 

john302928

Well-Known Member
I am getting the below error

"Run time error 5
Invalid procedure call or argument"
 

Square

Active Member
Check,
1) if you have Nest Trader running in the background.
2) if the version of Nest Trader is same as appearing in the code.

No other reason for the code to not work.
 

Similar threads