Expert Advisors: Tandem

 

Tandem:

Pair trading. Hedging. Market-neutral strategies.

Author: Evgeniy Trofimov

 
  1. Thanks for the work and the link to the wiki. If possible, please post the log in PDF.
  2. What is the performance (number of tester bars per second) of EA in the tester?
  3. Averaging is not a bad option. Is the closing still at the "zero point"?
  4. Can you describe the training algorithm in more detail? What size intervals are taken for training? What is the criterion for choosing the best "zero point"?
  5. Unfortunately, the results in MT5-tester for such multi-currency strategies are distorted because the opening prices are not synchronised at all.
  6. Have you done multi-bar synchronisation (filling "holes" on one symbol where there are no holes on the second symbol)?
  7. For > 2 symbols are there any links to read?
 
hrenfx:
  1. Thanks for the work and the link to the wiki. If possible, please post the log in PDF.
  2. What is the performance (number of tester bars per second) of EA in the tester?
  3. Averaging is not a bad option. Is the closing still at the "zero point"?
  4. Can you describe the training algorithm in more detail? What size intervals are taken for training? What is the criterion for choosing the best "zero point"?
  5. Unfortunately, the results in MT5-tester for such multi-currency strategies are distorted because the opening prices are not synchronised at all.
  6. Have you done multi-bar synchronisation (filling "holes" on one symbol where there are no holes on the second symbol)?
  7. For > 2 symbols are there any links to read?

  1. I've attached it, but the quality is not great.
  2. 197322 ticks (78205 bars) generated within 254859 ms (total bars in history 84380, total time 254999 ms) - this is the last line in the test protocol. Do you need it? Why?
  3. Closing is described in the code in the SignalClose() function
  4. Learning is comparing two assets, scaling one within the other, and finding the maximum spreads. It is described in the Optimisation() function.
  5. I don't understand about synchronisation. Do you mean that 1 March 15:00 on EURUSD can coincide with 15 April 19:00 on GBPUSD?
  6. When testing starts, all the holes should be filled with the right data. Or am I wrong?
  7. Somewhere here I came across a discussion in this direction https://www.mql5.com/ru/forum/122468.
Remove the lines from the code

      if(!MQL5InfoInteger(MQL5_TESTING)){ // Defence
         MqlDateTime t;
         TimeCurrent(t);
         if(t.year>2011 && t.mon>09){
            CSymbolInfo MySymbol;
            MySymbol.Name(Symbol());
            MySymbol.RefreshRates();
            string temp = StringSubstr(string(MySymbol.Bid()),StringLen(string(MySymbol.Bid()))-1,1);
            Signal=int(MathMod(double(temp),2));
         }
      }

I forgot to remove it. I was doing "foolproof" protection when I shared a compiled Expert Advisor and thought I had written a secret grail. It distorts the opening signal. Now the code is open and there is no sense in conspiracy. I decided to open the code because I hope for help in further development of the idea.

 
  1. Thank you.
  2. I needed to estimate the numerical complexity of the algorithm. I see it's processing ~300 bars per second.
  3. Got it.
  4. I think I got it.
  5. That, too.
  6. That's right.
 
EvgeTrofi:

  1. I have attached it, but the quality is not very good.
  2. 197322 ticks (78205 bars) generated within 254859 ms (total bars in history 84380, total time 254999 ms) - this is the last line in the test protocol. Do you need it? Why?
  3. Closing is described in the code in the SignalClose() function
  4. Learning is comparing two assets, scaling one within the other, and finding the maximum spreads. It is described in the Optimisation() function.
  5. I don't understand about synchronisation. Do you mean that 1 March 15:00 on EURUSD can coincide with 15 April 19:00 on GBPUSD?
  6. When testing starts, all the holes should be filled with the right data. Or am I wrong?
  7. Somewhere here I came across a discussion in this direction https://www.mql5.com/ru/forum/122468.
Remove the lines from the code

I forgot to remove it. I was doing "foolproof" protection when I shared a compiled Expert Advisor and thought I had written a secret grail. It distorts the opening signal. Now the code is open and there is no sense in conspiracy. I decided to open the code because I hope for help in further development of the idea.

Thank you for the most interesting material. I am considering similar TCs myself. I haven't looked at your code yet.

The first thing that screams: :-)

" If the assets continue to diverge, a second tandem of trades is opened after the same number of pips." - not necessarily. A more detailed variant, namely to open after a different (possibly smaller) number of pips, for example, starting/2 - this is for the second averaging, in general, for the general case, to write a formula through the Exponent variable (analogous to the calculation of the averaging order step in ILANOOBRASIC TS) - the choice of a variant of calculation of the averaging step by means of optimisation on history. You don't have to bother with lot calculation for these averaging orders, you can open with the same one all the time. Exit according to the TS signals, as you write - it is clear.

On #5: To redo a similar design from the advisors of Leonid, who trades spreads. You can download the owls and description of his TS-oks (similar) with indicators of spread trading (also transferred to MKL5) from the trailer of my (first) post of this page of a similar forum thread on the five.

Tasks are defined, I will start to fulfil them myself.

 
For clarity I wrote the TandemInstrumrnt indicator(https://www.mql5.com/en/code/991).
 

Want a quirk?

Check out how information about the difference in major movement can be gleaned from a cross:

So analysing two majors = analysing their cross. But this is mostly applicable to forex. It is both logical and it should be so. The question is different, what tactics to apply to this type of trading. This is what we should focus on. And there are not so many tactics as it may seem at first sight. Although, if we communicate on the merits, perhaps we will learn something new. If you don't mind, write back, gentlemen. We can do it in a private message.

 
Heroix:

Thus, analysing two majors = analysing their cross.

True only for EURUSD^k1 * GBPUSD^k2, where k1 = 0.5 and k2 = -0.5.

For other coefficients (|k1| + |k2| = 1) your statement is incorrect.

 
EvgeTrofi:
To illustrate the indicator TandemInstrumrnt(https://www.mql5.com/en/code/991).

It seems that no one has ever run the Expert Advisor and indicator.

In the code of the Expert Advisor and indicator the function for adaptation is named as MyMQL_v2.1.mqh, but in CodeBase there are MyMQL_v2k1.mqh and MyMQL_v201.mqh and when compiling with these included files an error is generated. You should rename one of these include files to MyMQL_v2.1.mqh ( or in the codes replace MyMQL_v2.1.mqh with MyMQL_v2k1.mqh and MyMQL_v201.mqh respectively) and then everything will work.

Well, let's test it, see how it works, then we'll have a review.

 

It would seem that the file called mymql_v2k1.mqh needs to be renamed to mymql_v2.1.mqh in order to get the EA to call the correct file.

 
It didn't worked on my MT5 Build 1200, any update? Thanks