NOW to AmiBroker (YA)

Status
Not open for further replies.

yusi

Well-Known Member
Nest Automated Trading

It may or may not satisfy your curiosity, but a quick look-see on automated trading using Nest Plus.

WARNING: Right at the outset, let me mention that there are far too many pitfalls. Most of them will arise due to a lack of full understanding, and careless mistakes. Some will occur as a result of lack of documentation and shortcomings in Nest Plus itself. Not the least, you do not test such critical code in a live market -- all such developments use a simulated environment. You have been warned. So please take this as awareness; nothing more.

Let's just cut to the core. Below is a sample AmiBroker AFL that will place two orders.

Code:
//Create the Nest Plus API object
plusObject = CreateObject("nest.plusapi");

//Assign a name
plusObject.SetObjectName("Example");

//Place a limit buy order
plusObject.PlaceOrder("BUY", "OrderNo_1", "MCX", "ALUMINI12OCTFUT", "DAY", "LIMIT", 1, 100.20, 0, 1, "MIS", "MyTradingID");

//Place a stop loss buy order
plusObject.PlaceOrder("BUY", "OrderNo_2", "MCX", "ALUMINI12OCTFUT", "DAY", "SL", 1, 108.20, 108.15, 1, "MIS", "MyTradingID");
If the AFL is executed, and if everything else is okay, the retail trader will see this window in Nest / Zerodha Trader:



In the screen above, the first order has been placed by the user and will reflect in the order book (either accepted or rejected). The second is still pending user action.

That is it.

Can I use this AFL to check? Don't be crazy, even the verify AFL will execute the commands (provided you have a subscription to the API).

Does it need to be an AFL? No, you should be able to do this via most modern languages (of course C/C++ would be a native match), or trading platforms.

Any gotchas? Plenty. Read the warning carefully again.
 

yusi

Well-Known Member
Re: Nest Automated Trading

In the previous post, I mentioned pitfalls & gotchas. Will mention two here that are not obvious till you have tried it out.

1. When placing the orders via an external program, the Generated Orders window comes up to execute the order (for the retail trader). If, by chance, you close that window (or Nest Trader crashes), there is no way to open it again -- there is no option in the menu or Plus options to do so.

2. The Limit Buy order given in the previous example will actually fail. There is nothing wrong with the values or parameters. Can you guess why without reading further?

It is a grey area as to whose fault it is -- AmiBroker or Nest Plus; if forced to choose, I would say that it is a consequence of AmiBroker internals as it works fine with other languages. In the example below, the first order fails, the second will work.

Code:
plusObject.PlaceOrder("BUY", "OrderNo_5", "MCX", "ALUMINI12OCTFUT", "DAY", "LIMIT", 1, 100.20, 0, 1, "NRML", "MyTradingId");
plusObject.PlaceOrder("BUY", "OrderNo_6", "MCX", "ALUMINI12OCTFUT", "DAY", "LIMIT", 1, 100.2001, 0, 1, "NRML", "MyTradingId");
 

yusi

Well-Known Member
Nest2Ami

This is in the nature of a disclaimer:

There have been three occasions in the last week where somebody has confused the Nest2Ami (Nest / Zerodha Trader to AmiBroker) utility posted here with another utility "Nest2Ami Pro" developed by aamaadmisoftware.com

It needs to be emphasized that while both offer similar functions, and have almost identical names, there is no relation between the two.
 

summasumma

Well-Known Member
Hi Yusi,

can you pls provide me the link to download ZerodhaTrader2Amibroker utility?

I am using ZT to trade in NSE FO. Hope this utility can be used to stream live NSE FO data from ZT to AmiB. Also will it be able to backfill in AmiB based on PLus historical chart loaded in ZT using plus login?

Thanks,
...summasumma
 

yusi

Well-Known Member
can you pls provide me the link to download ZerodhaTrader2Amibroker utility?

I am using ZT to trade in NSE FO. Hope this utility can be used to stream live NSE FO data from ZT to AmiB. Also will it be able to backfill in AmiB based on PLus historical chart loaded in ZT using plus login?

Thanks,
...summasumma
Check your pm (its best to PM a request and leave the thread to discussions).

Best you try it out. Had you mentioned somewhere that you preferred "tick" data? If so, you can configure it for snapshot data capture.

There are two modes of backfill -- internal and Nest Plus. Read this post to understand the reasons why you might need tweaks to timer values. At this point, prefer Nest Plus backfill, though it is an external dependency.
 

summasumma

Well-Known Member
When i start Nest2Ami around 11 o clock today and start capturing data(NSE) from NEST, i could see data updated to AmiB from that time only(11AM). why is it not automatically backfilling for today intraday from 9:15AM and also continue capturing from current time so the graph looks complete?
Is this feature not available or i need to make some settings?

Pls clarify.
 

yusi

Well-Known Member
When i start Nest2Ami around 11 o clock today and start capturing data(NSE) from NEST, i could see data updated to AmiB from that time only(11AM). why is it not automatically backfilling for today intraday from 9:15AM and also continue capturing from current time so the graph looks complete?
Is this feature not available or i need to make some settings?

Pls clarify.
Both capture and backfill are separate and discrete operations. If you want Plus backfill, you ask it to backfill, and specify the date range, etc. You will notice that there is some degree of hands-off-the-terminal during the Plus Bf operation as each scrip to be backfilled is programmatically selected, etc.

So, I'd say that automatic backfill feature is not available. Not that it has not been requested earlier or crossed my mind; but multi-threading into Nest (or rather two third-party apps) is prone to all kinds of misbehavior.
 

summasumma

Well-Known Member
Both capture and backfill are separate and discrete operations. If you want Plus backfill, you ask it to backfill, and specify the date range, etc. You will notice that there is some degree of hands-off-the-terminal during the Plus Bf operation as each scrip to be backfilled is programmatically selected, etc.

So, I'd say that automatic backfill feature is not available. Not that it has not been requested earlier or crossed my mind; but multi-threading into Nest (or rather two third-party apps) is prone to all kinds of misbehavior.
In that case, one suggestion then:
It need not be multi-threading to NEST. Rather, when the "Start Capture" is pressed, we can invoke a function to fetch the 1min/tick data from the beginning of the day till the current time and fill it in AmiB.
Then, start the current function of fetching the tick and filling to AmiB.
Yes, in this way there a overhead of capturing all the day data even if u start @say 3PM). but the customers using this wont matter that i guess as we get almost complete information for the day.
Will it help?
 
Status
Not open for further replies.

Similar threads