Skip to main content

HX105 Research And Validation

HX105 turns a strategy from code into a research workflow. A strategy is not proven because it compiles or wins one test.

Lesson 1: Backtest Inputs

Before reading results, define:

  • Instrument and connection.
  • Data series type and value.
  • Date range.
  • Commission model.
  • Slippage assumption.
  • Quantity or risk model.
  • Leverage/margin settings when testing perps.

If these are wrong, the results are not useful.

Lesson 2: Metrics

Do not rank by net profit alone. Review:

  • Total trades.
  • Net profit.
  • Max drawdown.
  • Profit factor.
  • Average trade.
  • Average winning trade.
  • Average losing trade.
  • Long/short split.
  • Commission.
  • Time in market.

Low trade count plus high net profit usually means the test needs more data.

Lesson 3: Optimizer Workflow

Use optimizer to explore, not to force-fit.

Good workflow:

  1. Choose two or three parameters.
  2. Use broad ranges first.
  3. Find stable regions, not one perfect value.
  4. Re-test nearby values.
  5. Run out-of-sample dates.
  6. Save results with enough metadata to reproduce the test.

Bad workflow:

  • Optimize every parameter at once.
  • Pick the highest net profit row without checking drawdown.
  • Ignore commissions and slippage.
  • Trust a result with only a few trades.

Lesson 3A: Brute Force vs Genetic

Teach the optimizer types as a tradeoff:

Optimizer typeUse whenRisk
Brute force/defaultThe parameter space is small enough to test every combination.Can be slow when ranges and step counts are large.
GeneticThe parameter space is large and you need fast exploration.May miss edge cases or narrow parameter islands.

For new users, start with small brute-force tests. Use genetic search only after the user understands the parameters and result metrics.

Lesson 3B: In-Sample And Out-Of-Sample

Teach every optimization as two questions:

  • In-sample: what parameters performed best on the training range?
  • Out-of-sample: did those parameters still work on data the optimizer did not use?

If in-sample is strong and out-of-sample is weak, the strategy is likely overfit. The selected parameters should survive outside the range that selected them.

Lesson 3C: Saved Results And Database

Saved optimizer results should preserve:

  • Strategy name.
  • Instrument.
  • Data series.
  • Date periods.
  • Parameter ranges.
  • Chosen optimizer type.
  • Fitness metric.
  • Commission and slippage assumptions.
  • Best parameter rows.
  • In-sample, out-of-sample, and total results.

Users should be able to reopen a saved result and understand exactly what was tested.

Lesson 4: Validator Workflow

Use validator when you need to test:

  • One strategy across many instruments.
  • Many data series combinations.
  • Portfolio-style results.
  • Parameter presets across multiple symbols.

Each validator test set should have a clear purpose. Do not mix unrelated instruments just to get a nicer equity curve.

When reviewing validator results:

  • Start with aggregate performance.
  • Drill into each instrument.
  • Compare long and short trades.
  • Check whether one instrument explains most of the profit.
  • Re-run changed items instead of mixing old and new result states.

Lesson 5: Strategy Debug Checklist

When a strategy does not trade:

  • Confirm Enabled is true.
  • Confirm enough bars loaded.
  • Confirm filters are not blocking all trades.
  • Print signal values before order code.
  • Verify LastPosition.MarketPosition.
  • Confirm account/connection selection.
  • Confirm order quantity is valid for the instrument.
  • Confirm stop/target prices are on the correct side of the market.

When results look wrong:

  • Check tick size and multiplier.
  • Check commission.
  • Check quantity/leverage assumptions.
  • Check whether entries fill on next bar or intra-bar.
  • Check if limit and stop orders are being cancelled too early.
  • Review long and short trades separately.

Lesson 6: Course Capstone

Build a full MA cross system:

  • Fast and slow moving average parameters.
  • Time filter.
  • Optional trend filter.
  • Market entry.
  • Fixed stop and target.
  • Optional break-even move.
  • Optional trailing stop.
  • Strategy plots for entry, stop, and target.
  • Validator test across at least three instruments.
  • Optimizer test across fast/slow periods.

Completion check:

  • The strategy compiles.
  • It trades in simulation/backtest.
  • Validator can run it without null reference errors.
  • Results include realistic fees.
  • The chosen parameters work in more than one date range.