Skip to content

Bug: OHLC_RSI strategy executes 0 trades despite processing ticks #27

@mccaffers

Description

@mccaffers

Description
When running the backtesting engine with the OHLC_RSI strategy over a 1-month period for EURUSD, the engine successfully streams ticks but fails to execute any trades.

Steps to Reproduce

  1. Run the Executable BacktestingEngine.
  2. Provide the following JSON configuration for the run:
{
  "RUN_ID": "UNIQUE_IDENTIFIER",
  "SYMBOLS": "EURUSD",
  "LAST_MONTHS": 1,
  "STRATEGY": {
      "UUID": "",
      "TRADING_VARIABLES": {
          "STRATEGY": "OHLC_RSI",
          "STOP_DISTANCE_IN_PIPS": "1.5",
          "LIMIT_DISTANCE_IN_PIPS": "1.5",
          "TRADING_SIZE": "0.01"
      },
      "OHLC_VARIABLES": [
          {
              "OHLC_COUNT": 60,
              "OHLC_MINUTES": 100
          }
      ],
      "STRATEGY_VARIABLES": {
        "OHLC_RSI_VARIABLES": {
            "RSI_LONG": 60,
            "RSI_SHORT": 40
        }
      }
  }
}

Expected Behavior
The backtesting engine should evaluate the OHLC_RSI conditions against the streamed ticks, execute trades based on the strategy parameters, and output a list/count of executed trades.

Actual Behavior
The engine streams the data successfully but executes 0 trades.

Console Output:

Executable BacktestingEngine found in build.
UNIQUE_IDENTIFIER
Executing query: SELECT 'EURUSD' as symbol, * FROM 'EURUSD' WHERE timestamp >= dateadd('M', -1, now()) ORDER BY timestamp
Total ticks streamed: 1187044
Final PnL: -1694.70
Execution time: 1313ms

Note/Clue for debugging: Despite no trades being executed (or logged), the engine outputs a Final PnL: -1694.70. This might indicate that trades are firing under the hood but are failing validation/logging, or there is an error in how the initial balance/PnL is being calculated.

Environment / Context:

  • Symbol: EURUSD
  • Data Volume: 1,187,044 ticks streamed (1 month of data)
  • Execution Time: ~1313ms

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

Status

In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions