3. A dry run
A quick-and-dirty trial will put some of the API functions in perspective. Unfortunately, there is no trading equivalent of a "Hello world", is there? While a GetPlusVersion would have been a no-risk illustration, that has issues. And there is no simulation server that can be used for testing. Limit orders on Hindalco with quantity as 1, using an AmiBroker afl, should do.
UserID has to be replaced with the trading ID, for example if the ID is BL155 and broker is Zerodha, the UserID would be BL155-13906.
Note: In this example, the first order should be rejected as it uses NRML.
A quick-and-dirty trial will put some of the API functions in perspective. Unfortunately, there is no trading equivalent of a "Hello world", is there? While a GetPlusVersion would have been a no-risk illustration, that has issues. And there is no simulation server that can be used for testing. Limit orders on Hindalco with quantity as 1, using an AmiBroker afl, should do.
Code:
//Create the Nest Plus API object
plusObject = CreateObject("nest.plusapi");
//Assign the object a name
plusObject.SetObjectName("DryRun");
//Place a limit buy order using NRML (near the lower circuit, CMP is 110)
plusObject.PlaceOrder("BUY", "OrderNo_1", "NSE", "HINDALCO-EQ", "DAY", "LIMIT", 1, 100.15, 0, 1, "NRML", "UserID");
//Place a limit buy order using CNC
plusObject.PlaceOrder("BUY", "OrderNo_2", "NSE", "HINDALCO-EQ", "DAY", "LIMIT", 1, 100.15, 0, 1, "CNC", "UserID");
UserID has to be replaced with the trading ID, for example if the ID is BL155 and broker is Zerodha, the UserID would be BL155-13906.
Note: In this example, the first order should be rejected as it uses NRML.