Will it be zero
Yes, it will be zero for other values.
We will be adding a new property 'Mode' to Evnt Args, you can check this property and parse accordingly.
You can find all the log files in the below folder.
[Your App Dir]\UpstoxNet[ddMMMyy]
Right now the Master Contract files are downloaded in Json format. We will be adding a text/csv format in the coming release.
We plan to release a new version in the next week and it is a breaking release. So better wait for the new version.
As it places orders for some.....
You need to debug why it's not working.
Double check your function and its code.
Make sure you are passing correct and valid parameters.
To debug, remove any Error Handling in the Functions/Methods/UDF, so that when error comes in your system, program will stop at that line and you can check what went wrong.
Use Immediate window to evaluate or execute functions in debug mode.
Visual Basic/VBA knowledge is must to work with UpstoxNet. Unless you know how functions work and how codes are executed line by line, you are not going to make it out.
If you have difficulty in Visual Basic/VBA, please consult any professionals for personal advice on your system.
If you notice or find any bugs/issues/errors in UpstoxNet (.Net Library), please let us know otherwise.
Set Mode : Full (Before Login)
Set Mode : LTP
Keep LTP mode
But Initially call
GetSnapQuote for all symbols
This option will work from the coming release.
GetSnapQuote will not trigger
QuotesReceivedEvent, we will be adding this and event arg will have additional property
Mode to check the mode and use data accordingly
Example for LTP mode
LTP will be there, rest all field will be zero in Event
P.S. Bulk quote API is not available as of now and planned in the coming API release by Upstox team.
From technical point of view;
The concept of API trading is new to all and is evolving, so bugs and issues are always there. Main part of the API (order execution system) is handled/controlled by OMS vendors. API servers just takes request and pass it to OMS and receives response from OMS and pass it to user. So to fix bugs/issues, there is long chain, that leads to delay in service.
The order issues like above is every where, just browse respective developer/community forum, you will come to know all the issues.
Over the time, all this will go off.
Wherever you go bugs/issues will be there.
From traders point of view;
We advise people to
Use CO with limit order (This protect from slippages. In-built stoploss)
Strategy/Stock diversification (Instead of putting everything in one strategy/stock, diversify. This reduces little bit risk).
Have trade setup in Cloud. (Network disconnection is 0.01%, Speed : able to place order in ~160ms, Isolated from your work/normal routine)
Technical errors/issues can't be eliminated. Finding and Fixing new bugs is unending process
You can check order execution time i.e. the time difference between initial to final order status from order history or check json order_update file which is at [AppDir]\UpstoxNet[ddMMMyy]\Json[OrderId]_Update.json
We tried placing some orders and few orders took 17 sec to execute even though the order type is 'M'.
why don't you update the order keys as soon as the order is placed.. Whenever update is received, update with the new status.. This way getorderstaus will not give exception.. What say?
We explained this in the previous post,
"Received OrderId from PlaceOrder function and NOT Order Update in WebSocket is not a normal behavior." So we can't code accordingly and add keys in order function itself.
Why is order placing taking too much time
You first need to confirm whether the delay is in execution or sending the status on websocket.
@RenukaMisal Could you pls check this?
The normal behavior is, before the PlaceOrder functions returns Order_Id, you will receive the latest order update in Web-socket first.
More clear example:
When you place a order, the status received in the placed order function is
"status":"put order req received", but before this you will receive the more updated status in Web-socket i.e Open/TriggerPending/Complete etc depends upon the order type.
Since the keys are updated with last status received, if we update keys in PlaceOrder function, then we might be storing the wrong or old status.
That's why we didn't update the order keys in PlaceOrder function. If the Order_Update is not received, then there is no point/logic in storing order details in place order function as the order details are old.
keep polling for status?
It depends on your requirement.
how do I know where the exception is because of order details not received or because of something
got Order_id from PlaceOrder functions (order is received by OMS) and GetOrderStatus throws exception, then your order status is not received.
You will get OrderId after placing a order, but the order details (Dictionary Keys) are updated only in the
WebSocket Order_Update message.
GetOrderStatus call checks the dictionary keys for the order id passed, if no key found it throw exception
"OrderId is Null or Invalid".
As you said, you received order update after 15 sec, so keys are not updated which resulted in exception.
@Archana this error thrown by UpstoxNet
Assuming, you have set IST time zone and date-time is up to date in your system, stock is liquid and market is open.
You need to check time difference between the LTT and your system time.
It should be within ± 3 sec (Considering the time taken for quotes to reach from API server to app and parsing overhead.)
Your calculation will go like this
DiffSeconds = (LTT - Now()) - 8 Sec
Note: OMS time is ~8 sec ahead of IST. It is not delay, just OMS clock ~8 sec fast
Which price field you are tracking? Is it LTP?
How you are tracking the delay i.e. how you got 9.95sec etc?
We will add these stocks in our watch list and check for the delay.
1.Stock is illiquid.
2.You might be running some lengthy code in the event handler.
3.Issue in UpstoxNet
4.API is sending delayed quotes
Looks like your connection to Upstox Forum was lost, please wait while we try to reconnect.