How to set CPU core affinity on the MT4 shortcut.
1. Login to your VPS and open Task Manager by right-clicking the search bar and clicking "Task Manager".
2. After opening Task Manager click "More Details" to expand the window.
3. Navigate to the "Details" tab and right-click on a task e.g. terminal.exe (MetaTrader) and click "Set Affinity". This will then show you the number of processors on your machine.
4. In the example below, you can see there are four processors. CPU0, 1, 2 and 3.
5. For this task, the number of processors you have will be represented by a binary number. So if you have four cores it would be 0000 and if you have eight cores it would be 00000000.
6. To set Core Affinity you will need to assign a value of 1 for on or 0 for off.
Below are two examples, please bear in mind that you read from right to left.
In the first example, Core 0 has a value of 1 and as such is in use. The other three cores have a value of 0 and aren't in use. This is written as 0001.
In the second example, both Core0 and Core3 have a value of 1 and are in use while Core1 and Core2 have a value of 0 and aren't in use. This is written as 1010.
The same rules apply no matter how many cores you have.
Core 3 |
Core 2 |
Core 1 |
Core0 |
0 |
0 |
0 |
1 |
Core 3 |
Core 2 |
Core 1 |
Core0 |
1 |
0 |
1 |
0 |
1. Once you have gathered your Binary value, you need to convert it to a Hexadecimal number using the link below.
https://www.mathsisfun.com/binary-decimal-hexadecimal-converter.html
1. Once you have your HexaDecimal value, locate your MetaTrader shortcut on your desktop, right-click and select "Properties".
2. In the "Target" field add the following text in front of the existing address replacing the # with your HexaDecimal number.
cmd.exe /c start "terminal" /affinity #
3. Click "Apply" and "OK" to save your changes.
4. Open Task Manager again as you did in Step 1, right-click "terminal.exe", click "Set Affinity" and you should now see that only your selected cores are checked.