On this page
A session-based map of support and resistance
TzPivots draws price levels on the main chart. EarnForex developed it from an earlier indicator by Shimodax. It can display the central pivot, three resistance and three support levels, six midpoints, previous-session high/low, the display period’s opening price, Fibonacci levels, four Camarilla levels and nearby price-grid levels called sweet spots.
Use an H1 or lower chart with bars aligned to whole hours. The download is ForexBestRobots edition 1.02, a marked derivative of EarnForex 1.01. It fixes session/history checks, object prefixes and MT5 label timing while retaining the author’s price formulas. The original source and Apache 2.0 license are included.
The formulas this indicator actually uses
Let H, L and C be the high, low and final close of the selected completed session, and Q=H−L. First calculate P=(H+L+C)/3 and round P to the symbol’s digits. The classic levels use this rounded P: R1=2P−L; S1=2P−H; R2=P+H−L; S2=P−H+L; R3=2P+H−2L; S3=2P−2H+L. Each result is then rounded to the symbol’s digits.
Midpoints are the arithmetic means of adjacent classic levels: P/R1, R1/R2, R2/R3 and P/S1, S1/S2, S2/S3. They do not use an additional price series. ShowPivots and ShowMidPivot are independent display switches.
The Fibonacci lines are L−0.618Q, L−0.382Q, L+0.382Q, L+0.5Q, H−0.382Q, H+0.382Q and H+0.618Q. These are extensions and subdivisions of the previous range, not a separate Fibonacci-pivot formula around P.
The source uses Camarilla H3=C+0.27Q, H4=C+0.55Q, L3=C−0.27Q and L4=C−0.55Q. In particular, its H3/L3 multiplier is 0.27, not 0.275. Sweet spots bracket the current Bid in steps of 50 terminal points. On five-digit EUR/USD, 50 points equals 5 pips; on four-digit EUR/USD it equals 50 pips.
Real EUR/USD examples
The charts reconstruct the calculation from real archived Yahoo Finance EUR/USD H1 quotes in UTC. Every reference session ends at or before the candle where its levels become available. They are calculation illustrations, not MetaTrader screenshots or tested trade entries.
For 12 June 2025 with a 00–24 UTC reference day, the previous session has H=1.15167570, L=1.14090133 and C=1.15127790. At five-digit precision, P=1.14795, R1=1.15500 and S1=1.14422. The first chart shades that source session and draws the levels on the following day.
With TradingHoursFrom=8 and TradingHoursTo=17, the completed 11 June session produces P=1.14719. That value still applies at 16:00 UTC on 12 June. At 17:00 UTC the 12 June 08–17 session is complete, so P changes to 1.15800. The bar opening at 17:00 is excluded from that reference session.
Changing DestTimeZone from 0 to −4 moves a full session to 04:00–04:00 UTC. At 12:00 UTC on 12 June the corresponding P is 1.14879 instead of 1.14795. This is a fixed-offset example, not a claim that every broker uses the same daily close.



