Arbitrage

 
I will not explain what a necessary arbitrage is. This case a similar strategy is proposed, only in real arbitrage trades are executed when there is an advantageous price difference between the real product and exchange contracts. In this case the difference is taken only for exchange contracts.
The essence of the strategy is simple, i.e.
  • If the price is low, we buy cheap. Moreover, the lower the price falls, the higher the volume of purchases.
  • If the price is high, you sell at a higher price. The higher the price went up, the higher the volume of sales.

The result is a typical counter-trend strategy with all its consequences. And the consequences are only that if we trade using this TS on one pair, we obtain the profit on pullbacks or trend reversals, as well as on all flops and bounces. At other times, i.e. along the trend, we do not obtain anything but losses in equity.

Here is a typical example of testing such a strategy:




One can only dream about such parameters of the trading system, as they say. Unless, of course, you pay attention to the funds. However, if a dealer sets a margin call, then in this case, with the remaining funds on the deposit, the Expert Advisor will pull the balance to the very level that is shown on the chart (I checked it, i.e., on a demo account once it managed to hit the margin collision once, when the trend reversed, it was successful).I.e. on the demo account once I managed to hit the margin coll and at the first trend reversal the balance turned to the profit. i.e. this strategy allows holding it to the end, unlike such malignant TPs as Martingale, for example. If you do not have enough money in your account, you can still borrow and invest in the strategy. Sooner or later it will return all debts with more than enough. (With Martingale, profits grow linearly and losses exponentially, so even a short series of losses does not allow you to win back. In this TS both profits and losses are close to linear, and therefore the strategy allows to survive rather long "black" Tuesdays, patiently waiting out the bad times, until the holidays in your street).

There are several methods of dealing with sharp fall of equity. Namely, we can set several Expert Advisors for different instruments. In this case, we will have diversification that will smooth the decrease of equity. The second method provided in this Expert Advisor is group multitrading for several instruments with inverse rates. In this case, if there is an uptrend in one instrument and a downtrend in the other, the Expert Advisors will sell on the uptrend and buy on the downtrend. This is a real arbitrage, i.e. buying low on one instrument and selling high on another. The result of such speculations will be reflected not in the balance, but in equity, which is most relevant. Everything will return to the balance after reversals or pullbacks.

Inverse rates do not necessarily have to be applied to the deposit currency, you can apply them to any currency, as long as the first currency in all symbols is the same. For example:
  • Inverse to the quid: USDJPY, USDCHF, USDCAD, USDSGD, etc.
  • Reverse to EUR: EURUSD, EURGBP, EURCHF, EURJPY, etc.
  • Inverse of GBP: GBPUSD, GBPY, GBPCHF, GBPNZD, etc.
One more important note: all pairs in the group should have the same contract sizes according to the specification. Most often dealer sets 100000 units per lot. If the contract sizes of any pair differ from the other pairs in the group, then such currency pair should not be included in the same group.

How to configure. Each Expert Advisor has only three non-optimizable (there is nothing to optimize) parameters:

1. experts - the number of advisors in a group according to the reverse exchange rate currency, for example, if you have three advisors on the USDJPY, USDCHF and USDCAD charts, then this parameter should be equal to 3. But the magic number should be the same for all three EAs. When testing individual EAs, this parameter should be set to 1. Multicurrency mode is not implemented in the tester, therefore EAs of a group can be tested individually.
2. magicnumber - magic number. It is used to distinguish the groups of Expert Advisors by the reverse exchange rate currency. Please note that at the moment of setting a group of advisors there should not be closed deals in the history of the account, whose magic number will be the same as the number of the new group. The Expert Advisor looks through the account history for both opened and closed positions and makes all calculations on them.
3. beginPrice - the initial Bid price for a particular instrument. This is the current price at the time of installation of the Expert Advisor. If you test the Expert Advisor on historical data, then take the starting price of the history.

Note for especially gifted people: All parameters for each EA are set once before it is launched and will not be changed during autotrading. (The current price at the moment of installing the EA is not the current price at any other time. It is the starting price to determine where the quotes went before the first contract for the instrument was opened. For the second contract the starting price will be the opening price of the first contract. For thethird one, the opening price will be the price of the second contract etc.).

And in the attached file there is a compiled code of the Expert Advisor for independent testing and application. The quality of testing is of no importance as the EA:
  1. Only gives orders on the bars that have been formed
  2. does not trade on the signals of technical indicators, and uses only current prices
But if anybody wants, please fill the tester with the history of minutes, starting from the Stone Age.
Files:
 
