Common ScriptBase Reference
Indicators and strategies inherit common behavior from the HyperionX script base. This page covers the shared members used by both.
Primary Series
| Member | Type | Description |
|---|---|---|
Open | ISeries<double> | Current input open prices. |
High | ISeries<double> | Current input high prices. |
Low | ISeries<double> | Current input low prices. |
Close | ISeries<double> | Current input close prices. |
Volume | ISeries<double> | Current input volume values. |
DateTime | ISeries<System.DateTime> | Current input bar timestamps. |
Input | ISeries<double> | Selected input series. |
Use System.DateTime.Now or System.DateTime.UtcNow for clock time. In script context, DateTime is the bar timestamp series.
Multi-Series Collections
| Member | Description |
|---|---|
Opens | Open series list by data series index. |
Highs | High series list by data series index. |
Lows | Low series list by data series index. |
Closes | Close series list by data series index. |
Volumes | Volume series list by data series index. |
DateTimes | Timestamp series list by data series index. |
CurrentBars | Bar count by data series index. |
Primary data is index 0. Extra series are index 1 and above.
Instrument And Connection
| Member | Description |
|---|---|
Instrument | Current instrument object. |
Connection | Current connection object. |
ConnectionName | Display name of the active connection. |
TickSize | Instrument price increment. |
Multiplier | Instrument multiplier. |
DataSeries | Display data series string. |
Chart And Drawing
| Member | Description |
|---|---|
Draw | Built-in drawing helper. |
Ctx | Structured script context. |
Plots | Runtime plot collection. |
IsAutoscale | Applies autoscale behavior to script plots. |
BarBrush | Sets current bar color. |
BackBrushAll | Sets current bar background color. |
BarBrush and BackBrushAll are protected, so they are used from inside derived scripts.
Common Methods
| Method | Purpose |
|---|---|
AddDataSeries(DataSeriesType type, int value, string symbol = "") | Adds a secondary series or instrument. |
AddSeries(ISeries<double> series) | Registers a custom output series. |
AddPane(string paneName = "") | Creates a chart pane. |
AddPanePlot(Plot plot) | Adds a plot, normally to a pane. |
AddPanePlot(PaneControl pane, Plot plot) | Adds a plot to a specific pane. |
RemovePlots() | Removes plots owned by the script. |
RemovePanes() | Removes panes owned by the script. |
InvalidateChart() | Recalculates chart extremes and redraws. |
InvalidateChartVisual() | Redraws without recalculating candle or indicator scale state. |
Print(object message) | Writes to debug output. |
Log(object message) | Writes to platform log output. |
ClearDebug() | Clears debug messages. |
SendMail(string to, string subject, string body) | Sends email through configured email service. |
ToTime(System.DateTime time) | Converts time to integer time format. |
HyperionX Properties
Use [HyperionXProperty] for editable parameters.
[HyperionXProperty]
[Display(Name = "Period", GroupName = "Parameters", Order = 1)]
public int Period { get; set; }
The runtime tracks:
HyperionXPropertyNamesHyperionXPropertyCountHyperionXPropertyTypesGetHyperionXPropertyValues()GetHyperionXPropertyValue(...)SetHyperionXPropertyValue(...)
These are mostly used by property grids, optimizers, validation workflows, and AI tooling.
Structured Context
Ctx is the newer structured API. It groups script capabilities by intent:
| Context | Purpose |
|---|---|
Ctx.Chart | Visible range, price range, coordinate transforms, chart invalidation. |
Ctx.MarketData | Symbol, candles, depth, bid, ask, spread, bar timing. |
Ctx.Drawing | Fixed HUD text, drawing existence checks, drawing removal. |
Ctx.Orders | Strategy order helpers. |
Ctx.Account | Account balances, orders, positions. |
Ctx.Position | Current position state. |
Ctx.Log | Print, info, debug, and error output. |
Ctx.Runtime | State, current bar, bars in progress, calculate mode, optimization flag. |