Skip to main content

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 typeNamespaceBase classPurpose
IndicatorHyperionX.Custom.IndicatorsIndicatorCalculate and plot chart values.
StrategyHyperionX.Custom.StrategiesStrategyGenerate orders, manage positions, and record performance.
OptimizerHyperionX.Custom.OptimizersOptimizer baseSearch parameter spaces.
Optimization fitnessHyperionX.Custom.OptimizationFitnessesFitness baseScore optimization results.
Money managementHyperionX.Custom.MoneyManagementsMoney management baseControl position sizing and strategy capital behavior.
CommissionHyperionX.Custom.CommissionsCommission baseModel fees and trading costs.
AddonHyperionX.Custom.AddonsAddonBaseExtend 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

ObjectAvailable fromPurpose
Open, High, Low, Close, Volume, DateTimeIndicators and strategiesPrimary bar series.
InputIndicators and strategiesSelected input series, normally close.
CurrentBarIndicators and strategiesCurrent calculation bar.
BarsInProgressMulti-series scriptsCurrent series being processed.
CurrentBarsMulti-series scriptsBar counts by series.
DrawIndicators and strategiesBuilt-in chart drawing helper.
CtxIndicators and strategiesStructured chart, data, order, account, position, log, and runtime context.
PlotsIndicators and strategiesPlot appearance and data source collection.
LastPositionStrategiesStrategy position state.
SystemPerformanceStrategiesBacktest 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.TextFixed
  • TextPosition
  • IsOverlay
  • 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: Draw methods, 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.