HyperionXScript Reference Overview
HyperionXScript is the C# scripting layer inside HyperionX. It is designed for traders who need desktop-grade charting, custom indicators, automated strategies, backtesting, optimization, and broker-connected execution inside one runtime.
This reference is the developer layer of the docs. The high-level product pages explain what the platform does. These pages explain what a script author, strategy developer, or AI coding agent can call.
Core Script Types
| Script type | Namespace | Base class | Purpose |
|---|---|---|---|
| Indicator | HyperionX.Custom.Indicators | Indicator | Calculate and plot chart values. |
| Strategy | HyperionX.Custom.Strategies | Strategy | Generate orders, manage positions, and record performance. |
| Optimizer | HyperionX.Custom.Optimizers | Optimizer base | Search parameter spaces. |
| Optimization fitness | HyperionX.Custom.OptimizationFitnesses | Fitness base | Score optimization results. |
| Money management | HyperionX.Custom.MoneyManagements | Money management base | Control position sizing and strategy capital behavior. |
| Commission | HyperionX.Custom.Commissions | Commission base | Model fees and trading costs. |
| Addon | HyperionX.Custom.Addons | AddonBase | Extend platform behavior. |
Indicators and strategies are the most common script types. Both inherit the same market series, lifecycle state, debug/logging, chart, drawing, and context objects.
Main Runtime Objects
| Object | Available from | Purpose |
|---|---|---|
Open, High, Low, Close, Volume, DateTime | Indicators and strategies | Primary bar series. |
Input | Indicators and strategies | Selected input series, normally close. |
CurrentBar | Indicators and strategies | Current calculation bar. |
BarsInProgress | Multi-series scripts | Current series being processed. |
CurrentBars | Multi-series scripts | Bar counts by series. |
Draw | Indicators and strategies | Built-in chart drawing helper. |
Ctx | Indicators and strategies | Structured chart, data, order, account, position, log, and runtime context. |
Plots | Indicators and strategies | Plot appearance and data source collection. |
LastPosition | Strategies | Strategy position state. |
SystemPerformance | Strategies | Backtest and live performance summary. |
What Makes HyperionX Different
HyperionXScript runs inside a native C#/.NET desktop trading platform. That matters because complex trading systems need more than a browser chart and a few webhook alerts.
HyperionX is built to support:
- Local strategy development and compile diagnostics.
- Direct chart visualization while coding.
- Multi-account and broker-aware strategy execution.
- Historical research, validation, and optimization workflows.
- Order-flow and depth-aware tools.
- Local AI assistant and agent workflows.
- Local API surfaces for safe automation and context sharing.
The goal is not to copy another platform method for method. The goal is to provide a professional C# trading runtime with clear compatibility paths for imported indicators and strategies.
Compatibility Rule
When porting from another platform, use HyperionX APIs.
Do not paste unsupported external-platform calls such as:
Draw.TextFixedTextPositionIsOverlay- external generated support/cache regions
- external order helpers that HyperionX does not implement
If a feature is missing, add it deliberately to HyperionX or rewrite the script around an existing HyperionX API.
Reference Map
Use these pages as the working reference:
- Lifecycle: states, update methods, and calculation timing.
- Common script base: inherited data, chart, logging, and context members.
- Series and bars: primary, custom, and extra data series.
- Indicators: plots, panes, generated helpers, and display behavior.
- Strategies and orders: managed entries, exits, OCO, stops, targets, and account state.
- Drawing API:
Drawmethods, tags, fixed HUD text, and cleanup. - Chart rendering: custom overlays through
IChartOverlayRenderer. - Market data: candles, ticks, bid/ask, depth snapshots, and provider support.
- Optimization modules: fitness, money management, commissions, and island penalty concepts.
- Migration: practical NinjaScript-to-HyperionXScript mapping.
- Examples: starter patterns for real scripts.
- Troubleshooting: compile errors, missing helpers, disabled indicators, and runtime issues.