TSLab API Docs  1
TSLab.Script.Handlers.IContext Interface Reference

Script context interface More...

Inheritance diagram for TSLab.Script.Handlers.IContext:
TSLab.Script.Handlers.IWindow TSLab.Script.Handlers.IBaseChartPaneContext TSLab.Script.Handlers.IMemoryContext

Public Member Functions

IList< Double2GetData (string handlerName, string[] parameters, CacheObjectMaker< IList< Double2 >> maker)
 Get/Generate some Double2 stored data from cache handler name handler parameters data generator data
 
IList< double > GetData (string handlerName, string[] parameters, CacheObjectMaker< IList< double >> maker)
 Get/Generate some double stored data from cache handler name handler parameters data generator data
 
IList< bool > GetData (string handlerName, string[] parameters, CacheObjectMaker< IList< bool >> maker)
 Get/Generate some boolean stored data from cache handler name handler parameters data generator data
 
IList< int > GetData (string handlerName, string[] parameters, CacheObjectMaker< IList< int >> maker)
 Get/Generate some int stored data from cache handler name handler parameters data generator data
 
ITradesCache GetTradesCache (ISecurity security)
 
ITradeStatistics GetTradeStatistics (string id, Func< ITradeStatistics > maker)
 get trade statistics identifier maker trade statistics
 
ILastContractsTradeStatistics GetLastContractsTradeStatistics (string id, Func< ILastContractsTradeStatistics > maker)
 get last contracts trade statistics identifier maker last contracts trade statistics
 
new void StoreObject (string key, object data, bool toStorage=false)
 Store object from the cache the key the object use the permanent storage (disk drive)
 
new object LoadObject (string key, bool fromStorage=false)
 Load object from the cache the key the object or null gets from the permanent storage (disk drive)
 
new T LoadObject< T > (string key, CacheObjectMaker< T > maker, bool fromStorage=false)
 Load object from the cache the key data generator the object or null gets from the permanent storage (disk drive)
 
new void AddUnremovableInteractiveObjectId (string id)
 add unremovable interactive object identifier identifier
 
new bool ContainsUnremovableInteractiveObjectId (string id)
 contains unremovable interactive object identifier identifier
 
new bool ContainsGhostInteractiveObjectId (string id)
 contains ghost interactive object identifier identifier
 
new bool RemoveGhostInteractiveObjectId (string id)
 remove the ghost interactive object identifier identifier
 
void StoreGlobalObject (string key, object data, bool toStorage=false)
 Store object from the global cache the key the object use the permanent storage (disk drive)
 
object LoadGlobalObject (string key, bool fromStorage=false)
 Load object from the global cache the key the object or null gets from the permanent storage (disk drive)
 
LoadGlobalObject< T > (string key, CacheObjectMaker< T > maker, bool fromStorage=false)
 Load object from the global cache the key data generator the object or null gets from the permanent storage (disk drive)
 
void Log (string text, Color color)
 Add new message to log window the message text the message color (Obsolete)
 
void Log (string text, Color color, bool toMessageWindow)
 Add new message to log window the message text the message color (Obsolete) print to message window
 
void Log (string text, Color color, bool toMessageWindow, IDictionary< string, object > context)
 Add new message to log window the message text the message color (Obsolete) print to message window message context
 
void Log (string text, MessageType type=MessageType.Info, bool toMessageWindow=false, IDictionary< string, object > context=null)
 Add new message to log window the message text the message type (priority) print to message window message context
 
void ClearLog ()
 Clear the script|agent log window
 
IWindow AddWindow (string name, string title)
 Add new window More...
 
void Recalc ()
 Initiate the script recalculation. More...
 
- Public Member Functions inherited from TSLab.Script.Handlers.IWindow
IGraphPane CreatePane (string title, double sizePct, bool hideLegend, bool addToTop=false)
 Create new graph pane pane name pane size true if legend should be hided add to top or bottom
 
IGraphPane CreateGraphPane (string name, string title, bool addToTop=false)
 Create new graph pane pane name pane title add to top or bottom
 
ICanvasPane CreateCanvasPane (string name, string title, bool addToTop=false)
 Create new canvas pane pane name pane title add to top or bottom
 
IControlPane CreateControlPane (string id, string name, string title, bool addToTop=false)
 Create new control pane pane id pane name pane title add to top or bottom
 
IDataGridPane CreateDataGridPane (string name, string title, int displayIndexValueX, string formatValueX, string headerValueX, bool isVisibleValueX, TextAlignment textAlignmentValueX, int?widthValueX, int displayIndexDateTime, string formatDateTime, string headerDateTime, bool isVisibleDateTime, TextAlignment textAlignmentDateTime, int?widthDateTime, bool addToTop=false)
 Create new canvas pane pane name pane title display index value x format value x header value x is visible value x text alignment value x width value x display index date-time format date-time header date-time is visible date-time text alignment date-time width date-time add to top or bottom
 
- Public Member Functions inherited from TSLab.Script.Handlers.IBaseChartPaneContext
double GetGraphPaneSize (string graphPaneName)
 get graph pane size graph pane name graph pane size
 
void SetGraphPaneSize (string graphPaneName, double value)
 set graph pane size graph pane name value
 
- Public Member Functions inherited from TSLab.Script.Handlers.IMemoryContext
T[] GetArray< T > (int count)
 
void ReleaseArray (Array array)
 

Properties

bool IsFixedBarsCount [get]
 Is fixed bars count mode.
 
new bool IsOptimization [get]
 Shows that optimization is now processing
 
int TradeFromBar [get]
 Shows bar for trading start.
 
bool IsLastBarUsed [get]
 Is last bar used for the trading signals generation or not.
 
bool IsLastBarClosed [get]
 Is last bar closed.
 
double ScriptResult [get, set]
 Some user calculated result which can be used as optimization result More...
 
IRuntime Runtime [get]
 Get IRuntime object More...
 
- Properties inherited from TSLab.Script.Handlers.IWindow
string Name [get]
 Chart's pane name
 
string Title [get]
 Chart's pane title
 
IGraphPane First [get]
 Returns the first created chart pane
 
IList< IBasePanePanes [get]
 Returns enumeration of the chart panes
 
int BarsCount [get]
 Get available candles count.
 
IContext Context [get]
 Get IContext instance for the script
 
- Properties inherited from TSLab.Script.Handlers.IBaseChartPaneContext
bool IsOptimization [get]
 Shows that optimization is now processing
 

Detailed Description

Script context interface

Member Function Documentation

IWindow TSLab.Script.Handlers.IContext.AddWindow ( string  name,
string  title 
)

Add new window

Parameters
namethe window name
titlethe window title
Returns
the IWindow instance
void TSLab.Script.Handlers.IContext.Recalc ( )

Initiate the script recalculation.

Property Documentation

IRuntime TSLab.Script.Handlers.IContext.Runtime
get

Get IRuntime object

double TSLab.Script.Handlers.IContext.ScriptResult
getset

Some user calculated result which can be used as optimization result