Skip to content

Known issue: some supplied arguments are ignored or shifted in v1.10.0 #326

Closed

Description

@luisleo526

Scope

These problems are confirmed in v1.10.0. The earlier release boundary has not been established. Affected forms: none found in our corpus in the checked snapshot. This search does not establish their use in other scripts.

Effect

The measured forms below can silently ignore or shift an argument. Each workaround was run alongside the affected form on the release engine. The timeframe, trade-index, history-depth and formatting examples used 1,500 bars of a 15-minute chart; the values describe those examples.

  • timeframe.in_seconds("D") returns 86,400 seconds, while timeframe.in_seconds(timeframe = "D") uses the chart's 15-minute timeframe and returns 900. The equivalent timeframe.change("D") form changes on 15 daily boundaries; its timeframe = form changes on 1,499 bars. Use the positional timeframe argument.
  • strategy.closedtrades.profit(1) and strategy.opentrades.entry_price(1) return the second trade/open trade in the traced controls. The trade_num = 1 forms read trade/open-trade index 0 instead. Use the positional trade index.
  • max_bars_back(close, 800) supplies the requested depth. A const-name depth (const int DEPTH = 800, then max_bars_back(close, DEPTH)) is ignored: the traced static offset has 800 values with the literal and no values with the const name; the dynamic offset has 0 versus 400 na values. Use a literal depth; no broader dynamic-depth workaround is verified.
  • str.format_time(time, timezone = "UTC") shifts the timezone into the format argument. The trace measured a result length of 3, compared with 24 for the positional control. Workaround: supply both the format and timezone positionally, as in str.format_time(time, "yyyy-MM-dd'T'HH:mm:ssZ", "UTC"). The control's output length was 24 on every traced bar; avoid the keyword form for this argument.
  • strategy.risk.max_drawdown() with type = strategy.percent_of_equity, or that constant held in a variable, behaves as the cash form. In a strategy with entries from a flat position, a value of 10 produced 32 trades, compared with 34 for strategy.risk.max_drawdown(10, strategy.percent_of_equity) and the control. The first missing entry was at 2020-01-16 07:00 UTC. With a value of 3, the first missing entry was at 2020-01-02 13:00 UTC, with 5 versus 34 trades. Workaround: pass the literal percentage constant positionally. These times identify missing entries in the example, not when an internal halt flag was set.
  • strategy.risk.max_intraday_loss() with type = strategy.percent_of_equity, or that constant held in a variable, likewise behaves as the cash form. The keyword and variable forms produced 66 trades and were flat for 84 bars where the positional percentage control remained in position; the first position difference was at 2020-01-15 03:45 UTC. strategy.risk.max_intraday_loss(10, strategy.percent_of_equity) matched the 69-trade control. Workaround: pass the literal percentage constant positionally.

Workaround and resolution

Use the specific positional forms above, or a literal depth for max_bars_back. These results do not establish a workaround for other argument forms. A correction is being prepared for the next release.

Activity

  1. luisleo526 commented on Nov 9, 2026

    @luisleo526
    ContributorAuthor

    Fixed in v1.11.0: the arguments that were ignored or shifted in v1.10.0 are handled in v1.11.0. If one of the forms you reported still behaves differently on v1.11.0, please reply here with the script and we will reopen. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions