Pair trading and multicurrency arbitrage. The showdown. - page 85

 
Roman Poshtar #:
I found all the turkeys on the subject. I'll put them in there tomorrow and we'll see. So far.

How did you calculate volumes?

You can't trade cross and trading divergences, you should do it like this: https://www.mql5.com/ru/forum/448777/page84#comment_50303521.

otherwise it's noise. More precisely, then not so much divergence is traded, but 1 pair out of two.

Парный трейдинг и мультивалютный арбитраж. Разборки.
Парный трейдинг и мультивалютный арбитраж. Разборки.
  • 2023.11.02
  • www.mql5.com
Добрый день уважаемые форумчане. Немного почитав форум, наткнулся на несколько тем по арбитражу и парному трейдингу...
 
Maxim Kuznetsov #:


According to my calculations at each moment of time, the coefficients are as follows

0
0.3280
0.6720 

And the zero coefficient walks along the triangle, depending on the sign of profitability (+ -) of this or that instrument.

0.6316
0.3684
0


I came to the conclusion that zero is replaced by one.
Therefore, at different moment of time any symbol can have a lotness with coefficient 1.

 

Today I took a test sliding on one pair.
The sliding has not collapsed yet, I'm watching ))
And this is without applying the formula, as I have not implemented the calculation yet.
Just on the yield of two instruments.

te

In principle, those who find it difficult to implement the calculation formula, can even catch sliders without it.
Just calculate the yield, and you will see everything.
 
Maxim Kuznetsov #:

VolumeA=LgA/(LgA+LgB)

The price change rate of the triangle is constantly changing. Of course, at the moment of entry you can choose a lotness similar to the rate of price change at the moment of entry, but this lotness will be relevant only at the moment of entry. In a second everything can, and most likely will, change.

 
Maxim Kuznetsov exchange rate dollar to dollar = 1, const LgU=Ln(1)

VolumeA*=LgA^2/(LgA^2+LgB^2+LgU^2) ; (* unnormalised)

Correct, although it seems to be correct

Of course it's weird: strictly to the contrary... should be "volume is inversely proportional to the logarithm of price"

and the correct formula for how exactly "inversely proportional" should be thought about, maybe someone can tell you :-)



 
Maxim Kuznetsov #:

something about calculating the volume for the discrepancy trade is getting weird:

...

Correct it, although it seems to be correct

Ideally, you should also take into account the volatility of instruments,
as the USDCHF's trading performance is almost 2 times lower than that of GBPUSD.

 
Grigori.S.B #:

Ideally, one should also take into account the volatility of the instruments,
as USDCHF's running qualities are almost 2 times lower than GBPUSD's.

when converted to a common base - the same :-) USDCHF and USDGBP make the same equal percentages

 
Maxim Kuznetsov #:

when converted to a common base, they are the same :-) USDCHF and USDGBP make the same equal percentages

If in % then yes, I agree.

 
Roman #:

Calculate the yield.
Then apply the formulae by finding the missing formulae.
Yes, there is maths involved, but it's not complicated, and the same solution is available using different methods.

One-step maths.

but I haven't seen it yet,

I haven't seen anyone realise which one.

so it would look very strange if I told you "to the point".

;))))

 

Here's what I've got. Criticise it.

   double lgS=MathLog(priceS);   // это продаём
   double lgB=MathLog(priceB);   // это покупаем
   double lgU=MathLog(1.0);      // через USD торгуем (const 0)
   // если пивот не дали, считаем сами
   if (pivot==0) {
      // равновесие, приблизительно средне-квадратичное
      double lgMin=MathMin(lgS,MathMin(lgB,lgU));
      double pivot=lgMin+MathSqrt((MathPow(lgS-lgMin,2.0)+MathPow(lgB-lgMin,2.0)+MathPow(lgU-lgMin,2.0))/3.0);
   }
   // амплитуды, у металлов вдвое выше
   double ampS=(SymbolInfoString(symS,SYMBOL_CURRENCY_BASE)=="XAU"||SymbolInfoString(symS,SYMBOL_CURRENCY_BASE)=="XAG")?2.0:1.0;
   double ampB=(SymbolInfoString(symB,SYMBOL_CURRENCY_BASE)=="XAU"||SymbolInfoString(symB,SYMBOL_CURRENCY_BASE)=="XAG")?2.0:1.0;
   // весовые коэфф.
   double weightS=1.0/(MathSqrt(MathAbs(pivot-lgS))+ampS);   // ?? 1.0/MathAbs(pivot-lgS)*ampS)
   double weightB=1.0/(MathSqrt(MathAbs(pivot-lgB))+ampB);
   // нормированные веса
   double normS=weightS/(weightS+weightB);
   double normB=weightB/(weightS+weightB);
   // инвест в продажу/покупку
   double investS=invest*normS;
   double investB=invest*normB;

the principle of volume inversely proportional to log price is observed and the numbers are reasonable.

centre-pointing and amplitudes are available. I'm not quite sure about the sqrt() in weightS.

Reason: