Risk Calculator Veqrix
- Utilità
-
Jose Luis Heredia Padilla
CEO & Founder of VortexLab
A laboratory for developing advanced indicators, quantitative strategies, and Expert Advisors (EAs) for MetaTrader 5.
Focus on technical precision and consistent results. - Versione: 1.2
Risk Calculator Veqrix
Risk Calculator Veqrix is a risk calculation, visual trade planning, and manual order execution tool for MetaTrader 5.
The EA automatically calculates the trade volume using the configured risk, entry price, and distance to the Stop Loss. It also displays the planned trade directly on the chart and distributes the total volume across up to three Take Profit targets.
This tool does not generate trading signals . The user selects the direction, configures the levels, and manually confirms the order from the panel.
Risk Calculation
Risk can be configured in two ways:
- As a percentage of the account balance.
- As a fixed amount in the account currency.
When the Stop Loss line is moved, the EA automatically recalculates:
- The distance between the entry and the Stop Loss.
- The trading volume allowed by the broker.
- The estimated monetary loss if the Stop Loss is reached.
- The risk-to-reward ratio of each Take Profit.
- The estimated monetary profit of each target.
Version 1.09 uses the contract calculation model provided by the broker through MetaTrader 5. This allows the monetary result to be calculated according to the actual symbol specifications instead of relying only on a pip-based formula.
This method improves risk calculation for Forex, metals, indices, CFDs, stocks, futures, cryptocurrencies, and synthetic indices, provided that the broker supplies the required instrument specifications.
Safe Volume Normalization
The calculated volume is automatically adjusted to the following broker requirements:
- Minimum volume.
- Maximum volume.
- Volume step.
- Number of volume decimals supported by the symbol.
The EA rounds the volume down to the nearest valid broker volume step. This prevents volume normalization from intentionally increasing the risk above the configured amount.
If the selected risk is too small to trade the broker's minimum volume, the EA will not send the order. The panel will display a message indicating that the risk amount is below the minimum tradable volume.
For example, if the user configures a risk of 100 units of the account currency, the EA calculates a volume whose estimated loss at the Stop Loss is equal to or lower than that target, according to the available volume step.
Take Profit Management
The tool supports up to three Take Profit levels:
- Take Profit 1.
- Take Profit 2.
- Take Profit 3.
Each target can have:
- Its own percentage of the total volume.
- Its own risk-to-reward ratio.
- Its own exit price.
- Its own order comment.
The percentages of all active Take Profit targets must add up to exactly 100 percent.
Examples of valid distributions:
- One active target with 100 percent.
- Two active targets with 50 and 50 percent.
- Three active targets with 50, 30, and 20 percent.
- Three active targets with 34, 33, and 33 percent.
The EA distributes the total volume between the active targets without increasing the total exposure because of volume rounding.
If the total volume is too small to be divided between all active targets while respecting the broker's minimum volume, the trade will be blocked and an informative message will be displayed.
Take Profit Modes
Take Profit levels can be managed in two different modes.
Dynamic mode:
Take Profit levels are automatically calculated from the Stop Loss distance and the selected risk-to-reward ratio. When the Stop Loss is moved, the targets are updated to maintain the configured ratio.
Manual mode:
Take Profit levels can be unlocked and moved independently on the chart. The EA automatically recalculates the distance, risk-to-reward ratio, and estimated monetary profit.
Supported Order Types
The panel can prepare and send the following order types:
- Buy.
- Sell.
- Buy Limit.
- Sell Limit.
- Buy Stop.
- Sell Stop.
For market orders, the calculation uses the corresponding current Buy or Sell price.
For pending orders, the calculation uses the entry line price displayed on the chart.
Chart Visualization
Risk Calculator VortexLab provides two chart visualization styles.
Lines mode:
Displays horizontal lines for the entry, Stop Loss, and Take Profit levels. The lines show information about distance, estimated risk, estimated profit, and risk-to-reward ratio.
Boxes mode:
Displays colored zones between the entry, Stop Loss, and different Take Profit levels. This mode provides a clear visual representation of the planned risk and profit areas.
The Stop Loss, entry, and Take Profit colors can be customized from the input parameters.
Trading Panel
The panel allows the user to:
- Switch between percentage risk and fixed risk.
- Select the order type.
- Enable or disable each Take Profit.
- Configure the volume percentages.
- Configure the risk-to-reward ratios.
- Lock or unlock the Take Profit levels.
- Place the trade.
- Cancel the visual trade setup.
- Minimize the panel.
- Close positions and delete pending orders for the current symbol.
The Close All command acts on open positions and pending orders for the symbol where the EA is running. This action is executed immediately and should be used with caution.
Visual Themes
The panel includes 14 visual themes:
The chart line colors and visual style can also be customized.
Order Comments
The user can enable or disable order comments.
When Take Profit numbering is enabled, the EA can automatically add identifiers such as:
- RC_TP1.
- RC_TP2.
- RC_TP3.
The base comment text can be customized from the input parameters.
Persistent Configuration
The tool stores the selected configuration in the terminal, including:
- Risk mode.
- Risk percentage.
- Fixed risk amount.
- Active Take Profit targets.
- Volume percentages.
- Risk-to-reward ratios.
- Take Profit lock status.
The configuration is restored when the EA is started again in the terminal.
How to Use the EA
1. Attach Risk Calculator VortexLab to a chart.
2. Enable algorithmic trading in MetaTrader 5.
3. Select Buy, Sell, or the required pending order type.
4. Configure the risk as a percentage or a fixed amount.
5. Move the Stop Loss line to the required price.
6. For a pending order, also move the entry line.
7. Enable the Take Profit targets you want to use.
8. Configure their percentages and make sure they add up to 100 percent.
9. Configure the risk-to-reward ratios or unlock the targets to move them manually.
10. Review the volume, estimated risk, and targets displayed on the chart.
11. Click Place Order to send the trade.
Main Input Parameters
Risk percent per trade:
Defines the percentage of the account balance used as the risk target.
Fixed risk per trade:
Defines a fixed risk amount in the account currency.
Magic number:
Defines the identifier used for orders sent by the EA.
Enable order comments:
Enables or disables order comments.
Comment base text:
Defines the base text used in order comments.
Append TP number:
Adds the Take Profit number to each partial order comment.
Panel theme:
Selects one of the 14 available panel themes.
Visual style:
Switches between Lines and Boxes visualization modes.
Line colors:
Customizes the colors of the Stop Loss, entry, and Take Profit levels.
Important Risk Information
The amount displayed by the EA is an estimate based on the symbol information provided by the broker at the time of calculation.
Testing the EA on a demo account and checking the specifications of each symbol is recommended before using it on a live account.
Support
For questions, bug reports, or suggestions, please use the Comments section of the product page or the MQL5 private messaging system.
