Export to Python

Export a Backtrex strategy as a standalone Python script, checked trade by trade against Backtrex on the last year. Refused and refunded if it does not match.

Overview

The Python export delivers a standalone script that reproduces your strategy. It is the only export Backtrex checks itself, trade by trade.

How it is checked

  1. The AI writes the script from your backtest's version
  2. Backtrex replays it on the last year of data
  3. Its trades must be exactly Backtrex's: same entries, same exits
  4. If they differ, the differences go back to the AI for correction, a few times at most
  5. If the script still does not match, it is not delivered and your gauge is refunded

A delivered script carries the label Checked trade by trade.

Before you export

  • Only a backtested version exports.
  • Exporting counts toward your usage gauge, unless the same export was already written for this backtest. A refused export is refunded.
  • The check takes longer than a Pine Script or MQL5 export.

How to export

  1. Pick the backtest in the backtest menu
  2. Click Export
  3. Choose Python
  4. Click Generate: the AI writes the code, then compares the trades with Backtrex
  5. Click Copy or Download

What the script contains

  • a run(frames) function that takes the candles and returns the closed trades (side, entry time, exit time)
  • only numpy, pandas and math
  • no dependency on Backtrex: run it wherever you like, with your own data

What it is for

  • Auditing your strategy's logic, line by line
  • Replaying it on your own data
  • Starting your own tools from a checked base

With data other than Backtrex's, trades can differ: the check covers Backtrex's Dukascopy data.