Skip to main content

HX111 Production Code Lab Workflow

HX111 teaches the production workflow for custom scripts. HyperionX Code Lab scripts are runtime assets, so the build path, validation path, generated helpers, and logs matter.

Lesson 1: Script Policy

Before writing or editing custom scripts, follow the HyperionX script policy.

Rules:

  • Write HyperionX scripts, not scripts for another trading platform.
  • Check local HyperionX APIs before using a method.
  • Use [HyperionXProperty] for user-editable settings.
  • Use State.SetDefaults and State.Configured correctly.
  • Avoid unsupported namespaces and drawing calls.
  • Compile after edits and fix every error.

The policy prevents copied code from introducing fake APIs.

Lesson 2: Code Lab Build Path

The Code Lab build path is the app's authoritative hot-reload path.

Teach:

  • Save source.
  • Compile in Code Lab.
  • Read diagnostics.
  • Fix errors and warnings that affect behavior.
  • Confirm the script appears in the indicator or strategy list.
  • Add it to a chart or research window.
  • Verify it survives reload/recompile.

External editor builds are useful, but the open app uses its runtime custom assembly.

Lesson 3: Runtime Validation

Runtime validation should catch script problems before the user loads a script on a chart.

Validate:

  • Runtime custom script folder.
  • Indicator compile.
  • Strategy compile.
  • Generated helper compatibility.
  • Missing references.
  • Invalid namespaces.
  • Unsupported drawing/rendering APIs.
  • Null/default property issues.

The goal is to prevent chart freezes and unreadable error popups from bad scripts.

Lesson 4: Generated Helpers

Generated helper code lets indicators be called from indicators and strategies.

Teach:

  • Do not hand-copy generated regions from other platforms.
  • Let HyperionX generate its own helper wrappers.
  • Keep public properties stable when scripts are used by strategies.
  • Avoid renaming output series without updating dependent scripts.
  • Use overloads intentionally when supporting custom input series.

Generated helper errors usually point to a script contract issue.

Lesson 5: Script Diagnostics

When a script fails:

  1. Read the first compiler error.
  2. Confirm the namespace and using statements.
  3. Confirm referenced types exist in HyperionX.
  4. Confirm property types are supported by the property grid.
  5. Confirm drawing/rendering calls exist.
  6. Confirm output series are initialized before use.
  7. Confirm CurrentBar and CurrentBars guards.
  8. Rebuild.

Do not chase later errors before fixing the first real error.

Lesson 6: Logging And Support

Logs are part of the developer workflow.

Teach:

  • Use concise debug output.
  • Remove noisy prints before sharing scripts.
  • Export logs for support.
  • Include build diagnostics with bug reports.
  • Include the script name, version, and exact action that failed.
  • Do not include API secrets or wallet/private keys.

Lesson 7: Production Script Checklist

Before sharing or relying on a script:

  • Compiles through Code Lab.
  • Loads on a chart.
  • Handles short histories.
  • Handles scroll/zoom/resize if it renders.
  • Does not freeze the chart.
  • Does not modify collections while enumerating.
  • Removes only its own drawings.
  • Has clear parameter groups.
  • Has useful defaults.
  • Works in dark and light themes if it displays UI.

Completion check:

  • User can compile and hot-reload scripts through the app.
  • User can distinguish runtime validation from external editor builds.
  • User can fix missing API/reference errors by checking HyperionX source/docs.
  • User can produce a supportable script bug report with diagnostics and logs.