@hardikdesai, Once you place a cover order, the system will take care of placing second leg order. The trigger price value is for the second leg order. You can read more about cover order here. To understand the exact flow, I would suggest using Kite web or mobile to place a test cover order.
@sujith : I get a KiteException "Kite Exception while getting Trigger Range: Missing api_key" for the below line. I have logged my API Key for the kiteConnect object and it shows correct key. Can you please help me here?
@sujith : In the example which you provided above, the getTriggerRange method takes only 2 parameters. However in the latest KiteConnect 3, the method getTriggerRange takes 3 parameters.
The trigger range method was pointing to old API. We changed it recently. You can download the latest jar file from dist directory or use the maven build.
It is same as exiting bracket order. You can check out example here.
Once you place a cover order, the system will take care of placing second leg order. The trigger price value is for the second leg order.
You can read more about cover order here.
To understand the exact flow, I would suggest using Kite web or mobile to place a test cover order.
for the below line. I have logged my API Key for the kiteConnect object and it shows correct key. Can you please help me here?
triggerRange = kiteConnect.getTriggerRange(Constants.EXCHANGE_NSE, "APOLLOTYRE", Constants.TRANSACTION_TYPE_SELL);
lastTradedPrice = kiteConnect.getLTP(instruments).get("NSE:APOLLOTYRE").lastPrice;