Spread trading in Meta Trader - page 175

 
leonid553:

As one who once served in the army, I join in congratulating the neighbouring threads on Defender of the Motherland Day.

(Exactly Motherland, but alas, not most of its representatives in government)

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

A small present. In my opinion, there is a promising triple "quasi-arbitrage" entry. Up from the lower limit of the triple spread line channel.

BUY RPH1 ( or EURGBP) & (sell 6EH1 + sell DXH1) = 0.05 ^ 0.1 ^ 0.2
Let's control the situation and wait for the price lines(blue and purple) to converge...

(I should add that yesterday's similar evening entry "downwards" was closed at a good profit - it can be clearly seen on the spread indicator chart! - report http://www.procapital.ru/showpost.php?p=938820&postcount=1336 )

Estimated total profit with the above position sizes = $45-50 (spread channel width)


Congratulations to all who took advantage of the recommendation!

The blue and lilac price lines have converged (crossed), and the spread line has reached the upper limit of the channel!

 

How about trying to work from the channel boundaries followed by a flip. With the lot ratio you have above.

I tried to check it with virtual equity indicator, there seems to be a result. There are not many deals though.

I did not have any shares.

 
Just need to work out with ( recycle2 ) how often the lot ratio needs to be changed to maintain the flat. There's a sliding window there.
 

The Recycle-2 indicator has calculated the size of this particular spread - almost perfect for a spread line flat.

But, - "too good is not good either", - luscious....

The spread line turns out to be "too flat" and it makes no sense to make profit because of its supposedly small size.

That's why I took a slightly different ratio here:

RP-6E-DX=1^2^4- at this ratio, the total expected profit (from "border to border") is small, but it has a rather high probability of making it! Especially when determining the entry point - on the divergence of the indicator price lines!

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

You'd better set the period for calculating the spread channel to a smaller one. It will be much more convenient to work atf=m15.

My parameter ENV_PERIOD is 21 or 34 for small timeframes.

 
leonid553:

The spread line turns out to be "too flat" and there is no point in taking profits because it is supposed to be too small.

Example?
 

Yes, this particular RP-6E-DX spread is exactly what I was talking about.

With the dimensions you suggested from the Recycle-2 calculation (page 165) - the spread line turns out to be too flat:

(ignore the spikes. These are false impulses caused by different start/finish times of futures instruments)

 

Unfortunately, in MT4 there is no information available about the trading time of the FI. In Broco, the detailed FI name contains trade time and expiry date data. And through MQL4 this data can be easily obtained for any FI. Another thing is that, for example, prescribed bidding time does not correspond to reality in many cases.

So if Recycle2 encounters FIs that have intervals when some FI is traded and some are not, Recycle2 assumes that the non-traded FI simply does not change price and takes it into account as traded. I.e. there is a kind of filling in of non-tradable holes with constant price values. This problem does not occur if all FIs are of the same nature.

This actually results in distorted weights. I.e. they can be even better. You could add trade time input parameters to Recycle2, but I won't be doing that.

The Recycle2 spread is indeed the flattest possible, apart from the nuance I described above. And we can indeed adjust weights on purpose to make the spread wider. But you should be aware that when you manipulate weights the risk of spread instability (lack of collapse) increases. Therefore, it should be done cautiously.

Recycle2 itself trades on a sliding window:

  1. For each new bar, a sliding window is pushed over and the relationships within that window are recalculated (which have been, and which will gradually disappear).
  2. You get(IND_Recycle2) as an output the value of the current optimal synthetic (red) and the channel width (blue) of that synthetic on the window.
  3. Notice that you see two characteristics (current value and channel width) of different synthetics on each bar. That is, the different bars correspond to different synthetics. The IND_RecycleShoMe allows you to view synthetics in detail, you just need to move the right vertical line to the bar of interest.
  4. If current value of the synthetic is bigger by a certain value of its channel width(IND_RecycleShowMe will show how it went out of the channel), you should open at the synthetic to the inside of the channel. And close when the synthetic collapses to zero.

This strategy is quite different from classic spread trading, because the spread is rebalanced all the time.

 
and what is the average profit and average loss per trade if you normalise everything to one lot unit?
 

Can you tell me why when Symbol1_K is calculated it writes zero divide. I.e., I need to get data from all three pairs and create an equity line with an envelope based on it, but I need only one order to work. Will it work in the tester?

//======= Определение момента открытия позиций ============
void    Conditions()
{
   Print("5");

  TradeUP   = false;
  TradeDOWN = false;
  
    double Symbol3_K = MarketInfo(Symbol_3, MODE_TICKVALUE)/MarketInfo(Symbol_3, MODE_TICKSIZE);
           Print("5_3");
           
    double Symbol1_K = MarketInfo(Symbol_1, MODE_TICKVALUE)/MarketInfo(Symbol_1, MODE_TICKSIZE);
       Print("5_1");

    double Symbol2_K = MarketInfo(Symbol_2, MODE_TICKVALUE)/MarketInfo(Symbol_2, MODE_TICKSIZE);
           Print("5_2");



    double equity_1 = Symbol1_Vol*Symbol1_K*iClose(Symbol_1,period,iBarShift(Symbol_1,period,Time[1])) 
                    + Symbol2_Vol*Symbol2_K*iClose(Symbol_2,period,iBarShift(Symbol_2,period,Time[1]))
                    + Symbol3_Vol*Symbol3_K*iClose(Symbol_3,period,iBarShift(Symbol_3,period,Time[1]));
                           Print("5_4");

                    
    double equity_2 = Symbol1_Vol*Symbol1_K*iClose(Symbol_1,period,iBarShift(Symbol_1,period,Time[2])) 
                    + Symbol2_Vol*Symbol2_K*iClose(Symbol_2,period,iBarShift(Symbol_2,period,Time[2]))
                    + Symbol3_Vol*Symbol3_K*iClose(Symbol_3,period,iBarShift(Symbol_3,period,Time[2]));
   Print("6");

                    
  /*  
    int counted_bars=IndicatorCounted();
    if(counted_bars<0) return(-1);
    if(counted_bars>0) counted_bars--; 
    int limit=Bars-counted_bars;
    
    double last[];
    datetime t;
        
    // Формируем график прибыльности
    for (int i=0;i<limit;i++) 
      {
        t=Time[i];
        last[i] = Symbol1_Vol*Symbol1_K*iClose(Symbol_1,0,iBarShift(Symbol_1,0,t)) 
                + Symbol2_Vol*Symbol2_K*iClose(Symbol_2,0,iBarShift(Symbol_2,0,t))
                + Symbol3_Vol*Symbol3_K*iClose(Symbol_3,0,iBarShift(Symbol_3,0,t));
      }
   */  
              
    double up_2     = iEnvelopesOnArray(equity_1,0,Channel_Period,MODE_SMA,0,Channel_Dev,MODE_UPPER,1);
    double dn_2     = iEnvelopesOnArray(equity_1,0,Channel_Period,MODE_SMA,0,Channel_Dev,MODE_LOWER,1);
    
   Print("7");

  if(equity_2<dn_2 && equity_1>dn_2)
    {
       TradeUP = true;
          Print("8");

    }
    
  if(equity_2>up_2 && equity_1<up_2)
    {
       TradeDOWN = true;
          Print("9");

    }
  
  if(use_close)
    {
      close(); // функция закрытия позиций на противоположной границе канала
         Print("10");

    }  
  
  if(use_doliv)
    {
      Doliv(); // доливочная функция
         Print("11");

    }  

}

I try to transfer the indicator calculation to the Expert Advisor body


 
I'm out of the question, I found the investment password. The trade is profitable, but the chart is not very smooth. What are the $100-700 losses associated with?
Reason: