Spread trading in Meta Trader - page 162

 

hey, everybody, hey, bear,

Where can I get some turkeys?

 

Answer all 4 points as you think right, I'll quote my lots and we'll compare.

P.S. It doesn't have to be a double spread. You can do more than that.

 

I apologise for the slight delay in replying.

So. Your points are like this:

1.Выбираются ФИ для сравнения
2.Интервал построения.
3.Выдается соотношение лотов. Ограничения на расчет лотов (мин. лот и мин. шаг лота) не накладывается.
4.Сравнение производится через индикатор реального (несглаженного) спреда по заданным лотам.

Just now realised it's not quite clear - what is FI ?

1. Well, let's assume that it is a selection of instruments for "arbitrage" based on their fundamental characteristics - cointegration, correlation, etc. There's no getting away from that and I agree with that.

2. the build interval is apparently chosen depending on the timeframe on which we are going to work. I assume that for currency instruments it's better to work arbitrage in short-term trades, on anf from m15 to n1.

For commodity market instruments (as well as indices, securities, etc.) it is preferable to work long term, on larger timeframes - n4, D ... - ... with consideration of multiyear seasonal trends.

3. Here is where I particularly disagree with you - it is from the beginning to set the size of the position based on the instrument margin!

I think that initially - "Select the size of the legs of the instruments based on their specifications (the size of the tick and the value of the pip), and the ratio of their daily average volatility, and these volatilities should be expressed in the currency of the deposit , not in points. In short, lots should be selected in such a way that each leg changes its equity by approximately the same value during a day. As the legs (in most cases) are multidirectional, such spread position can be considered neutral (balanced). Naturally, it is assumed that there is a sufficiently high correlation between the legs, otherwise neutrality is out of the question. " (c, - meat, broco forum )

This is exactly what the price line indicator does, which calculates the estimated position sizes - see code above.

4. Further we substitute the calculated sizes in the spread indicator and begin to dance from there, changing these sizes with small steps - to "drive" the spread line in a predictable horizontal or slightly inclined channel!

==========================

Here is an example, as promised. Usually (so to speak - "classic") spread SI-GC - trade 1:1, but it turns out that in fact there is a pure silver trade, because there is a clear bias towards the leg SI! This is clearly visible, because the graph of the spread line at a ratio of 1:1 - very close to the silver price chart.

For example let's take tf=m30 for the specified spread.

And taking into account what I mentioned above, the indicator calculates volumes with predominance in favor of gold SI-GC = 1 :2.3,

and by further visual selection it turns out that with the ratio SI-GC = 1 :3, we get almost perfectly predictable spread channel - I remember, I almost could not believe my eyes - when about a month and a half ago - found out such a situation! And I have been trading very well since then (with significant Deposit benefits) with this spread - as SI-GC = 1:3

Let me explain in a nutshell - that there are two conditions for entry (buy or sell spread). We wait for the spread line to move beyond the upper or lower limit of the channel. And when the price lines of the top indicator stop diverging and start to converge, and the spread line turns back inside the channel - we use the paired entry SI-GC = 1:3! And then - total profit closing - strictly at the point of price lines convergence!

Here, look for yourself - this is an old drawing of mine, which I sent to my friends about two weeks ago!

The spread is built for SI -GC = 1:3

 

FI is a fin. instrument.

Two requests:

  1. How do I get to the server from which you take the price data?
  2. How is the spread indicator calculated based on specified lots? If possible, attach a piece of code responsible for this.
 
ZZZEROXXX:

hey, everybody, hey, bear,

Where can I get some turkeys?

The address http://www.procapital.ru/showpost.php?p=775025&postcount=1 has links to almost all the indices you need.
 
hrenfx:

FI is a fin. instrument.

Two requests:

  1. How do I get to the server from which you take the price data?
  2. How is the spread indicator calculated based on specified lots? If possible, please attach a piece of code, which is responsible for this.


If I understood correctly, download mt4 from dtz Broko website (see previous post) and open a demo account on the contest server ( not on the demo).

This is necessary for analyzing calendar spreads (eg HEK1-HEJ1) . Because they are not available on the normal demo.

BroCoInvestments-Contest
IP 87.239.186.20
You can download the source code of the spread indicator here (for this indicator see Sergey Ogarkov)

http://www.procapital.ru/showpost.php?p=813139&postcount=264

This is the calculation code:

extern double Symbol1.Vol=1; // multiplier (position size) of BUY leg
extern double Symbol2.Vol=1; // Multiplier (pose size) of SELL leg

int init(){

  if(EquityScale) {// выключатель постороения спреда по заданным размерам позиций.
    Symbol1.K = MarketInfo(Symbol1.Name, MODE_TICKVALUE)/MarketInfo(Symbol1.Name, MODE_TICKSIZE);
    Symbol2.K = MarketInfo(Symbol2.Name, MODE_TICKVALUE)/MarketInfo(Symbol2.Name, MODE_TICKSIZE);
  }
  else {
    Symbol1.K = 1;
    Symbol2.K = 1;
  }
 

Next:

int start()
{
for (i=0;i<limit;i++) {
    t=Time[i];
    Last[i] = Symbol1.Vol*Symbol1.K*iClose(Symbol1.Name,0,iBarShift(Symbol1.Name,0,t)) - 
              Symbol2.Vol*Symbol2.K*iClose(Symbol2.Name,0,iBarShift(Symbol2.Name,0,t));

Yes, however - here is the download of the indicator.

Files:
 

Chart settings above SIH1-GCG1=1^3 - see figure.

For gold, it would be better to take the April, J-contract, as the February G-contract is already becoming illiquid.

 

The situation on the spot precious metals markets is exactly the same.

Below is a chart from mt4 dtz systemforex, m30.

Only the spread is plotted on the gold chart, i.e. GOLD-SILVER.

Very well you can see the last entries - last week on Friday selling GOLD-SILVER =3^1 and this morning buying GOLD-SILVER spread =3^1

Both entries are profitable. Second, - today's entry will be closed at the point of convergence (crossing of price lines)

 

Unfortunately on Broco the story on M30 is only 1000 bars, so got such lots on the appropriate interval:

Took almost the same interval, but in FxPro and on M1 (30,000 bars), due to which the accuracy should be much higher:

On these intervals it is impossible to bend the spread of these FIs into a more balanced horizontal channel.

 

Yes - I noticed the Recycle indicator earlier.

I still haven't got around to looking into it...

===================