Real time data formulae

Below is the classic level 1 QuoteLink call that continues to be supported:

=RTD("quotein.rtd",, <symbol>, <field>, <feed>)

in addition version ql.0.78.0 introduces the format below that may be used for all types of requests:

= RTD("quotein.rtd",, <request format specification argument>, <arg 1>, <arg 2>, ...)

The request format specification argument specifies how the arguments should be interpreted and it is simply a text string containing multiple pairs <key>=<value>. Each value might explicitly provide the wanted field or simply %1, %2, … . If %1,%2, … is given they are interpreted as place holders and will be filled in order by the rest of the arguments given in the RTD formula.

example: consider the following request format specification:
 "TYPE=QUOTES FIELD=LAST SYMBOL=%1 FEED=IQ" when used in =RTD("quotein.rtd",,"FIELD=LAST SYMBOL=%1 FEED=IQ", "GOOG") will result in the symbol GOOG replacing the %1

Formula processing is very simply QuoteLink checks all <key>=<value> pairs it has found to see if has all it needs to resolve the formula. If the formula is only partially completed then QuoteLink returns a new string showing the partially completed formula as result (to help troubleshoot). The incomplete string is intended to be used as the request format specification of other formulas which will fill on their turn more missing keys until complete formulas are achieved. The exact <key> = <value> pairs needed depend on the type of the data we want to retrieve.

LEVEL I QUOTES

 TYPE=QUOTES
 SYMBOL=<symbol>  (optional defaults to IBM)
 FIELD=<field BID, ASK, LAST, ...) (optional defaults to LAST)
 FEED=<feed name> (optional defaults to the current feed)
 

SERIES (HISTORICAL and INTRADAY)

 TYPE=SERIES
 SYMBOL=<symbol> (optional defaults to LAST)
 PERIOD=<in minutes if nothing said 1, 2 ...; or in seconds if 1 s, 5 s > (optional defaults to 1 minute)
 FIELD=<OPEN, HIGH, LOW, CLOSE, ...> (optional defaults to CLOSE)
 START= optional aligns the bar to the given time. (useful to start any period at any time; also used in futures only to specify
  the exact start of the day bar - the value should be Excel time which is the fraction of the day)
 FEED=<feed name>   (optional defaults to current feed)

DEPTH QUOTES (futures and Level 2)

 TYPE=DEPTH
 SYMBOL=<symbol> (optional defaults to @ES#)
 FIELD=<NAME, BID, BID SIZE, ASK, ASK SIZE,> (optional defaults to CLOSE)
 MMID= <MMID order may -1,-2,-3,-4, ... for best bids ans 1,2,3, ... for best asks
 this one will be available later---> LEVEL= groups per price ignoring MMs 
  -1,-2,-3... for best bids +1,2,3,4 for best asks
 FEED=<feed name>   (optional defaults to current feed (IQ or IB atm))

Stock options Chains

 TYPE=LIST
 WHAT=SYMBOLS
 WANT=EXPIRATIONS
 CLASS=IEOPTION
 SYMBOL=<symbol> underlying stock
 INDEX=0,1,2 ... N <peeks a value in the resulting list>
 FEED=<feed name>   (optional defaults to current feed)

Future options FOPs

 TYPE=LIST
 WHAT=SYMBOLS
 WANT=EXPIRATIONS
 CLASS=FOPTION
 SYMBOL=<symbol> underlying future
 INDEX=0,1,2 ... N <peeks a value in the resulting list>
 FEED=<feed name>   (optional defaults to current feed)

then for each expiration it is possible to get the valid strikes:

 TYPE=LIST
 WHAT=SYMBOLS
 WANT=STRIKES
 EXPIRATION=<format YYMMDD>
 CLASS=<IEOPTION or FOPTION>
 SYMBOL=<symbol>
 INDEX=0,1,2 ... N <peeks a value in the resulting list>
 FEED=<feed name>   (optional defaults to current feed)

Future Chains

 TYPE=LIST
 WHAT=SYMBOLS
 CLASS=FUTURE>
 SYMBOL=<symbol>
 INDEX=0,1,2 ... N <peeks a value in the resulting list>
 FEED=<feed name>   (optional defaults to current feed)

List of all fields available for a feed for instruments of the same type as <symbol>

 TYPE=LIST
 WHAT=FIELDS
 SYMBOL=<symbol> the symbol is used to represent its class of instrument
 INDEX=0,1,2 ... N <peeks a value in the resulting list>
 FEED=<feed name>   (optional defaults to current feed)

IQFeed stats

Same information available is in IQConnect icon.

 TYPE=LIST
 WHAT=SYSTEM
 FIELD= one of: ServerIP, ServerPort, MaxSymbols, NumberOfSymbols,ClientsConnected, SecondsSinceLastUpdate,
  Reconnections, AttemptedReconnections,StartTime, MarketTime, Status, IQFeedVersion, LoginID, TotalKBsRecv,
   KBsPerSecRecv, AvgKBsPerSecRecv, TotalKBsSent, BsPerSecSent, AvgKBsPerSecSent
 FEED=<feed name> (only IQ works for now)

Portfolio

 FEED=feed  optional (only OX or IB based Note:you can use multiple accounts from OX, IB working at the same time)
 TYPE=LIST
 WHAT=POSITIONS
 ACCOUNT=<account> this optional ; if omitted the default account is considered
 INDEX=0,1,2 ... N <peeks a value in the resulting list>
 FIELD=for OX one of SecurityType, PositionID, AccountID, Symbol,	OXSymbol, UnderlyingSecurity, SymbolDescr,
  Quantity, optionmultiplier, InsertDate,PutOrCall, StrikePrice,	ExpMonth, ExpYear, AccntNum, CusipNumber, 
  CostBasis, Bid, Ask, Last, Price,  DisplayInTick, DisplayDenominator, GainLoss, Value, QuoteHasData,
  Close, MarketId, PositionDelta

Publishing data

 TYPE=PUT
 SYMBOL=<symbol>
 FEED=<a custom feed>
 FIELD=<the field to publish to>
 VALUE=<value to publish>
 
 The published value becomes available locally for all QuoteLink applicaitons and across the LAN 
 in LAN mode