How to use Custom Tag with UpstoxNet
GetOrderFilledPriceis assigned with initial value as zero and it is updated with the actual filled price once the order update is received on websocket. We guess you might be missed the order update. You can fetch the order book which will reconcile all orders and you will get correct information. As long as you receive all order updates the
GetOrder*functions will return correct data.
In case if you missed any updates due to network disconnection at your end or updates is not sent from API server or any other issues like app hangs etc, fetching the
OrderBookwill reconcile all orders.
Yes you can use cTag everywhere, there will be no performance impact.
cTag's are valid for that day only. If you fetch order id using cTag on 10th April you will get order id of 10th April only.
Key Points to remember:
cTag is locally manipulated by
UpstoxNet, the Tag and order details are stored in the user computer in text files.
cTag must be minimum 3 characters and maximum 20 characters, alphanumeric.
Should be unique within a symbol, if same tag is used then, tag will hold the last order id placed.
You can use
'MYTAG'as cTag in AxisBank and ICICIBank, but if you use the same tag for multiple orders in AxisBank, then the tag will hold the last/latest order id placed.
Since, it is locally stored, it will not be available if you try in another computer.
Suppose you placed a Buy order in AxisBank with cTag as
computer 'A'and if you call
GetOrderCTagin this computer, it will return the associated order id.
If you call
computer 'B', this will return empty string as the Tag details are stored in
Nicely explained. Thanks many for the reply.
Hi, Say i am running various strategies in my account. And i want to use ctag to mark different strategies and later on want to use it to identify the performance of different strategies. In such a case how to use it?
As u mentioned that a ctag can be used only once for a symbol... What if i place 2 orders in axisbank for the same strategy... will it get rejected?
I basically want a way to run multiple strategies in a same account.. and at the end of the day want to analyse the performance of each strategy seperately...
CTag is meant to retrieve particular OrderId for further actions like modifying cancel etc. These are locally implemented by UpstoxNet.
i tried to use ctag in place oco and try to restrict multiple order. the issue is the retrive order id with ctag coloumn is not refreshing and geting value. so it fire order again. i need to manuly go to the coloumn and presf2+enter to rereive id. pls help.
GetOrderCTagis a function.
You need to call the function to get the result. It will not refresh on its own.
You need to make the UDF volatile or add a dynamic dummy parameter to make it mimic refresh.
I have modified like this
Public Function GetOrderStatus(ByVal OrderId As String) As Variant
On Error GoTo ErrHandler:
GetOrderStatus = Upstox.GetOrderStatus(OrderId)
GetOrderStatus = Err.Description
is it the correct function. pls help
Yes, it looks correct.
Also make ```GetOrderCTag`` UDF too as volatile.
Request you to go through this link first.
Still the the function =GetOrderCTag("NSE_EQ",B84,AT84)
not retrieving id automatically. i need to press f2+enter
You can try the other method i.e. passing dynamic dummy parameter.