Here is the footnote I left off concerning order id's, thier creation
and value.
Why choose an arbitrary value for an order id?
I might suggest that your order id system be based on time.
Using various functions one can extract a string from the system time
and date, convert it to a long value and then and use this as an id.
Why would one want to do this?
If they were (in the future) to decide to capture all trades and
store in a database, the id can be reconverted into its date value
and reports can be printed on a time basis.
Here is a crude example of creating an id based on date and time:
Example Date: 6/20/02 10:24:17 AM
Private Sub Command2_Click()
Dim newString As String
Dim newId As Long
newString = newString & Month(Date)
newString = newString & Day(Date)
newString = newString & DatePart("h", Now)
newString = newString & DatePart("m", Now)
newString = newString & DatePart("s", Now)
Text1 = newString 'displays 620102417; a unique number
newId = CLng(newString) 'convert to long value
'this value is within the confines of Long type data: 2,147,483,647
End Sub
There are other reasons to manipulate the order id...
What if you want your id to be based on a conditional check of the
symbol...for instance all trades with cisco will be between X and Y...
Or...if you trade options you might want an order prefix that
describes where in the money you are...or something like that..
I dont know much about options specifications
Or...you may want use an ordering system that relates to the type of
trade it was...Long or Short...
The choices are endless, and to dismiss everything but an arbitrary
system is ridiculous
If your storing the number...put it to work
Scott
Owner TWS API Yahoo Discussion Forum
"The other Yahoo Board"
heheheheh