Trading Instrument Data
FinInfo - current quotes on paper
The ISecurity.FinInfo property provides current data on paper. For example, you can see the current bid / ask prices, open price, open interest, expiration date, if any, warranty and more.
The full list can be found here.
An example of a script that logs the current bid and ask prices at each recount:
using TSLab.Script;
using TSLab.Script.Handlers;
namespace MyLib
{
public class GetFinInfo : IExternalScript
{
public void Execute(IContext ctx, ISecurity sec)
{
var fi = sec.FinInfo;
var txt = string.Format("{0}: {1} ({2}) - {3} ({4})", fi.LastUpdate, fi.Bid, fi.BuySqty, fi.Ask, fi.SellSqty);
ctx.Log(txt);
}
}
}
Bars - candle list
The ISecurity.Bars property provides a list of candles. This list consists of IDataBar objects that contain time, price, volume, open interest.
A detailed description of the source text files can be found here.
An example script that calculates and displays the median price in bars on a chart:

Price list
For convenience, the ISecurity interface provides various price lists:
OpenPrices
List of open prices
ClosePrices
List of close prices
HighPrices
List of highs
LowPrices
List of minimums
Volumes
List of volumes
An example of a script that displays the maximum and minimum prices on a chart:

Last updated
Was this helpful?