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
- The AI writes the script from your backtest's version
- Backtrex replays it on the last year of data
- Its trades must be exactly Backtrex's: same entries, same exits
- If they differ, the differences go back to the AI for correction, a few times at most
- 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
- Pick the backtest in the backtest menu
- Click Export
- Choose Python
- Click Generate: the AI writes the code, then compares the trades with Backtrex
- 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,pandasandmath - 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.