Long Short RR Box with Lot Size and Order MT4
- Utilities
-
Kazuma Uezono
MQL5 / MQL4 / Pine Script v6 developer and active trader.
Seller on the MQL5 Market (indicators for MT4/MT5).
Services:
- TradingView Pine Script to MT5/MT4 conversion (bar-by-bar matching, with tester report)
- MT4 to MT5 migration - Version: 1.2
- Activations: 5
Plan a trade on a MetaTrader 4 chart the visual way: this utility Expert Advisor draws an entry line, a stop loss line, a take profit line and two colored boxes, much like the long/short position drawing tools of TradingView. While you drag the lines, the panel calculates the R:R, the distance, the money you would lose at the SL and the lot that fits your risk. If you want, a two-click button then sends that order to your broker with the same SL and TP.
Please note: this is not a signal service or a trading system, and no profit is promised. Nothing is sent unless you click the order button twice. The EA sends only its own new orders, marked with its magic number, and leaves every existing order on the account untouched.
WHAT YOU SEE
- Gray entry line, red SL line, green TP line, and a loss box and a profit box whose colors are blended with the chart background (opacity adjustable).
- The lines start selected, so one drag moves them. Grab the entry line in the middle to shift the whole tool; grab the SL or TP line in the middle to change that price; grab a line end to change that price and the box width.
- Up to 3 tools on one chart (select them with 1, 2, 3 on the panel). Each tool keeps its own risk value. Long > Short flips a tool.
- Panel: order type and price, lot, R:R, risk in account currency and in % of balance, SL and TP prices with distance and money. Distance is in pips on FX and a price difference on gold, indices and other CFDs.
- Buttons: Long/Short, Order, New, Reset, Delete, collapse. Panel language English or Japanese.
- A new tool starts at the current price with SL = ATR(14) of the chart (or your fixed pips) and TP = 2 x the SL distance (adjustable).
LOT SIZE
- Choose the risk as % of balance (default 1%), % of equity, or a fixed money amount.
- The tool divides the risk money by the loss of 1 lot between the entry and the SL, and cuts the result DOWN to the lot step. The broker maximum and your Maximum lot input are applied after that.
- No rounding up: when the minimum lot is already larger than your risk, the panel shows "risk too small" and the money of one minimum lot, and the button cannot send.
- The loss is converted to the account currency, including CFDs whose profit currency differs from the account.
- The money shown is therefore at or a little under your setting. The % is always shown against the balance.
SENDING THE ORDER
- Click 1 arms the button ("Click again: ..."). Click 2 within 3 seconds (adjustable) sends it. Otherwise the button returns to normal.
- Market, limit or stop is decided for you: market when the entry line is within 2 spreads (adjustable) of the price, otherwise limit or stop.
- Before sending, the tool checks the SL/TP sides, an SL of at least 3x the spread, the stop and freeze levels, the lot limits, the free margin and the trading session, and shows the reason if it stops.
- MT4 sends orders one at a time and waits for the server's reply, so the chart can pause for a moment while an order is sent.
- If your broker rejects a market order that carries SL/TP (error 130, typical for market execution), the tool opens the position without SL/TP and sets them right after. If setting them fails, the panel shows "NO SL/TP - set them!". Then set the SL and TP yourself at once.
- No reply from the server: the tool searches the order list for 15 seconds and reports whether the order exists. Do not click during that time.
- Magic number 20261110 and comment "PositionTool #1" (#2, #3) by default. Pending orders have no expiry.
AFTER A RESTART
- Prices and box positions are kept after a timeframe change, a terminal restart and a forced shutdown of MT4 (tested).
- MT4 gives charts new IDs after a restart, so the tool also finds its saved data by symbol and by the order of the charts of that symbol. If you keep several charts of the same symbol, do not close or reorder them while MT4 is closed.
- A template applied to another symbol does not bring the old prices: the tool is placed again at that symbol's price.
- Tool #1 is placed automatically only the first time the EA runs on a chart; a deleted tool does not come back.
OUR TEST RESULTS (demo account in JPY)
- 9 symbols (FX pairs and CFDs): the actual loss at the SL was 0.98 to 1.01 times the risk money set.
- Real mouse drags, two-click orders with the tool's SL/TP, and restore after a forced shutdown were checked.
Results on your account depend on the broker, the symbol and the market.
LIMITS YOU SHOULD KNOW BEFORE BUYING
- Delete key: the tool's lines are selected, so Delete also removes them when you delete one of your own objects. The tool draws them again and shows "To delete Position Tool press 'Delete' on the panel". A second Delete within 15 seconds removes the tool together with its saved data. To remove a tool, always use Delete on the panel.
- The lot sent can differ from the lot you saw after click 1: a market order is calculated again with the price of click 2. The risk money does not change.
- Slippage, gaps, spread changes and lot steps can make the real loss at the SL differ by a few %. A stop loss can fill at a worse price.
- Commission and swap are not part of the risk money.
- A market order uses the current price as the entry, so R:R and distances can move a little.
- MT4 cuts chart and panel texts at about 62 bytes and ends them with "~" (mostly with Japanese text).
- One symbol per chart: the tool plans the chart symbol only.
- The AutoTrading button must be on and "Allow live trading" checked to send orders. Drawing and calculating work without it.
- Strategy Tester: clicks cannot be tested, so a demonstration runs: minimum-lot market orders, long and short in turn, every 24 bars when flat. With a small deposit (minimum lot would risk more than half of the equity) nothing is sent and the report has 0 trades. These trades are not a performance result.
GETTING STARTED
1. Put the EA on the chart of the symbol you want to plan; tool #1 appears at the price.
2. Enter your risk in the inputs or on the panel and drag the lines.
3. Turn on AutoTrading only if you want to send the order, then click the button twice. Start on a demo account.
INPUTS (28)
Risk and lot (4): risk mode, risk value, maximum lot, points per pip. New tool (6): direction, default SL pips (0 = ATR), default R:R, box width in bars, number of tools 1-3, create tool #1 when attached. Order button (6): show, seconds for click 2, market zone in spreads, magic number, slippage, comment. Display (10): language, corner, X, Y, font size, profit/loss/entry colors, box opacity, chart labels. Strategy Tester (2): demonstration, interval.
IMPORTANT
- You decide what to trade, the SL/TP and the risk. The tool gives no advice on when or what to trade.
- TradingView is a trademark of TradingView, Inc. This product has no affiliation with TradingView and is not endorsed or sponsored by it.
- Support via MQL5 messages within 3 business days for installation, settings and bugs. We cannot answer what to trade, where to put SL/TP or how much to risk.
