Soon available

Not on the Chrome Web Store yet

ProRealCode Studio is on its way. As soon as it is published, this button will take you straight to its Chrome Web Store page.

Chapter 15 · Part III — On the chart

Take your chart back in time. Walk it forward bar by bar.

Bar replay stops your chart on a bar of the past and hides what came after. Step forward, or let it play, and watch your codes react as if each bar had just closed. On the way, practise buying and selling with paper trades.

  1. 01Start and move The replay strip and its keys.
  2. 02Read what you see Speed, forming bars, the curtain.
  3. 03Practise a trade Buy, Sell, Close.
  4. 04The paper book What it keeps, and for how long.
The Bar replay strip: transport buttons, a speed list on 1 bar/s, a slider, the date 2026-03…, bar 2843 of 3…, an arrow, Live and a cross; under them a SYNTHETIC chip with 1d bars · 1 bar/s · 24 ticks/bar; then Buy, Sell, a size of 1, equity 10000.00 · open 0 (+0.00) · closed 0, Trades, Close all and Reset.
The replay strip on a daily chart, before any trade.
What replay is notA paper trade stays inside Studio, in this browser tab. No order reaches ProRealTime or a broker, and your codes cannot place one during replay. The alerts of your codes stay silent while you replay: a crossing from last March does not ring today.
ProRealCode StudioUser guide · Chapter 15
Task 1 · Start and move

Open the strip, and the chart is already in the past.

The Bar replay strip, the same as on the previous page. 1 2 3 4 5 6 7
The top two lines of the strip. The paper-trading line under them is task 3.
  1. The four transport buttons: first loaded bar, one bar back, play / pause, one bar forward. ⠿ on their left moves the strip.
  2. Speed. Task 2.
  3. The slider. Drag it to jump to any bar. Playback stops while you drag.
  4. Where you are: the replay bar's date, and “bar 2843/3…”, its number out of the bars loaded.
  5. The arrow. Click it, then click a bar on the chart: replay restarts there.
  6. “Live” leaves replay and gives the chart back to the live prices. The × after it also closes the strip.
  7. The pace line and its “SYNTHETIC” chip. Task 2.
  1. Click the clock with a backward arrow on the rail, or the “Bar replay” row of the ƒ launcher.The strip appears at the top of the screen, and the chart stops on a bar about a third of the way into what you see. A note says so under the strip.
  2. Click the arrow, then the bar you want to start from.“restarted at …” and the date. Everything right of that bar is covered.
  3. Step with Shift + → and Shift + ←, or play with Shift + ↓.One bar at a time, your codes recompute as if that bar had just closed.
  4. Click “Live” when you are done.“back on the live chart — ▶ re-enters replay where you left it”. The strip stays open until you close it.

The keys work only while replaying, and not while the cursor is in a text field. Replay needs a chart with at least 5 bars, and runs on one chart at a time.

ProRealCode StudioUser guide · Chapter 15
Task 2 · Read what you see

Bars form tick by tick. The ticks are invented.

Speed

The list adapts to the chart. On an intraday chart, speed is a multiple of market time: at 1×, a 5-minute bar takes 5 minutes. Nights and weekends are skipped at once. On a daily chart or longer, and on tick or range charts, speed is in bars per second.

ChartSpeeds offered
Intraday0.5×, 1×, 2×, 5×, 10×, 60×, 300×
Daily and longer, tick, range0.5, 1, 2, 5, 20 bars/s

The pace line

“1d bars · 1 bar/s · 24 ticks/bar”: daily bars, one per second, each formed in 24 steps. At high speed it reads “closes only (no room for ticks)” and bars appear closed. “off screen” on the readout: the replay bar left the view; scroll the chart yourself.

“SYNTHETIC”Its tooltip says it in full: “the path a bar takes between its open and its close is not recorded anywhere — this one is synthesised from the bar's OHLC. The high and the low really were reached; the order and the moment shown are ours, not the market's.”
You seeWhy
A dark curtain over the right of the chartThe bars after the replay bar are still on the platform's chart; Studio covers them. The platform's own indicators are covered with them.
Your codes stop at the replay barThey are computed on the bars up to that one only. Walking forward gives the same values as if that history had been computed in one go.
Playback stops at the right edge“reached the last loaded bar”. “Live” takes you back to the present.
“instrument or timeframe changed — replay stopped”You switched the chart. Replay belongs to one instrument and one timeframe.
ProRealCode StudioUser guide · Chapter 15
Task 3 · Practise a trade

