Trading spreads on currencies. Spreader 2

 


Description:


The Expert Advisor calculates everything by itself, i.e. where to open and with which lot. It calculates optimally, so that either to quickly gain positive spreads and close in the black, or, if something goes wrong, to calmly sit out the drawdown. Miracles do not happen, so drawdowns take place, and sometimes for a long time. The Expert Advisor doesn't use any indicators, everything is calculated only by history - the last 60 bars. Thus we do not need a big quotes history (it is very useful, if brokerage company does not give quotes for a long time).

  • Initial deposit for default settings: $10000
  • Time frame: M1

Pairs should be positively correlated in the long term.

The pairs must have the same base currency for pips. I.e. EURUSD and GBPUSD will do, since pips are calculated in USD. GBPJPY and CHFJPY are also valid, since pips are counted in JPY. Not valid for EURUSD and USDJPY, because the first pair has its pips in USD, the second in JPY.

It is impossible to install two different Expert Advisors at the same time for which some pairs are the same. The EA does not have magiks. However, magicians are not needed if everything is set according to the instructions because almost every brokerage company can select crosses so that base currency for pips coincides and at the same time pairs do not intersect in advisors.

If the default settings, then you can select six pairs that I have so far been able to test on a demo account:

  1. I put the advisor on NZDJPY, in the seconds_instrument parameter put AUDJPY
  2. Put an EA on CHFJPY, entering GBPJPY in the seconds_instrument parameter
  3. Put advisor on EURUSD, entering GBPUSD in the seconds_instrument parameter
  4. Add an Expert Advisor to USDJPY, entering CADJPY in the seconds_instrument parameter

Input parameters:

  • seconds_instrument - second currency pair
  • lots - volume of the open position in lots on the pair, on which the advisor is installed (for the second currency pair, specified in the seconds_instrument parameter, the volume in lots will be calculated automatically).
  • profit - profit in the currency pair, at reaching which the Expert Advisor will automatically close positions on both pairs

Note:


  • The Expert Advisor is not always in the market. Therefore, do not be surprised if it will not open positions for a long time.

A short description of the operation principle:


The advisor waits for both correlated pairs to go up in one section of 30 bars and to go down in the second section. If both sectors show only up or only down movement, the Expert Advisor does not do anything, but only writes in the comment: Trend found. If the pairs run apart, i.e. a negative correlation is observed between the pairs, it will also not do anything and will write in its comment: Negative Correlation.


Once the upward movement and the downward movement in both sections and synchronously in both pairs are detected, optimisation is carried out, i.e. calculation of profits in both sections, regardless of the direction of the trend (whether upward or downward). Optimization means selection of an optimal lot size for the second pair and dividing pairs into two: main and hedging for the first leg, i.e. which one is to be long and which one is to be short. After all this, positions are opened for both pairs according to the calculations. As soon as the profit reaches the value specified in the profit input parameter, both pairs will be closed automatically. Everything repeats.


One of the pairs is the main one and the other one is a hedge for an upward trend movement. I.e. the main one collects profits, and the hedging one hedges against drawdowns. When the trend moves downwards, the pairs switch roles. The hedging pair decreases the risk, but it has to pay for it, i.e. it eats away the profit. But you can't do without it, otherwise the risk will be unlimited when the trend changes.


What is new in the second version?


Since the market is a very tricky one, i.e. it makes a lot of false moves that can mislead any TS, we have added an additional lice check. The Expert Advisor checks if the calculated volumes and directions would give a profit if traded with them 24 hours before the calculation. If the result of this check is negative, i.e. in this case we would have incurred a loss, the calculation of volumes and directions is considered wrong and a "False testimony" message appears in the comments. Thus it is possible to reduce the drawdowns and decrease the probability of losses.


What's new in the third version?


The adviser now closes unprofitable trades by itself. In other words, it is now a full automatic. But, now the possibility of aggressive pipsing is excluded, because very small value of the input parameter profit will lead to frequent closing of unprofitable deals and correspondingly to a loss of the deposit.
Files:
 
Reshetov писал(а) >>

Description:


What's new in the second version?

Since the market is capable of slyness, i.e. it makes a lot of false moves which can mislead any TS, an additional lice check has been added. The Expert Advisor checks if the calculated volumes would give a profit if you start trading with them 24 hours before the calculation. If the result of this check is negative, i.e. in this case we would have incurred a loss, the calculation of volumes is considered to be incorrect and we get the following message in the comments: "False testimony".

and the position is not opened or it is opened with different lot calculation?

 
sever29 >>:

и позиция не открывается? или открывается, но с другим расчетом лота?

Try to guess three times

 
Reshetov писал(а) >>

Try three guesses.

Got it, I'm your allergen.

P.S. Don't swear. OKAY? Add magik to it, please.

 

Where are the other two pairs? :)

 
sever29 писал(а) >>

and the position does not open? or does it open, but with a different lot calculation?

>>It does not open.

 
Swetten >>:

А где ещё 2 пары? :)

The moths have eaten

 
sever29 >>:

Понял, я Ваш аллерген.

П.С. Только не ругайтесь. ОК? Добавте в него пжл магик.

No way. I'd rather be scolded than be scolded by people who don't read the instructions.

 
Reshetov писал(а) >>

No way. I'd rather be scolded than be scolded by people who don't read the manual.

I know them by heart.

 

Well, let the testing begin.

username 2196960

investor password 0wxtvyt

EA settings: lot - 1.0, profit - 100. No trades so far.

Maybe somebody will launch it with another profit? Pairs mentioned above.

 

The first start on a new advisor:


57741592010.02.15 07:43buy8.67gbpusd1.56530.00000.00002010.02.15 08:361.56450.000.000.00-693.60
57741642010.02.15 07:43sell10.00eurusd1.35990.00000.00002010.02.15 08:361.35830.000.000.001 600.00
Reason: