# Tiltnote Toolkit for MT4/MT5 Position size calculator, lot size, risk/reward and margin level in one chart panel. Display only: it places no orders. ![Tiltnote Toolkit on USDJPY](images/tk_en_USDJPY_light_750.png) **Tiltnote Toolkit** is a display-only indicator for MetaTrader 4 and 5. Drag three lines on the chart and the panel calculates the position size (lot size) for the risk you chose. It also shows risk/reward, margin level, your closed P/L for the day, week or month, and the spread. This repository has both versions: `Tiltnote_Toolkit.mq5` (MetaTrader 5) and `Tiltnote_Toolkit_MT4.mq4` (MetaTrader 4). This is not a trading signal. All numbers are calculated from the lines and the values you enter. Every order is your own decision. The indicator never places, closes or modifies orders, and it uses no DLL and no WebRequest. ## Features - Position size calculator. The gray line is the entry, the red line is the stop. Drag the red line and the lot size is recalculated. A stop below the entry means BUY; a stop above means SELL, and the panel switches automatically. - The gray entry line follows the price until you drag it. After that it stays where you put it, like a limit order. - Lot size is rounded down to the symbol's volume step. If the result is below the minimum lot, the panel shows a message. It is capped at the broker's maximum lot. - Shows the estimated loss at the stop, in your account currency. The panel turns to a warning when the risk is above 3%. - Risk/reward. A blue target line can be shown or hidden with the panel buttons 1:1, 1:1.5, 1:2 and 1:3, or you can drag it. The panel shows the ratio and the estimated result if the target is reached. - Margin level. Shows margin used, free margin, margin level, the broker's stop-out level and how much more loss reaches it. Also shows the margin needed for the calculated lot size, and warns if it is more than your free margin. - Period record. Closed P/L (including commission and swap), number of trades and current losing streak for 1 day, 1 week or 1 month. You can set an optional loss limit and a trade count limit; the panel changes color as you approach them. - Spread and bar timer. Current spread in pips, time until the current bar closes, and the rough extra cost of the spread on the calculated lot size. - The pip value is taken from the terminal's own profit calculation where possible. For other cases it uses contract size x pip x a conversion rate, cross-checked with the broker's tick value. If the numbers do not match, the panel shows no number instead of a wrong one. - The panel can be dragged by its "::" grip, folded, and resized (5 text sizes). The risk %, fold state, text size and position are remembered. The interface is in English or Japanese. ## Inputs (MT5 version) | Input | Default | Description | |---|---|---| | Language | Auto | Auto (terminal language), Japanese or English. | | First panel corner | Right upper | Corner where the panel first appears. | | Font size | 9 | Base font size. | | Distance from the side, px | 10 | Horizontal margin. | | Distance from top/bottom, px | 25 | Vertical margin. | | Text color | none (auto) | Text color. "none" picks one to match the chart. | | Panel color | none (auto) | Panel color. "none" picks one to match the chart. | | Panel background | Opaque | Opaque, Slightly see-through, More see-through, or Text only (no background). | | Risk per trade as | Percent of base (%) | Define risk as a percentage or as a fixed amount. | | Risk percent % | 1.0 | Starting value. On the panel, change it in steps of 0.25 (0.25 to 10). | | Risk amount | 0.0 | Fixed risk in account currency. Used when the mode above is "Fixed amount". | | Base for percent | Balance | Balance or Equity. | | First stop line distance | Auto | Auto: ATR(14), rounded (at least 10 pips for FX). Fixed pips. Or ATR(14) x multiplier, not rounded. | | Fixed pips / no ATR data | 20.0 | Distance used for Fixed pips, or when ATR data is not available. | | ATR multiplier | 1.0 | Used in the ATR x multiplier mode. | | Gold: size of 1 pip | 1 pip = 0.1 | Gold has no single pip definition, so choose 0.1, 0.01 or 1.0 to match your broker. | | Pip size override | 0.0 | Set a pip size in price units. 0 = automatic. | | Units per 1 lot, FX only | Auto | Auto (broker setting), 1,000, 10,000, 100,000 or Custom. Not available for indices or CFDs. | | Custom units per lot | 100000 | Used when the setting above is Custom. | | Margin and margin level | true | Show the margin section under "More". | | Period record | true | Show the period record section under "More". | | Spread and bar countdown | true | Show the spread and bar timer section under "More". | | Period | 1 day | 1 day, 1 week (from Monday) or 1 month (from the 1st). | | Period boundary | New York 17:00 | New York 17:00 (daylight saving handled automatically), broker server 00:00, or a custom hour in Japan time. | | Custom hour, Japan time 0-23 | 7 | Used when the boundary is the custom hour. | | Symbols | All symbols | This symbol only, or all symbols. | | Loss limit for the period | 0.0 | In account currency. 0 = off. | | Trade count limit | 0 | 0 = off. | ## How to use 1. Attach the indicator to a chart. Gray, red and (optionally) blue lines appear, with the panel. 2. Drag the gray line to your planned entry, or leave it to follow the price. 3. Drag the red line to your stop. The lot size and the estimated loss appear on the panel. 4. Optional: press 1:1, 1:1.5, 1:2 or 1:3 to place a target line, or drag the blue line yourself. 5. Press "More" for margin, period record, spread, bar timer and the basis of the calculation (units per lot, conversion pair, pip size). 6. Check the numbers in your terminal's order window before you trade. ## Notes - Estimates only. They exclude slippage, fees and price gaps. The spread can make the real loss a little larger. - If the profit currency cannot be converted to your account currency, show the needed pair (for example USDJPY) in Market Watch. - Only one copy runs per chart; a second copy on the same chart does nothing. - Use it on a demo account first. Trading involves risk of loss; this tool does not predict the market and makes no promise of results. - MetaTrader 4 and 5 are trademarks of MetaQuotes Ltd. The author is not affiliated with MetaQuotes. - License: MIT. You may use, modify and redistribute it with the copyright notice kept. ## Install 1. In MetaTrader, open **File > Open Data Folder**. 2. Copy `Tiltnote_Toolkit.mq5` to `MQL5/Indicators/` (MT5), or `Tiltnote_Toolkit_MT4.mq4` to `MQL4/Indicators/` (MT4). 3. Open the file in MetaEditor and press **Compile**, or restart the terminal. 4. Drag the indicator from the Navigator onto a chart. ## Screenshots ![Gold](images/tk_en_XAUUSD_light_750.png) ![More section](images/tk_en_USDJPY_more_750.png) ![Dark chart](images/tk_en_USDJPY_dark_750.png) Author: Tiltnote Okumura