TSLab API Docs  1
TSLab.Script.Realtime.ISecurityRt Interface Reference

Realtime paper functions. More...

Inheritance diagram for TSLab.Script.Realtime.ISecurityRt:
TSLab.Script.ISecurity

Public Member Functions

void NewOrder (OrderType type, bool isBuy, double price, double quantity, string signal, string notes=null)
 Make new order. The order type buy or sell The order price The quantity The comment the signal notes
 
void NewOrder (OrderType type, bool isBuy, double price, double slippage, double quantity, string signal, string notes=null)
 Make new order. The order type buy or sell The order price The order price slippage The quantity The comment the signal notes
 
void ChangeOrder (IOrder order, OrderType type, double?newPrice, double?slippage, double?newQuantity, string signal, string notes=null)
 Make new order. The order type The order instance The order price The order price slippage The quantity The comment the signal notes
 
void CancelOrder (IOrder order)
 Cancel the order. The order
 
- Public Member Functions inherited from TSLab.Script.ISecurity
IReadOnlyList< IQueueDataGetBuyQueue (int barNum)
 Get list of orders queue for selected candle or null. The candle number returns orders queue for buy part
 
IReadOnlyList< IQueueDataGetSellQueue (int barNum)
 Get list of orders queue for selected candle or null. The candle number returns orders queue for sell part
 
IReadOnlyList< ITrade > GetTrades (int barNum)
 Get list of trades for selected candle. The candle number returns list of trades
 
IReadOnlyList< ITrade > GetTrades (int firstBarIndex, int lastBarIndex)
 Get list of trades for selected candles. First bar index Last bar index returns list of trades
 
int GetTradesCount (int firstBarIndex, int lastBarIndex)
 
IReadOnlyList< IReadOnlyList< ITrade > > GetTradesPerBar (int firstBarIndex, int lastBarIndex)
 
ISecurity CompressTo (int interval)
 Compress paper candles to new interval and get compressed candles list New interval in the minutes. Returns the compressed security.
 
ISecurity CompressTo (Interval interval)
 Compress paper candles to new interval and get compressed candles list. New interval. Returns the compressed security.
 
ISecurity CompressTo (Interval interval, int shift)
 Compress paper candles to new interval and get compressed candles list. New interval. Time shift. Returns the compressed security.
 
ISecurity CompressTo (Interval interval, int shift, int adjustment, int adjShift)
 Compress paper candles to new interval and get compressed candles list. New interval. Time shift. Time adjustment. Time adjustment shift. Returns the compressed security.
 
ISecurity CompressToVolume (Interval interval)
 
ISecurity CompressToPriceRange (Interval interval)
 
IList< double > Decompress (IList< double > candles)
 Decompress double values list from custom interval and make new double values list with the paper interval. double values list new double values list in the paper interval
 
IList< TK > Decompress< TK > (IList< TK > candles, DecompressMethodWithDef method)
 Decompress TK values list from custom interval and make new TK values list with the paper interval. TK values list the decompression method new TK values list in the paper interval
 
void ConnectSecurityList (IGraphListBase list)
 Connect graph to security for realtime updating. The chart list.
 
void ConnectDoubleList (IGraphListBase list, IDoubleHandlerWithUpdate handler)
 Connect graph to security for realtime updating The chart list. Update handler
 
double RoundPrice (double price)
 Round incoming price to minimal tick. The incoming price. The rounded price.
 
double RoundShares (double shares)
 Round incoming shares to minimal lot tick. The incoming shares. The rounded shares.
 
ISecurity CloneAndReplaceBars (IEnumerable< IDataBar > newCandles)
 Clone Security with new candles. ATTENTION: Can impact to optimization performance because data shouldn't shared beetween optimization step. New candles list The security with replaced candles
 
void UpdateQueueData ()
 Update cached queue data.
 

Properties

IEnumerable< IOrderOrders [get]
 The list of executed and active orders (for this script only).
 
IEnumerable< IOrderCancelledOrders [get]
 The list of cancelled orders (for this script only).
 
bool HasActiveOrders [get]
 Security has active orders or not
 
double BalanceQuantity [get]
 Balance from position table.
 
double CurrencyBalance [get]
 Free money.
 
double EstimatedBalance [get]
 Estimated money.
 
string PortfolioName [get]
 The security portfolio name.
 
string ProviderName [get]
 The security provider name.
 
bool IsPortfolioActive [get]
 Is realtime (IAgent) portfolio active (connected)? More...
 
- Properties inherited from TSLab.Script.ISecurity
string Symbol [get]
 Paper symbol (EESR, EURUSD etc).
 
IDataSourceSecurity SecurityDescription [get]
 The security description from data provider.
 
FinInfo FinInfo [get]
 Current finance information.
 
IReadOnlyList< IDataBarBars [get]
 Paper candles list.
 
bool IsBarsLoaded [get]
 Is security bars loaded or not More...
 
IList< double > OpenPrices [get]
 Paper Open prices list.
 
IList< double > ClosePrices [get]
 Paper Close prices list.
 
IList< double > HighPrices [get]
 Paper High prices list.
 
IList< double > LowPrices [get]
 Paper Low prices list.
 
IList< double > Volumes [get]
 Paper Volumes list.
 
Interval IntervalInstance [get]
 Paper interval.
 
int Interval [get]
 Paper interval in base units.
 
DataIntervals IntervalBase [get]
 Paper interval base.
 
int LotSize [get]
 The lot size for the security.
 
double LotTick [get]
 The lot increment for the security.
 
double Margin [get]
 The margin for the security.
 
double Tick [get]
 Paper tick (minimum increment value).
 
int Decimals [get]
 Get security decimals
 
IPositionsList Positions [get]
 Positions list.
 
CommissionDelegate Commission [get, set]
 Get/set commission delegate for script.
 
string CacheName [get]
 Get unique secuirty name for cache.
 
double InitDeposit [get, set]
 Initial deposit.
 
bool IsRealtime [get]
 Is realtime (IAgent) mode now? More...
 
bool IsPortfolioReady [get]
 Is realtime (IAgent) portfolio ready to trade? More...
 
bool SimulatePositionOrdering [get]
 Simulate postion ordering option enabled More...
 
bool IsAligned [get]
 

Detailed Description

Realtime paper functions.

Property Documentation

bool TSLab.Script.Realtime.ISecurityRt.IsPortfolioActive
get

Is realtime (IAgent) portfolio active (connected)?