Futures bonding - finding seams

 

In order to test the EA, we need to get rid of the seams on the futures glues, particularly on Si.

How do I know the dates of the stitches to eliminate them?

The idea is the expiry day - but where is the list of all expiry days? Maybe there is a way to find out the expiry date without having to collect information?


 

Here's on Si compiled by http://www.moex.com/ru/contract.aspx?code=Si-12.17

Year/Quarter36912
2012 15.03.2012 15.06.2012 17.09.2012 17.12.2012
2013 15.03.2013 17.06.2013 16.09.2013 16.12.2013
2014 17.03.2014 16.06.2014 15.09.2014 15.12.2014
2015 16.03.2015 15.06.2015 15.09.2015 15.12.2015
2016 15.03.2016 15.06.2016 15.09.2016 15.12.2016
2017 16.03.2017 15.06.2017 21.09.2017 21.12.2017


What is the best way to exclude these dates?

Московская Биржа - Основные параметры срочного контракта
  • www.moex.com
Код контракта Цена Изменение, % Объем, ₽ Объем, контр. Откр. позиции Изменение Расчетная цена Исполнение Открытые позиции * Физические лица Юридические лица Итого Длинные Короткие Длинные Короткие Итоги торгов
 

Implemented this way


void OnTick()
  {
//--Исключаем экспирацию по Si
   if(Symbol()=="Si Splice")
     {
      datetime  Open_timeExp=iTime(_Symbol,0,0);
      MqlDateTime strExp;
      TimeToStruct(Open_timeExp,strExp);
      strExp.hour=0;
      strExp.min=0;
      strExp.sec=0;
      for(int i=0;i<23; i++)
        {
         if(StructToTime(strExp)==StringToTime(ExpSi(i)))
           {
            BuyNow=false;
            SellNow=false;
            break;
           }
        }
     }
  }
//////
//+------------------------------------------------------------------+
//|Массив с датами экспирации опциона Si                             |
//+------------------------------------------------------------------+
string ExpSi(int i)
  {
   string Exp[24]=
     {
      "15.03.2012 0:00",
      "15.03.2013 0:00",
      "17.03.2014 0:00",
      "16.03.2015 0:00",
      "15.03.2016 0:00",
      "16.03.2017 0:00",
      "15.06.2012 0:00",
      "17.06.2013 0:00",
      "16.06.2014 0:00",
      "15.06.2015 0:00",
      "15.06.2016 0:00",
      "15.06.2017 0:00",
      "17.09.2012 0:00",
      "16.09.2013 0:00",
      "15.09.2014 0:00",
      "15.09.2015 0:00",
      "15.09.2016 0:00",
      "21.09.2017 0:00",
      "17.12.2012 0:00",
      "16.12.2013 0:00",
      "15.12.2014 0:00",
      "15.12.2015 0:00",
      "15.12.2016 0:00",
      "21.12.2017 0:00"
     };

   return (Exp[i] );
  }
//+------------------------------------------------------------------+

Is there a smarter way?

 
Aleksey Vyazmikin:

In order to test the EA, we need to get rid of the seams on the futures glues, particularly on Si.

How do I know the dates of the stitches to eliminate them?

The idea is the expiry day - but where is the list of all expiry days? Maybe there is a programmatic way to find this, so I do not need to gather information.


Why guess?

From the current date, you can get the name of the most liquid futures for the instrument and the next following one. And compare the bars of the glue and these two futures. That way you will understand where they make the transition and according to what algorithm.

 
pivomoe:

Why guess?

From the current date, you can get the name of the most liquid futures on the instrument and the one following it. And compare the bars of the glue and these two futures. This way you will understand where they make the transition and according to what algorithm.

I do not understand your logic.

I'm not suggesting to guess - I collected the expiry dates on Si.


 
Aleksey Vyazmikin:

I don't understand your logic...

I am not suggesting guessing - I have collected the expiry dates on Si.


Where do you get the information that the gluing happens on the last day of the circulation? I understand that you think (or know) that the glue is made up of one futures and then the other. What if it does not? Where does this information come from?
 
By the way, there is a last day of circulation in the symbol properties. It can be accessed from the advisor.
 
pivomoe:
By the way, in the properties of the symbol is the last day of circulation. This can be accessed from the EA.

there is, but it is useless for ruling out glue splices

For example the current Si-9.17 is 21.09.2017


and it is better to exclude not only the 15th, but also the 16th, imho

 
Aleksey Vyazmikin:

Implemented this way


Maybe there is a more rational way?


I suppose you could just exclude the 14th to the 17th of the 3rd, 6th, 9th and 12th months

 
pivomoe:
Where is the information that the gluing is on the last day? As far as I understand you think (or know) that up to a certain point in time the glue is composed of one futures and then another. What if it does not? Where does this information come from?

The stack consists of different futures. About the last day - an observation, including the chart shows it. But this is at Otkritie broker, others may be different.

 
pivomoe:
By the way, there is a last day of circulation in the symbol properties. It can be accessed from the EA.

How to find old futures - they are not in the tools.