TSLab API Docs  1
TSLab.Script.IPositionsList Interface Reference

List of Positions More...

Inheritance diagram for TSLab.Script.IPositionsList:

Public Member Functions

IPosition GetLastPosition (int barNum)
 The latest position in the list or null the bar number
 
IPosition GetLastPositionActive (int barNum)
 The latest active position in the list or null the bar number
 
IPosition GetLastLongPositionActive (int barNum)
 The latest long active position in the list or null the bar number
 
IPosition GetLastShortPositionActive (int barNum)
 The latest active position in the list or null
 
IPosition GetLastPositionClosed (int barNum)
 The latest closed position in the list or null the bar number
 
IPosition GetLastLongPositionClosed (int barNum)
 The latest long closed position in the list or null the bar number
 
IPosition GetLastShortPositionClosed (int barNum)
 The latest short closed position in list or null the bar number
 
IPosition GetLastForSignal (string signalName, int barNum)
 The latest position for the signal name the signal name the bar number position or null
 
IPosition GetLastActiveForSignal (string signalName)
 The latest active position for signal name signal name position or null
 
IPosition GetLastClosedForSignal (string signalName, int barNum)
 The latest closed position for the signal name the signal name the bar number position or null
 
IPosition GetLastActiveForSignal (string signalName, int barNum)
 The latest active position for signal name signal name the bar number position or null
 
IPosition GetLastForCloseSignal (string signalName, int barNum)
 The latest position for the closing signal name the closing signal name the bar number position or null
 
IEnumerable< IPositionGetActiveForBar (int barNum)
 The current active positions for the the bar number the bar number Enumeration of positions
 
IEnumerable< IPositionGetClosedForBar (int barNum)
 The positions which was closed before the bar number the bar number Enumeration of positions
 
IEnumerable< IPositionGetClosedOrActiveForBar (int barNum)
 GetActiveForBar+GetClosedForBar More...
 
void BuyAtMarket (int barNum, double shares, string signalName, string notes=null)
 Open new long position by the bar open price. the bar number the shares count position entry signal name the signal notes
 
void BuyAtPrice (int barNum, double shares, double price, string signalName, string notes=null)
 Open new long position by the selected price (if it was reached) the bar number the shares count the order price position entry signal name the signal notes
 
void BuyIfLess (int barNum, double shares, double price, string signalName, string notes=null)
 Open new long position if the price is less then the order price. the bar number the shares count the order price position entry signal name the signal notes
 
void BuyIfLess (int barNum, double shares, double price, double?slippage, string signalName, string notes=null)
 Open new long position if the price is less then the order price. the bar number the shares count the order price The slippage. position entry signal name the signal notes
 
void BuyIfGreater (int barNum, double shares, double price, string signalName, string notes=null)
 Open new long position if the price is greater then the order price. the bar number the shares count the order price position entry signal name the signal notes
 
void BuyIfGreater (int barNum, double shares, double price, double?slippage, string signalName, string notes=null)
 Open new long position if the price is greater then the order price. the bar number the shares count the order price The slippage. position entry signal name the signal notes
 
void SellAtMarket (int barNum, double shares, string signalName, string notes=null)
 Open new short position by the bar open price. the bar number the shares count position entry signal name the signal notes created Positon object
 
void SellAtPrice (int barNum, double shares, double price, string signalName, string notes=null)
 Open new short position by the selected price (if it was reached) the bar number the shares count the order price position entry signal name the signal notes
 
void SellIfGreater (int barNum, double shares, double price, string signalName, string notes=null)
 Open new short position if the price is higher then the order price. the bar number the shares count the order price position entry signal name the signal notes
 
void SellIfGreater (int barNum, double shares, double price, double?slippage, string signalName, string notes=null)
 Open new short position if the price is higher then the order price. the bar number the shares count the order price The slippage. position entry signal name the signal notes
 
void SellIfLess (int barNum, double shares, double price, string signalName, string notes=null)
 Open new short position if the price is less then the order price. the bar number the shares count the order price position entry signal name the signal notes
 
void SellIfLess (int barNum, double shares, double price, double?slippage, string signalName, string notes=null)
 Open new short position if the price is less then the order price. the bar number the shares count the order price The slippage. position entry signal name the signal notes
 
void OpenAtMarket (bool isLong, int barNum, double shares, string signalName, string notes=null)
 Open new position by the bar open price. is long position the bar number the shares count position entry signal name the signal notes
 
void OpenAtPrice (bool isLong, int barNum, double shares, double price, string signalName, string notes=null)
 Open new position by the selected price (if it was reached) is long position the bar number the shares count the order price position entry signal name the signal notes
 
void OpenIfLess (bool isLong, int barNum, double shares, double price, string signalName, string notes=null)
 Open new position if the price is less then the order price. is long position the bar number the shares count the order price position entry signal name the signal notes
 
void OpenIfLess (bool isLong, int barNum, double shares, double price, double?slippage, string signalName, string notes=null)
 Open new position if the price is less then the order price. is long position the bar number the shares count the order price The slippage. position entry signal name the signal notes
 
void OpenIfGreater (bool isLong, int barNum, double shares, double price, string signalName, string notes=null)
 Open new position if the price is greater then the order price. is long position the bar number the shares count the order price position entry signal name the signal notes
 
void OpenIfGreater (bool isLong, int barNum, double shares, double price, double?slippage, string signalName, string notes=null)
 Open new position if the price is greater then the order price. is long position the bar number the shares count the order price The slippage. position entry signal name the signal notes
 
IPosition MakeVirtualPosition (int barNum, double shares, double price, string signalName, string notes=null)
 Make new virtual position by the selected price the bar number the shares count (negative value for the short position) the order price position entry signal name the signal notes
 

Properties

bool IsRealtime [get]
 Is this list from real trading (or simulation)?
 
ISecurity Security [get]
 Get the security for this positions list
 
int BarsCount [get]
 The history bars count
 
bool HavePositions [get]
 Indicates that the list has at least one position
 
int ActivePositionCount [get]
 Active positions count
 

Detailed Description

List of Positions

Member Function Documentation

IEnumerable<IPosition> TSLab.Script.IPositionsList.GetClosedOrActiveForBar ( int  barNum)

GetActiveForBar+GetClosedForBar

Parameters
barNumthe bar number Enumeration of positions