Script - Automatic calculation of position size

  • 1647
  • 0
As the script described below is provided free of charge, Eole Trading cannot guarantee personalized technical support. The explanations below answer most questions and provide detailed solutions. If, however, you do not find the solution below, please do not hesitate to contact us, only via e-mail at [email protected]
eole-trading.com


Like you, we don't like to spend too much time on certain tasks and have therefore developed some tools to make our lives easier. Today, Eole Trading offers you one of these tools: our order-to-market script.
You are going to tell me that, so far, this is nothing very exceptional, as there are already a lot of scripts and experts.
You are right, but our script is visual and allows automatic position size calculation depending on the percentage risk, thereby simplifying the two steps of placing an order.

Installation of the script:
The file "Script_Market_Eole_Trading.ex4″" must be put in the scripts folder of the Meta Trader installation of your choice. The path is usually C:\Program Files (x86)\MetaTrader\experts\scripts

If the platform was open when the file was copied to the scripts folder, you will need to restart Meta Trader 4 to complete the installation.

Using the script:
First, make sure that the "Allow direct trading" box is ticked in the Meta Trader 4 platform options. To access options, go to the Tools menu and click on Options or simultaneously press the Ctrl (control) and O keys.

settings on mt4
Once the options are set, go to the chart on which you want to place a market order (Buy or Sell) and drag and drop (click on the name of the script in the Platform Browser window and while keeping the left mouse button pressed, move the cursor over the chart) the script above.
script position size drop on chart
A first window will then appear allowing you to choose the script’s external parameters. The available parameters are as follows:
setting position size script
1) RiskMaxPercentage: to indicate the percentage of risk to be taken into account when calculating the volume of the position (for example, 2 means 2% of the balance of your account).
2) NumeroMagic: if you want to differentiate the position so that it can be controlled by an expert or another program.
3) ColorPriceStop: Indicates the colour of the line representing the stop loss level that will be displayed on the chart.
4) ColorPriceLimit: Indicates the colour of the line representing the profit taking level that will be displayed on the chart.

Once the settings are complete, click Ok to confirm. A new window should then appear.

validate the script
It is important to keep this window open until you have finished choosing your stop loss and limit levels. On your chart, two lines appear (by default one red for the stop loss and one green for the limit).

using this script on your trading
Move these lines to the desired levels for your position and click OK in the window you kept open to confirm the position. The script will then automatically calculate the volume according to your risk and open the desired position (if the stop loss is below the current price, the script will position itself for purchase and if the stop loss is above, it will position itself for sale).

It is possible to remove the green line representing the limit if you do not want a profit taking level but it is essential to always have a stop loss on the red line so that the script can calculate a volume for your position.

For each position opened with the script, you will also have, in the position’s comments, the maximum risk of the position expressed in your account’s currency.

maximum risk of the position comments mt4
Download this script: Money Management - Automatic calculation of your positions' size

About author

  • 24
  • 42
  • 63
  • 6

Add a comment

Comments

0 Comments