Spread trading in Meta Trader - page 166

 
hrenfx:
Unfortunately, I can't connect (to check) to the Broco server, there's no connection to it at the moment for some reason.

The connection has come up. This happens on their demo servers.
 

This is what the spread chart looks like:

It looks like you have an error in your calculations.

 

You could probably take purely currency EURUSD and EURGBP

And for the dollar index in the spread indicator, introduce a dimensional correction somehow.

 

There are two methods:

  1. Stay attached to the pipsollars.
  2. Stop being pegged to them.

For spread chart analysis, the second method is the most accurate.

Bring the code responsible for calculating the triple spread. We will look for the error together.

 

Hardly an error there. Spreads of Related Instruments from the same marketplace (e.g. soybeans ZS-ZM-ZL) are rendered perfectly in all combinations.

But of course - look at the code. Probably, we will indeed find an error there.

Here is the code of spread drawing:

Thedirection of positions is set here by the sign at its size.

extern string    Symbol1.Name="6EH1"; // Нога 1. Если не указан, берет по умолчанию текущий инструмент.
extern string    Symbol2.Name="DXH1"; // Нога 2.
extern string    Symbol3.Name="EURGBP";  // Нога 3.
extern double    Symbol1.Vol=-0.1; // Объем сделки 1-ой ноги. 
extern double    Symbol2.Vol=-0.09;  // Объем сделки 2-ой ноги.
extern double    Symbol3.Vol=0.06;  // Объем сделки 3-ей ноги. 
extern bool      EquityScale = true;      // Показывать масштаб эквити.
 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);
    Symbol3.K = MarketInfo(Symbol3.Name, MODE_TICKVALUE)/MarketInfo(Symbol3.Name, MODE_TICKSIZE);
  }

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))
            + Symbol3.Vol*Symbol3.K*iClose(Symbol3.Name,0,iBarShift(Symbol3.Name,0,t));
   
  }
 
There is no error in the code, you just entered the lots inattentively.
 

Here is the graph.

The upper window is your variant.

Lower window - my variant EURGBP - (6E + DX) =0 .06 :0.09:0.10

 
leonid553:

The upper window is your option.

This is not my variant. Please post the indicator, I will run it on mine.
 

Ok. Please charge it too on the Euro 6EH1 chart

The rest of the parameters:

Files:
 

Entered lots into your indicator carefully: