rungfolio

No same-bar round trips

sim.no-same-bar-round-trip

What it does

A rung's sell can't fill in the same price bar as its buy. A rung is one price level in the ladder, and in practice mode a bar sums up one minute of trading.

How it works

A price bar records only its open, high, low and close. It doesn't record the order in which they happened.

A rung's buy and sell form an OTO order, so the sell becomes active only after its buy fills. In the simulator, the sell starts working in the bar after its buy's, even when the bar that filled the buy also went past the sell's limit. From then on, the sell fills by the usual rules. If its first bar opens above its limit, it fills at that open, as a gap fill. Otherwise, it fills at its limit, in the first bar that trades through it.

If the bar that filled the buy had already traded through the sell's limit, the sell's "why?" adds this rule's sentence when the sell fills later that session. A sell carried to a later session starts without it.

A buy that fills in the session's last bar leaves its sell to start working at the next session. The sells of lots bought on earlier days work from each session's first bar.

Example

This rung's sell sits much closer to its buy than the TNA template's 3% target would put it, close enough for one bar to reach both. The 9:30 bar trades through the buy, and its high trades through the sell's limit too, but the sell waits. The 9:31 bar trades through the sell, which fills then, with this rule's sentence.

Worked example: 1-minute bars from 9:30 am to 9:31 am, with 1 working buy
BarOpenHighLowCloseFills
Working
Rung 2: Buy 6 TNA @ 81.95 → sell @ 82.20 · GTC OTO
9:30 am82.0082.2581.9082.10

Rung 2 bought 6 shares at 81.95. The 81.95 buy filled because the price traded through it, down to 81.90. Rule: sim.fill-model

9:31 am82.1082.2182.0582.15

Rung 2 sold 6 shares at 82.20. The 82.20 sell filled because the price traded through it, up to 82.21. The bar that filled its buy also traded through this sell's limit, but a sell can't fill in the same bar as its buy, so it waited for a later bar. Rules: sim.fill-model, sim.no-same-bar-round-trip

Cash$50,000.00 before the first bar, $50,001.50 after the last.

Why

Say one bar's low would fill the buy, and the same bar's high would reach the sell. The simulator can't tell whether the high came first. Counting both could invent a profit that never happened.

The same holds when the price shoots up right after a fill. If that rise happens inside the bar that filled the buy, the simulator shows no sale in that bar. A sale can show up only from the next bar on. When a limit order fills covers the rest of the fill rules.

Educational software, not investment advice.