Tool
Michael Square
calc.michael
Inputs
The base leg (leg.zigzag). Its start pivot is p1 (drives the ratio), its end pivot p2; the last confirmed leg is forward-filled so outputs stay dense after the first match bar.
First price of the synthetic vertical leg — it drives the ratio (power-of-10 threshold of p1/360). Wire any per-bar price source.
Second price of the synthetic vertical leg — the other boundary of the squared range.
Outputs
A bundle of five Points plus the ratio: valid, the corners a1 (leg start), a2 (leg end), c3 (closes the square off a2), c4 (off a1), and cross (the diagonals' intersection — the centroid). Every Point carries price AND time (plus bar index and pivot type): wire one into the Point Interpretor — its out.price (SCALAR num.price) feeds ORDER_EXIT TP/SL, its out.time feeds duration math. c3/c4/cross usually land between bars or in the future: bar_index rounds to the nearest bar while time_epoch keeps the exact position. ratio is num.price_per_bar (not a price). This diagram shows a DOWN leg — the square extends above-right; the hero shows the up-leg case.
Michael Square completes a Gann-style square whose one side is your leg, in the scaled space where one bar equals the Michael ratio in price. It emits all four corners and the cross of the diagonals as full Points — each carrying price AND time — the same square the chart's Michael drawing shows, computed by the same shared engine.
How it works
The ratio comes from the leg's first price: divide p1 by 360, snap to a power of ten with a 5.55 mantissa threshold, then scale by a pinned per-timeframe factor (Daily 1, H1 0.1, M15 0.025 …). In that ratio-scaled space the leg a1 → a2 is one side of a square extending toward later bars; the tool completes the two remaining corners (c3 off a2, c4 off a1) and the diagonals' cross (the centroid). The corner names are fixed to the construction: a1 = the leg's first pivot, a2 = its second, c3 closes the square off a2 and c4 off a1 — on an UP leg the square hangs below-right of the leg, on a DOWN leg it sits above-right (the two diagrams label every corner in both cases). Each output is a Point carrying price and time: a1/a2 land on real bars; c3/c4/cross generally land between bars or beyond the last bar, so their time interpolates real bar times in range and extrapolates by the timeframe's bar duration past the edge. In leg mode the last confirmed leg is forward-filled so values stay dense; in prices mode the two per-bar inputs form a synthetic vertical leg at each bar, so the square is axis-aligned — the corner prices echo the inputs and the cross price is their midpoint. Destructure any corner with the Point Interpretor: out.price wires into ORDER_EXIT TP/SL, out.time into duration math.
Modes
Squares one zigzag-style leg — its two pivots become the side a1 → a2; all five Points reprice as the leg updates.
When to use: When the base move comes from market.zigzag_patterns (or any leg.zigzag producer) and should anchor the square.
Builds a synthetic vertical leg from two per-bar prices at the same bar — an axis-aligned square whose corner Points echo the input prices; the value-add is the cross (their midpoint) and the ratio.
When to use: When the two boundary prices come from computed levels — moving averages, S/R lines, constants — rather than a zigzag bundle.
Configuration
Input shape selector: leg squares one zigzag-style leg; prices builds a synthetic vertical leg from two per-bar price inputs.
Connects to
Examples
- TP at the square: square the last up-leg (mode leg), wire the c4 Point into a Point Interpretor and its out.price into a take-profit slot — the level the square projects beyond the leg.
- Mean level from two bands: in prices mode wire a channel's upper and lower lines as p1/p2 and use the cross Point's price (their midpoint) as a reversion target.
- When, not just where: the c3 Point's out.time is when the square completes to the right of the leg — compare it with the current bar's time to build time-based exits.
Common mistakes
- Wiring a corner Point straight into a TP/SL slot — a Point is a bundle; destructure it with the Point Interpretor and wire its out.price (SCALAR num.price) into ORDER_EXIT.
- Expecting four distinct corner prices in prices mode — the synthetic leg is vertical, so a1/c4 and a2/c3 echo the two inputs; the new information is the cross and the ratio.
- Wiring ratio into a TP/SL slot — it is num.price_per_bar, not a price.
- Reading c3/c4/cross bar_index as exact — those corners generally land between bars or beyond the last bar; bar_index rounds to the nearest bar, the exact position lives in time_epoch.
- Forgetting the ratio depends on the timeframe: the same leg squares differently on H1 vs D1 (pinned factors), exactly like the chart tool with its price/bar lock.