Real EUR/USD H1, final indicative Yahoo Finance OHLC, UTC. Chart colors are illustrative. CSV files record each reference interval and calculated levels; no trade performance is inferred.
Download chart calculation data (CSV) · 1Download chart calculation data (CSV) · 2Download chart calculation data (CSV) · 3
Session boundaries, timezones and daylight saving
LocalTimeZone is the UTC offset of the broker’s chart timestamps, not your computer clock. DestTimeZone is the fixed UTC offset used to define the session. Destination time = server time − (LocalTimeZone−DestTimeZone) × 3600 seconds. For a UTC+2 server and a UTC+1 session, 10:00 server time becomes 09:00 session time.
TradingHoursFrom is inclusive and TradingHoursTo is exclusive in destination time. The default 0–24 uses a full destination day. Edition 1.02 selects the most recent completed session containing available bars. For a shorter session, the levels switch after its end; before then they use the preceding completed session. A session crossing midnight cannot be entered as 22–6: choose an offset that puts the window inside one destination date.
Offsets are whole hours from −14 to +14. There is no automatic daylight-saving calendar. Update the settings when the chosen server or session offset changes, and verify the broker’s history when comparing seasons. Empty dates are skipped; a short Sunday session is used separately if it contains eligible bars, not automatically merged with Friday.
ShiftDays=0 selects the latest context. A positive value moves the anchor back by that many destination dates present in the chart history, then finds the completed reference session for that anchor. The indicator displays one selected set of levels; it does not draw a full historical pivot series.
Settings and defaults
Both platform sources expose the same 32 inputs. Line widths accept 1–5, BarForLabels accepts 0–10000 and ShiftDays accepts 0–10000. The session must satisfy 0≤TradingHoursFrom<TradingHoursTo≤24. Each instance on one chart needs a unique nonempty ObjectPrefix without spaces, at most 40 characters.
| Input | Default | Practical meaning |
|---|---|---|
LocalTimeZone | 0 | Broker server UTC offset, in whole hours; not the computer timezone. |
DestTimeZone | 0 | Destination-session fixed UTC offset. Adjust daylight saving manually. |
LineStyle | STYLE_DOT | Style of the main price-level lines. |
LineThickness | 1 | Main line width, 1–5. |
ShowPivots | true | Show P and R1–R3/S1–S3. |
PivotColor | clrMagenta | Central pivot line color. |
SupportColor | clrBlue | Classic support-line color. |
ResistanceColor | clrRed | Classic resistance-line color. |
ShowMidPivot | true | Show six midpoint levels independently of ShowPivots. |
MidPivotColor | clrLightGray | Midpoint-line color. |
LineStyleMidP | STYLE_DOT | Midpoint-line style. |
LineThicknessMidP | 1 | Midpoint width, 1–5. |
LabelColor | clrGray | Text-label color. |
ShowComment | false | Show previous and selected display-period price commentary. |
CommentaryCorner | CORNER_LEFT_UPPER | Corner for the commentary labels. |
ShowHighLowOpen | false | Show reference high/low and display-period open. |
HighLowOpenColor | clrOrange | Color of high, low and open lines. |
ShowSweetSpots | false | Show two Bid-based levels separated by 50 terminal points. |
SweetSpotsColor | clrDeepSkyBlue | Sweet-spot line color. |
ShowFibos | false | Show the seven previous-range Fibonacci levels. |
FibosColor | clrGoldenrod | Fibonacci-line color. |
ShowCamarilla | false | Show H3/H4/L3/L4 using 0.27Q and 0.55Q. |
CamarillaColor | clrDimGray | Camarilla-line color. |
ShowLevelPrices | true | Append prices to level labels. |
DaySeparator | clrDarkGray | Vertical session-divider color. |
DayLabel | clrDarkGray | Session-divider text color. |
BarForLabels | 10 | Historical bar offset used for line-label placement; bounded by available history. |
DebugLogger | false | Write diagnostic details to the terminal log. |
TradingHoursFrom | 0 | First included hour in destination time. |
TradingHoursTo | 24 | Excluded end hour; 24 means the end of the destination day. |
ShiftDays | 0 | Move the anchor back across observed destination dates; 0 is current. |
ObjectPrefix | "ForexBestRobots-TzPivots-" | Unique object namespace per chart instance; empty or conflicting prefixes are rejected. |
How to read the levels
Treat P, supports and resistances as reference prices. A touch does not establish a reversal, and a break does not establish continuation. Read the surrounding price structure, the session and transaction costs before designing an entry rule. The names R and S describe the formula, not guaranteed barriers.
Start with classic pivots and add only the groups you need. Many optional lines cluster together and can obscure candles. This source has no popup, push or email alerts, no signal arrows, no indicator buffers for iCustom and no order execution. Other code would have to read its chart objects or implement the calculation.
Install and compile the source
- Download and extract the ZIP for your desktop platform.
- In MetaTrader choose File → Open Data Folder, then MQL4 or MQL5.
- Copy the ZIP’s Indicators folder into that platform folder. Keep upstream as a reference copy.
- Open TzPivots_ForexBestRobots.mq4 or .mq5 in the matching MetaEditor and press F7. Inspect errors and warnings.
- Refresh Navigator → Indicators and attach the compiled indicator to an H1 or lower demo Forex chart.
- Set broker/session offsets, hours and a unique ObjectPrefix; load sufficient history and compare the displayed reference prices.
No DLL imports or additional include files are required. Custom desktop indicators cannot be installed directly in the MetaTrader mobile app.
Download TzPivots free
Choose the source ZIP for desktop MT4 or MT5. Each includes the marked MQ4 or MQ5 program, the unchanged original in upstream, Apache 2.0 license, original author notices, a change log, a patch, checksums and installation notes in all 12 site languages.
There is no ready EX4 or EX5 in these packages. We reviewed the source and checked its session-selection function and classic formulas outside MetaTrader, but did not compile or run this derivative in native MT4/MT5. Compile it in the matching MetaEditor and verify it on a demo chart.
Free source ZIP · ForexBestRobots edition 1.02 · Compile in MetaEditor
History and interpretation limits
The calculation uses the chart’s available OHLC bars. Missing bars, different broker feeds, symbol precision, server offsets and short weekend sessions can change H, L and C. Edition 1.02 withholds levels when the required reference context is missing; it does not manufacture a complete session from absent quotes.
The source updates on a new chart candle or a terminal history-reset request. Commentary and sweet spots therefore do not refresh on every tick. After loading or correcting older history, reattach the indicator if a full refresh is needed. Corrected reference history can change levels; current-session extremes are not used in its classic pivot formula.
The figures use final indicative OHLC. They do not model live Bid, spreads, commissions, slippage, stops or profitability. C++ checks of extracted source logic do not verify native compilation, platform object rendering or broker data synchronization.
Frequently asked questions
Does it work on H4 or D1?
Edition 1.02 requires H1 or lower bars aligned to whole hours. Higher charts cannot reliably represent the selected hourly session boundaries.
Is LocalTimeZone my computer’s timezone?
No. It is the UTC offset of the broker’s chart timestamps. DestTimeZone defines the session clock separately.
Does it handle summer time automatically?
No. Both offsets are fixed whole-hour inputs. Adjust them when appropriate and check historical comparison periods.
Why is my pivot different from another website?
Compare the reference hours, UTC offsets, H/L/C source, Sunday handling, precision and pivot formula. Different boundaries produce different inputs.
Are sweet spots 50 pips apart?
They are 50 terminal points apart. That is 5 pips on five-digit EUR/USD and 50 pips on four-digit EUR/USD.
Does the indicator send alerts or place trades?
No. It draws chart objects and optional commentary. There are no alert channels, signal buffers or order functions.
Why is the download source-only?
These ZIPs contain MQ4/MQ5 source and documentation. Compile with F7 in the matching desktop MetaEditor; native compilation and runtime have not been verified here.
Sources and review scope
This review follows a pinned EarnForex revision and the marked ForexBestRobots changes. The real-data charts and CSV files are our own reconstructions; they do not imply an endorsement by the original developer.