|
| 1 | +<div align="center"> |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | +</div> |
| 10 | + |
| 11 | +> ⚠️ **Setup & Requirement Notice** |
| 12 | +> |
| 13 | +> VisualRiskCalculator is an **Expert Advisor (EA)** for **MetaTrader 5**. |
| 14 | +> |
| 15 | +> **Algo Trading Required:** For the drag-and-drop features and trade execution to work, you must enable the **"Algo Trading"** button in your MT5 toolbar. |
| 16 | +> |
| 17 | +> **Account Compatibility:** This tool works with both **Netting** and **Hedging** accounts. It automatically detects your account currency (e.g., trading EURUSD on a JPY account) and handles all conversion math instantly. |
| 18 | +
|
| 19 | +This utility is built on a simple philosophy: **Stop calculating. Start trading.** It eliminates the need for external calculators or mental math by integrating risk management directly into the visual chart experience. |
| 20 | + |
| 21 | +--- |
| 22 | + |
| 23 | +## How to Install |
| 24 | + |
| 25 | +This follows the standard installation process for any MetaTrader Expert Advisor. |
| 26 | + |
| 27 | +1. **Download** the `VisualRiskCalc.mq5` file from this repository. |
| 28 | +2. Open **MetaTrader 5**. |
| 29 | +3. Go to **File** -> **Open Data Folder**. |
| 30 | +4. Navigate to the `MQL5` folder, then open the `Experts` folder. |
| 31 | +5. **Copy and Paste** the `VisualRiskCalc.mq5` file into this folder. |
| 32 | +6. Go back to MetaTrader 5, right-click on the **Navigator** panel (usually on the left), and click **Refresh**. The EA will appear under the "Expert Advisors" list. |
| 33 | + |
| 34 | +--- |
| 35 | + |
| 36 | +## Showcase: The Tool in Action |
| 37 | + |
| 38 | +VisualRiskCalc provides a fluid, Visual interface for trade management. Here is how it improves your workflow. |
| 39 | + |
| 40 | +| Feature Showcase | Description | |
| 41 | +| :--------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| 42 | +|  | **Seamless Drag-and-Drop**: A red "handle" arrow sits on the current price line. simply click and drag it to your desired Stop Loss level. The tool automatically detects if you are going Short or Long based on where you drag. | |
| 43 | +|  | **Real-Time Calculation**: As you move your mouse, the panel updates instantly. It calculates the exact **Lot Size** needed to risk your specific percentage, converts currency rates, and projects the Pip distance. | |
| 44 | +|  | **Smart Execution**: The tool draws a dynamic **Take Profit** line (default 1:2) that moves with you. When you are ready, the "WAITING" button turns into a **BUY** or **SELL** button. One click executes the trade and cleans up the chart. | |
| 45 | + |
| 46 | +--- |
| 47 | + |
| 48 | +## Configuration & Usage |
| 49 | + |
| 50 | +### 1. The Workflow |
| 51 | + |
| 52 | +Forget opening calculator apps. The process is entirely visual. |
| 53 | + |
| 54 | +1. **Grab the Handle:** Look for the red arrow on the current price axis. |
| 55 | +2. **Drag to SL:** Pull it to where your Stop Loss should be. The tool activates immediately. |
| 56 | +3. **Adjust:** You can tweak the **Risk %** or **R:R Ratio** in the panel while the lines are active; the lines and math will update instantly. |
| 57 | +4. **Execute:** Click the large colored button at the bottom to place the order. |
| 58 | + |
| 59 | +### 2. Input Parameters |
| 60 | + |
| 61 | +You can configure the defaults when you first load the EA onto the chart. |
| 62 | + |
| 63 | +| Parameter | Default | Description | |
| 64 | +| :--------------- | :------------- | :------------------------------------------------------------------------------------------------------------------------ | |
| 65 | +| `DefRiskPercent` | `1.0` | The default percentage of your Account Balance you are willing to lose on a trade. | |
| 66 | +| `DefRewardRatio` | `2.0` | The default Risk-to-Reward ratio. `2.0` sets the Take Profit at 2x the distance of the Stop Loss. | |
| 67 | +| `PanelYOffset` | `60` | How far down (in pixels) the panel sits from the top of the chart. Useful if you have other indicators in the top corner. | |
| 68 | +| `ThemeColor` | `MidnightBlue` | The background color of the control panel. | |
| 69 | + |
| 70 | +### 3. The Panel Interface |
| 71 | + |
| 72 | +The on-chart GUI gives you full control without navigating menus. |
| 73 | + |
| 74 | +- **Risk % Field:** Change this to `0.5`, `2.0`, etc., to resize your position instantly. |
| 75 | +- **Reward Field:** Change this to `3.0` to extend your Take Profit line further out. |
| 76 | +- **Reset Button:** Cancels the current analysis, removes the lines, and resets the tool to the "Passive" state (waiting for you to drag the handle again). |
| 77 | + |
| 78 | +--- |
| 79 | + |
| 80 | +## Features |
| 81 | + |
| 82 | +- **Zero Dependencies:** Uses standard MQL5 libraries (`Trade.mqh`) included with every MT5 installation. |
| 83 | +- **Dynamic Stop Loss:** Dragging the SL line automatically adjusts the TP line to maintain your R:R ratio. |
| 84 | +- **Smart Direction:** Automatically detects **Long (Buy)** vs **Short (Sell)** based on whether the Stop Loss is below or above the current price. |
| 85 | +- **Currency Normalization:** Automatically handles `TickValue` and `Point` calculations for Forex, Indices, or Crypto (depending on broker data). |
| 86 | +- **Lot Normalization:** Automatically rounds lot sizes to the broker's `Step` value (e.g., 0.01 or 0.1) and adheres to Min/Max volume limits. |
0 commit comments