Jeremy

What is the purpose of "orderRef"?

Programming


From TechDoc, I see order submission allows an input parameter for "orderRef".  
I don't quite understand what it is for. 
Appreciate if someone can explain more, and better to provide some examples. 
Thank you~
 
tony lam
Hi Jeremy, "orderRef" is an optional parameter attached to an order object. 
It allows you to identify and manage your orders easily. 

Just like the pair trading example in TechDoc, suppose you opened multiple trading pairs at the same time. eg. 
  • order #1: buy AAA
  • order #2: sell BBB
  • order #3: buy CCC
  • order #4: sell DDD
  • ...

Let's say, order #1 and #2 are of the same pair; and order #3 and #4 are another pair.  
By defining our own pair_id (eg. order #1 and #2 use orderRef=p1; order #3 and #4 use orderRef=p2), we can then identify different pairs easily for subsequent order close condition checking.