Christ is Risen! Happy Holidays, gentlemen traders and all those who pretend to be traders!

Mr. Reshetov gave us a festive gift.

He started a demo. I wonder how long it would take him to lose 10 000?

He put his EAs like dogs on charts

wizard number 1 - USDCAD USDJPY USDCHF USDSGD USDZAR USDDK USDNOK USDSEK
magic number 2 - EURUSD EURAUD EURCAD EURCHF EURGBP EURJPY EURNZD
wizard number 3 - GBPUSD GBPAUD GBPCAD GBPCHF GBPJPY GBPNZD
Magic number 4 - AUDUSD AUDCAD AUDCHF AUDJPY AUDNZD
Magic number 5 - NZDUSD NZDCAD NZDCHF NZDJPY
wizard number 6 - CADCHF CADJPY

Prices are based on Friday's close. Today is Sunday.

have I got the groups and magics right?
 
usdjpy:
Christ is Risen! Happy Holidays, gentlemen traders and all those who pretend to be traders!

Mr. Reshetov gave us a festive gift.

He started a demo. I wonder how long it would take him to lose 10 000?

He put his EAs like dogs on charts

wizard number 1 - USDCAD USDJPY USDCHF USDSGD USDZAR USDDK USDNOK USDSEK
magic number 2 - EURUSD EURAUD EURCAD EURCHF EURGBP EURJPY EURNZD
wizard number 3 - GBPUSD GBPAUD GBPCAD GBPCHF GBPJPY GBPNZD
Magic number 4 - AUDUSD AUDCAD AUDCHF AUDJPY AUDNZD
Magic number 5 - NZDUSD NZDCAD NZDCHF NZDJPY
wizard number 6 - CADCHF CADJPY

Prices are based on Friday's close. Today is Sunday.

have I got the groups and magics right?

Yes, if all pairs in a group have the same contract sizes according to the specification. In this case they will have parameters:

for all USD* magicnumber = 1
for all EUR* magicnumber = 2 experts = 7
all GBP* magicnumber = 3 experts = 6
all AUD* magicnumber = 4 experts = 5
all NZD* magicnumber = 5 experts = 4
for all CAD* magicnumber = 6 experts = 2
 
Reshetov:
I will not explain what arbitrage is. In this case a similar strategy is proposed, only in real arbitrage transactions are made when there is a profitable price difference between the real goods and exchange contracts. And in this case the difference is taken only for exchange contracts.
From 1999 to today.

 
Christ is Risen!
Mr. Reshetov, please explain what the "beginPrice" parameter is for. The Bid price can be determined programmatically. It's not convenient to do it manually.
 
At the heart of the idea are two key concepts - a real commodity and an exchange-traded contract.
If the price of an exchange-traded contract is the price of a currency at some point in time, then
how is the price of a real commodity, i.e. the currency we are arbitrating on, determined?
And if this real price changes at some point in time?
If under the notion of real price there is nothing reasonable and it is an adjustable unchangeable parameter, then we obtain the same martingale, only the multiplier is equal to one.
When trading with a basket of correlated currencies, it is clear that there is a probability that the profit of the basket will be in the plus at some moment of time.
This raises the question of selecting such a basket.
 
Doctorcoot:
Christ is Risen!
Mr. Reshetov, please explain what the "beginPrice" parameter is for. The Bid price can be determined programmatically. But it's not convenient to do this manually.
Because when you run event start() program does a complete recalculation of accounting from the history, i.e. all already closed and open positions with their magic numbers. Obviously, it starts from the initial price, which was before the first transaction on the pair. Of course, it would be possible to store all of the accounting information in files or in global variables. But what is the sense of bothering about it, if the account history is already kept and available to Expert Advisors? The only thing left to do is to store the initial price, and since this information can also be stored in the input variable, that is what we are doing.

It would be very amusing to see the process where the hapless EA will manually enter the Bid price into input parameters of all EAs as the same price changes. I wonder how much you have to drink on Easter to come up with that?
 
The resurrection indeed! Clearly, such drawdowns do not last long in the real world.
 
Of course, I wouldn't risk putting such a car on the real world, but overall it's not a bad idea. I'd like to have a look at its internal organs. How about sharing the code for all to see? (If you don't mind)
 

The attached EA buys when the price falls by N pips and sells when it rises by N pips.
May be useful for someone.
Note: score a large depot in the conditions at once.

Files:
surfing.mq4  4 kb
 
Reshetov:
for all EUR* magicnumber = 2 experts = 7
So far only +22.39 EUR* closed in EUR* group

Server: SIG-Demo.com
Login: 1000132033
Investor Password: grmn2un