How to run the code in ProRealTime (ProBuilder and ProBacktest)
This guide shows how to run a code file from the ProfitAlgos Strategy Library in ProRealTime and check that the result matches the figures in the file header. The code is a basis for your own studies and coding — always check it in ProRealTime's own editor before you use it.
Applies to CFD and spread betting. The code is written for and tested on price data from CFD and spread betting accounts (IG) — not on futures. Futures have different prices, contract sizes, fees, rollover and trading hours.
Open ProBuilder
Start ProRealTime and open ProBuilder Programming. Create a new strategy (a ProBacktest strategy, not an indicator).
Paste the code
Open the text file from the library, select everything and paste it into the editor. The code is plain ProBuilder text. Press check/verify syntax so the editor confirms that everything can be parsed.
Set the chart and spread
Choose the market and timeframe stated in the file header (for example US Tech 100, 1 hour). Enter the spread in the backtest settings as given at the top of the file. Do not put spread in the code — it should be modelled in one place only.
Choose the start date
Start the backtest at least two weeks into the loaded history. ProRealTime has warm indicators through PRELOADBARS, and a cold start gives different first trades.
Run ProBacktest
Run with a size of 1 contract (as the header describes).
Compare with the header
Compare in this order: number of trades, average win and loss, largest drawdown and, last, total profit. Small differences are normal; the exit of the previous trade can affect the next entry. The label PRT verified means the engine's trades have been compared with a real ProBacktest run.
Export if needed
If you want to compare trade by trade you can export 'Closed positions' from ProBacktest. Note that the export is often limited to the latest 1.000 rows.
Common causes of differences
- Spread in both the settings and the code (it should be in one place).
- A different start date than in the header.
- A different data source or time zone (check the chart's time zone).
- Intrabar order: in a bar where both the stop and the target can be hit, nobody knows which came first.
ProRealTime is a trademark of ProRealTime SAS. The service is not affiliated with, approved by or sponsored by ProRealTime. prorealtime.com