Skip to content

99 Reference FAQ

Łukasz Rafał Czarnacki edited this page Mar 9, 2026 · 2 revisions

FAQ

Why does my backtest open zero trades?

Most common causes:

  • entry_threshold too high
  • allow_long or allow_short disabling one or both directions
  • indicator or signal outputs are mostly NaN in the selected range

Check result.df[['signal_strength']].describe() and threshold values first.

Why do I see NaN values at the start of columns?

This is expected for rolling windows (EMA, RSI, etc.) and for lagged features. Warm-up bars need history before values are defined.

Should I call _compute() directly?

No. Use compute(df). compute handles orchestration and lag shifting or renaming.

When should I use run_on(df) instead of run()?

Use run_on(df) when data is already prepared, for example optimization loops, Monte Carlo runs, or custom data sources. Use run() when the engine should fetch data from Yahoo Finance.

How do I reduce look-ahead leakage?

Use lag on signals and indicators so features at bar t only use information from bars < t.

When should I use ExternalSignal?

Use ExternalSignal when the feature already exists as a column in your DataFrame, for example VIX, rates, macro releases, or sentiment indices merged from another source.

It is intended for ML feature pipelines. It does not implement to_signal_strength() and therefore should not be used inside StandardStrategy.

Why does optimization create files in optuna_studies/?

When n_jobs > 1, the Optuna-based optimizers switch to SQLite-backed storage for safe parallel workers.

MQL5 export says the model is invalid. What should I check?

Start with:

  • strategy is MLStrategy
  • model is wrapped in KerasModelWrapper
  • final Dense layer has exactly 1 output unit
  • input_names is non-empty
  • required extras are installed (.[mql5] or .[onnx])

Which generated files do I deploy to MT5 for ONNX export?

Deploy both:

  • generated .mq5 EA file
  • generated .onnx file (copy to MQL5\Files\)

Why does ONNX export fail on Python 3.13?

The current TensorFlow and tf2onnx dependency chain does not install cleanly there yet. Use Python 3.10-3.12 for the ONNX export workflow.

Clone this wiki locally