Skip to main content

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

MemberTypeDescription
OpenISeries<double>Current input open prices.
HighISeries<double>Current input high prices.
LowISeries<double>Current input low prices.
CloseISeries<double>Current input close prices.
VolumeISeries<double>Current input volume values.
DateTimeISeries<System.DateTime>Current input bar timestamps.
InputISeries<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

MemberDescription
OpensOpen series list by data series index.
HighsHigh series list by data series index.
LowsLow series list by data series index.
ClosesClose series list by data series index.
VolumesVolume series list by data series index.
DateTimesTimestamp series list by data series index.
CurrentBarsBar count by data series index.

Primary data is index 0. Extra series are index 1 and above.

Instrument And Connection

MemberDescription
InstrumentCurrent instrument object.
ConnectionCurrent connection object.
ConnectionNameDisplay name of the active connection.
TickSizeInstrument price increment.
MultiplierInstrument multiplier.
DataSeriesDisplay data series string.

Chart And Drawing

MemberDescription
DrawBuilt-in drawing helper.
CtxStructured script context.
PlotsRuntime plot collection.
IsAutoscaleApplies autoscale behavior to script plots.
BarBrushSets current bar color.
BackBrushAllSets current bar background color.

BarBrush and BackBrushAll are protected, so they are used from inside derived scripts.

Common Methods

MethodPurpose
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:

  • HyperionXPropertyNames
  • HyperionXPropertyCount
  • HyperionXPropertyTypes
  • GetHyperionXPropertyValues()
  • 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:

ContextPurpose
Ctx.ChartVisible range, price range, coordinate transforms, chart invalidation.
Ctx.MarketDataSymbol, candles, depth, bid, ask, spread, bar timing.
Ctx.DrawingFixed HUD text, drawing existence checks, drawing removal.
Ctx.OrdersStrategy order helpers.
Ctx.AccountAccount balances, orders, positions.
Ctx.PositionCurrent position state.
Ctx.LogPrint, info, debug, and error output.
Ctx.RuntimeState, current bar, bars in progress, calculate mode, optimization flag.