Risk First Order Panel
Most order panels ask for a lot size and let the trader work out afterwards how much money that actually puts at risk. This one reverses the flow: the trader types how much they are willing to risk (as a percent of equity or a fixed money amount, toggled with the % button) and how far away the stop should be, in pips. The panel divides risk by stop distance, priced through the symbol's live MODE_TICKVALUE and MODE_TICKSIZE, to get the lot size - never a hardcoded pip value. A reward multiple then sets the target as that many multiples of the stop distance. The live preview line updates as the fields change, showing the lot size that would be sent and the target's distance in pips, so the trader sees the consequence of their risk number before committing to it. Buy and Sell both compute the stop and target prices fresh at send time from the live Ask/Bid, not from the price shown when the fields were last typed. Notes and limitations Only new market orders are sent (Buy/Sell); the panel does not modify or close existing positions and does not manage a trade after sending - no breakeven, no trailing. The stop distance is entered in pips, not as a chart level, so it does not account for nearby support/resistance automatically - the trader chooses the distance. Switching the risk mode (percent vs fixed amount) does not convert the number already typed in the field; it changes what that same number means, so re-check the value after toggling.
Expert advisor · MT4 · v1.0 · Free
About Risk First Order Panel
Risk First Order Panel is an expert advisor (trading robot) for MetaTrader 4. It has 8 settings, such as Corner, X offset and Y offset. MQL source code included.
Files in the download: RiskFirstOrderPanel.ex4, RiskFirstOrderPanel.mq4, RiskFirstOrderPanel.txt.
Trading robots can lose money. Check every setting and test on a demo account before using real funds.
Settings
| Setting | Default | What it does |
|---|---|---|
| Corner | 1 | Panel corner: 0=top-left 1=top-right 2=bottom-left 3=bottom-right |
| X offset | 12 | Panel offset from the chosen corner, X pixels |
| Y offset | 18 | Panel offset from the chosen corner, Y pixels |
| Default risk pct | 1.0 | Risk shown on first attach, percent of account equity |
| Default stop pips | 25.0 | Stop distance shown on first attach, in pips |
| Default reward | 2.0 | Reward multiple shown on first attach (target = reward * stop distance) |
| Slippage | 30 | Slippage in points passed to OrderSend |
| Magic | 38700 | Magic number for orders sent from this panel |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Experts.
- Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
- Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the expert advisor from the Navigator onto a chart, check the settings, allow Algo/Auto Trading and press OK.
- Test it first on a demo account or in the Strategy Tester.
Tags: Risk & Lot Size · MT4 Expert Advisor · MQL4 Source Code