Buy on the replay bar. Step forward. Watch it work, or not.

The replay strip over the chart with one paper trade open: Buy and Sell, a size of 1, equity 10000.00 · open 1 (+0.00) · closed 0, Trades pressed, Close all, Reset, and the row LONG 1 @ 1.1577 · 2026-03-19, +0.00, Close. On the chart, a green triangle under a candle and a blue vertical line, with nothing drawn to its right. 1 2 3 4 5 6 7 8
One long position open on Spot EUR/USD, daily. Captured with the platform in dark mode.
  1. The open trade: “LONG 1 @ 1.1577”, its entry date, its result, and “Close” to exit it.
  2. “Buy” and “Sell” open a long or a short position.
  3. Size of the next trade. 1 to start with.
  4. The account: equity, open trades and their result, closed trades.
  5. “Trades” shows or hides the list of positions, open and closed.
  6. “Close all” exits every open position on this bar. “Reset” empties the book.
  7. The entry, the green triangle left of the pin. An exit adds a hollow one and a dotted line.
  8. The replay bar, the blue line. Studio covers everything to its right.
  1. Set the size, then click “Buy” or “Sell”.The trade opens at the price the replay bar shows now: its close, or the current tick while it forms.
  2. Step forward, then click “Close” on the trade's row.Its result moves with each new price, then is banked. The row stays in “Trades” as a closed trade.
ProRealCode StudioUser guide · Chapter 15
Task 4 · The paper book

An exercise, not a record. It lasts as long as the tab.

QuestionAnswer
Opening balance10,000. “Reset” brings it back and empties the list.
In which unit?In money when the platform gives the instrument's point value; otherwise in points, marked “pts”.
Does “Sell” close my long?No. “Sell” opens a separate short. To exit a long, use “Close” on its row or “Close all”.
When do I lose the book?When you click “Reset”, or reload the page. Leaving replay, or switching instrument, keeps it; trades on different instruments then show their symbol.
Can I trade on the live chart?No. “Buy”, “Sell” and “Close all” are greyed outside replay.
Is it a backtest?No. Your codes do not trade here; you do, by hand. To test a strategy written in code, see chapter 18.

Two curves, two questions

“Equity (marked to market)” moves on every bar a position is open: it shows the heat a trade put you through. “Balance (realised)” stays flat while you hold and steps at each exit: it is what you actually banked. Between trades the two lines coincide.

Coming back later

Reopen the strip on the same instrument and timeframe and replay resumes where you were, as long as that bar is on screen: “resumed the saved replay session for this chart”. The paper book does not survive a reload.

The Paper trading panel under the chart: a grey line Balance (realised) and a blue line Equity (marked to market), flat, then rising at the right end.
The “Paper trading” panel: “Balance (realised)” in grey, “Equity (marked to market)” in blue.
Nothing here is sent anywhereA paper trade is written in a book kept by Studio in this browser tab, and nowhere else. It never reaches ProRealTime, a broker or your account, and it is not investment advice: a result made on synthetic ticks, with hindsight one click away, says little about a live trade.
ProRealCode StudioUser guide · Chapter 15
Chapter 15 · In short

Pick a bar, step forward, trade on paper, go back to Live.

The strip takes one chart into the past and covers the bars to come. Your codes see only what was known on the replay bar, and their alerts stay quiet. Paper trades open at the replay price and live in this tab until “Reset” or a reload.

While replayingDoes
Shift + ↓Play / pause
Shift + →One bar forward
Shift + ←One bar back

The chart is all dark.

The replay bar is off screen to the left, or the curtain covers what you look at. Click the arrow and pick a bar in view, or scroll the chart.

The keys do nothing.

Replay is not running: after “Live”, click ▶ to go back in. Or the cursor is in a text field, the editor for instance.

My code shows a value the live chart never had.

Inside a forming bar the ticks are synthetic, so a mid-bar crossing can appear that the market never made. Look at the bar once it has closed.

Replay stopped by itself.

The instrument or the timeframe changed, or the chart you replayed stopped being the target chart (chapter 04).

My paper trades are gone.

The page was reloaded, or “Reset” was clicked. The book is kept for the life of the tab only.

Can I replay two charts together?

No. Replay runs on one chart at a time; the others keep their live prices.

Next

Chapter 16 · Alerts from your codes

Make a code tell you when its condition is met, with a sound, a window or a desktop notification.

ProRealCode StudioUser guide · Chapter 15
ProRealCode ProRealCode
Loading...