ICB Insured Currency Basket
The Expert Advisor trades on instruments with a high correlation. At the same time, it insures (hedges) each transaction is made at the expense of another instrument.
The principle of insurance is that we buy one instrument, and sell the opposite one. Since pairs with a positive correlation always follow in the same direction, the Expert Advisor cannot get a big loss in total. This method of trading insures transactions and therefore a stop loss is not needed here!
The EA calculates the lot based on the tick value and the current balance. This is done so that one instrument (currency pair) can compensate for the other....
I selected these pairs using a script that determines the correlation for a given period of time (BEST CORRELATION). You can also use the CORR script..
The Expert Advisor sells (sell) at the highest of all instruments and simultaneously buys (buy) at the lowest. Due to this, insurance against any currency movement is obtained. The main thing is to choose the tools themselves in such a way that they correlate well with each other. This can be checked by the nature of the movement of currencies, they almost repeat the movement of each other! Transactions are closed as soon as the total profit reaches the specified value as a percentage of the deposit.
Attention! All parameters are set as a percentage of the deposit!
In the parameters of the Expert Advisor, in addition to the traded instruments, you need to set the lot and the closing profit.
- % balance LOT-the lot is calculated based on the percentage of the balance that you specify in this parameter. The higher the percentage, the larger the lot. The calculation involves the cost of a tick, and therefore different lot values can be set for each instrument at the same percentage.
- % balance Profit Close – The percentage of the balance at which we close all transactions. For example, in our case, the balance is 120 USD and at the specified percentage of 0.1% we get 0.12 Usd – with such a profit, we will close transactions.
It is clear that the correlation cannot be constant, so to insure against incorrect inputs, you can apply a correlation filter that will not allow you to open positions if the correlation of instruments is less than the specified one
-Filter Correlation-we specify the correlation percentage below which transactions will not be opened.
- TF-correlation calculation timeframe
-Bars Correlation – the number of candles on which we determine the correlation
if the filter is enabled, the Expert Advisor shows the correlation value for the selected pairs
You can stop the Expert Advisor by clicking on the "Trading is allowed" button or by setting the time limit in the parameters:
- TimeStart= 0; the start time of the adviser
-timeEnd = 24; the end time of the Adviser
If the button is pressed, it turns red. But the Expert Advisor does not throw open trades. He will bring them to close and will not open new positions. The same is true when time trading is prohibited.
During the trading process, you can independently close some or all positions by clicking on the corresponding buttons