Spread trading in Meta Trader - page 109

 


This indicator has a problem with bar synchronisation.

I overlaid the gold chart on the silver chart. I highlighted the corresponding bars, the shift is significant, but it seems that the instruments are so well separated and great entries are visible, but unfortunately, this is not the case...

 

Yeah, I guess so...

I inserted lines in the code for simple synchronisation:

   for(int i = 0; i < iBars(NULL,Period()); i++)
   {
      int symb2Shift = iBarShift( simbol,Period(),iTime(NULL,Period(), i),true);
      if( symb2Shift != -1)
      { 

But this code doesn't seem to be working correctly. It's glitchy.

It does seem to filter, but it still shifts incorrectly on the history.

USDCHF + DXH0




And this synchronisation, for some reason, doesn't work here at all...

int k;  for( k = 0; k < iBars( Symbol_1,Period()); k++)   {
  double bidSymb1=iClose( Symbol_1,Period(),iBarShift( Symbol_1,0,Time[ k],false));         
  double bidSymb2=iClose( Symbol_2,Period(),iBarShift( Symbol_2,0,Time[ k],false));
  if( bidSymb1!=0 && bidSymb2!=0)  {//синхронизируем бары


Maybe someone here can help with the problem?




 
I was told by the author that there is a function to scale it in the current instrument window (by the boundaries of the visible area of the chart), as the instruments are different and so are the candlesticks, could this function be the cause of the problem?
 
I don't think so. There is no synchronisation associated with it.
 

FOOD FOR THOUGHT

An interesting seasonal trend graph was found on an English-language website.

http://www.mrci.com/client/

QM oil, 5 and 15 year trends. See Fig:

Lower window - 5 years (red) and 15 years (blue)

Much more interesting is the upper window!

The blue line is the 15 year trend and the black line is the current 2009-2010 chart.

While from June to October the movement can be anything, from February to March prices are rising "unequivocally"!

Including the current year confirms the upward trend for February...

 
rid >>:



Может быть, кто-нить из присутствующих поможет разобраться с проблемой?




through bar time reconciliation, it worked.

Files:
 
Same thing, but with the possibility of inversion
Files:
 
ress >>:
Тоже самое,но с возможностью инверсии


Thank you.

It seems to work fine with synchronous instruments (e.g. ROSN+LKOH).

But with instruments with different start/end times of trades it glitches!

On Saturday, the 27th, ROSN traded, while all other markets were weekend.

But on the chart CL oil went up on Saturday too... ( mt4 Finam)


 
KiLL-ll >>:

через сверку времен бара заработало.


It's not quite clear either...

I put CL on the oil chart and put Rossneft (ROSN) in the PROPERTIES - but today's bars are not displayed...

 

Hello all ! Nice entry segment. was on ROSN & BRN !