# region declaration
schema_version: '1.0'
metadata:
  name: book_compiled_walk_forward
  mode: development
sfd:
  manifest:
    type: ml
    data_source:
      method: limen.data.HistoricalData.get_any_file
      params:
        file_path_or_url: inputs/spot_1h_20240101_20240116.parquet
    indicators:
    - func: limen.indicators.roc
      params:
        period: 1
        group: momentum
    target:
      name: quantile_flag
      class: limen.targets.QuantileBinaryTarget
      fit_params:
        source_column: roc_1
        quantile: 0.5
      transform_params:
        shift: -1
    backtest:
      fee_bps: 7.0
      slip_bps: 3.0
      notional_rate: 0.5
      product:
        kind: cash_spot
        instrument: BTCUSDT
        base_currency: BTC
        quote_currency: USDT
        quantity_step: 1e-09
        min_notional: 0
      source_interval_seconds: 3600
    scaler:
      from_params: scaler_type
    reference_architecture: limen.sfd.reference_architecture.logreg_binary
    split_walk_forward:
      n_folds: 2
      test_bars: 48
      purge_bars: 4
      embargo_bars: 3
      anchored: true
    calibration:
      probability_calibration:
        func: limen.calibration.sklearn_probability_calibrator
        params:
          method: sigmoid
      threshold_function:
        func: limen.calibration.grid_threshold_optimizer
        params: {}
    objective:
      metric: backtest_total_return
      direction: maximize
  params:
    scaler_type: [logreg]
    C:
    - 1.0
    random_state: [42]
uel:
  record_execution: true
  output_path: compiled-walk_forward
  n_permutations: 1
  search_strategy:
    type: grid
  output_format: csv
  checkpoint_interval: 1
  recording:
    predictions: true
    alignment: true
    trade_ledger: true
    fold_details: true

assessment:
  metric: val_backtest_total_return
  direction: maximize
  top_k: 1
  folds: [0, 1]
  predict: true
  inference_source: inputs/spot_1h_20240101_20241231.parquet
# endregion declaration
