Type/to search
Built-in Functions
Structures
Ticker
Depth
OrderBook
Trade
Record
Market
Order
Condition
Account
Asset
Position
Funding
Other Structures
HttpQuery-options
HttpQuery-return
LogStatus-table
LogStatus-btnTypeOne
LogStatus-btnTypeTwo
Chart-options
Chart-return
KLineChart-options
KLineChart-return
SetData-data
EventLoop-return
exchange.Go-return
DBExec-return
Dial-return
Thread.join-return
Built-in Variables and Constants
Conventions
Exchanges

This JSON is the data structure returned by the EventLoop() function. The EventLoop() function monitors the following events: 1. Any WebSocket readable data events; 2. Completion events of concurrent tasks from exchange.Go() and HttpQuery_Go() functions; 3. Message events sent by threads created using the threading.Thread() function in JavaScript language strategies.

Attributes

NameTypeDescription

Seq

number

Event sequence number.

Event

string

Event name.

ThreadId

number

Event thread ID.

Index

number

Event index.

Queue

number

Number of events still waiting in the queue when this event is returned.

Nano

number

Nanosecond timestamp.

See Also

Remarks

When using the exchange.Go() function for concurrent requests, the event data structure returned by the EventLoop() function.

json
{ "Seq":1, "Event":"Exchange_GetTrades", "ThreadId":0, "Index":3, "Queue":0, "Nano":1682068771309583400 }

When concurrent execution threads in JavaScript language strategies (created by the threading.Thread() function) use the thread object's postMessage() function to send messages, the EventLoop() function in the receiving thread will monitor the following event data structure:

json
{ "Seq":4, "Event":"thread", "ThreadId":1, "Index":0, "Queue":0, "Nano":1727592066508674000 }

Ticker and order events pushed by the exchange (Event is tick or order, and Index is the index of the exchange object) also carry a Symbol field plus a Ticker (Ticker structure) or Order (Order structure) field.