Not the Grail, just a regular one - Bablokos!!! - page 278

 
reading the topic...
found this quote:
Joker:

I can hardly explain in a nutshell, but I think that hrenfx's work is the closest to the truth, also in terms of explaining the best choice of currency pairs. But there is one note. hrenfx has used his work to find a neutral market spread, from which you can't make a profit except by means of high-frequency trading (but also in this case the spread will eat up all your profit). The direction to dig is a little different.

With your permission the strategy will not disclose further (not for the public). Whoever needs it will find it on his own.

hrenfx was giving the graph such a property as low variance. what property should actually be given to the graph?
 
here's another quote:
Talex:

I have looked at both Alexander's and Joker's trades, as well as seka's. Alexander's deals go as he wrote: "Draw any spread, stabilize the spread equidistant channel by choosing instruments and their volume indices. At the top of the channel - sell, at the bottom - buy, all the wisdom.

Letters from a Zen master

the red line is Necoll's channel. the left vertical line - open trade, the right vertical line - close. how does he build the channel?
 

Friends, explain this point.

When we plot the spread against prices and find coefficients using a simple linear regression, these coefficients reflect the number of lots to make up the spread.

How do you convert to lots if for example we take log(EURGBP) = log(EURUSD) - log(GBPUSD) or for a spread of the form Yi=Xi*Xi?

hrenfx writes that we should convert the ratios into a lot system by dividing by the free funds required to open 1 lot. I cannot understand why

 
because the lot value differs from instrument to instrument, for the same ratio different lot sizes
 
kirill_K:

Friends, explain this point.

When we plot the spread against prices and find coefficients using a simple linear regression, these coefficients reflect the number of lots to make up the spread.

How do you convert to lots if for example we take log(EURGBP) = log(EURUSD) - log(GBPUSD) or for a spread of the form Yi=Xi*Xi?

hrenfx writes that we should convert the ratios to the lot system by dividing by the free funds required to open 1 lot. I can not understand why

this is a very rude and inefficient approach!

for example a broker like activetrades has a margin for franc pairs based on 1:25

i think it's obvious that with this approach the selection of lots for franc pairs would be a big distortion with 1:100 for the rest.

you should not calculate lots on margin; it's much better to do it based on the position value and this is how it's done:

1. we calculate the sum of products of closing prices on the contract value by the modulus of the regression coefficient

2. calculate the multiplier for the volume as a ratio between the desired value of the portfolio and the amount above

3. normalize lots (transform roots into lots) using a multiplier and rounding

there can be alternative methods of lot rationing, e.g. to a given volatility channel

but then you should consider that volatility spikes may be higher for uncompressed instruments and lower for compressed ones.

price logarithms are an useless academic perversion

GerbertX:
here's another quote: the red line is nekoll's channel. the left vertical line - trade opening, the right vertical line - closing. how does he build the channel?

he may have picked it up manually and that's why the spread is as crooked as a poker but most probably he picked it up with leonid's indicator

but it is absolutely unimportant because there are a million and a half different spreads for every taste

It looks like the channel lines are smoothed by a certain coefficient deferred from a moving average or may be the ATR from the average.

Talex:

I looked at the trades of both Alexander and Joker and seka. Alexander's deals appear as he wrote: "Draw any spread and stabilize spread equidistant channel by choosing instruments and their volume indices. At the top of the channel - sell, at the bottom - buy, that's all the wisdom.

The only thing left to do is to solve the problem of spread spread spread and its rebirth into a trend.

averaging a torn spread is a very thankless task.

you have to change the selected instruments and volumes sometimes many times.

it is better to trade directional patterns on spreads than mean reversion, as it has been repeatedly stated

dealing with volumes by artificially positioning the channel is worse than a currency mortgage

GerbertX:
reading the thread...
i found the following quote:
hrenfx gave the chart such property as low dispersion. what property should i actually give to the chart?

minimizing dispersion is a very relative thing and is not always useful

In general, the optimization criterion can be any and there is no "correct" method

It all depends on what model you are going to trade

if we want to break through volatility, it is logical to clamp down on volatility, overlapping the negative correlation in the portfolio

then, for example, build a short-period one before the big news and go up by hardcore

it is possible to fold the positive correlation and squeeze the trend on the optimization interval for rebound trading

you can set the initial movement with asymmetric function and wait for the correction phase

You can ignore everything and build a bunch of spreads filtering them on the forward like a Joker at the second coming

you can hardcore pyramid the components of the spread like Saint Nicholas in the pre-Apostolic period

i.e. for different models there will be different target functions and different optimization criteria


.... with respects, your evening mimidian expert

 
transcendreamer:

This is a very rude and inefficient approach!

for example a broker like activetrades has a margin on franc pairs based on 1:25

it is clear that with this approach the selection of lots for franc pairs will be a big distortion at 1:100 for the rest

you should not calculate lots on margin; it's much better to do it based on the position value and this is how it's done:

1. we calculate the sum of products of closing prices on the contract value by the modulus of the regression coefficient

2. calculate the multiplier for the volume as a ratio between the desired value of the portfolio and the amount above

3. normalize lots (transform roots into lots) using a multiplier and rounding

there can be alternative methods of lot rationing, e.g. to a given volatility channel

But in this case volatility spikes may be higher for uncompressed instruments and lower for compressed ones.

price logarithms are an useless academic perversion


Can I show you an example?

 
kirill_K:

And here you go.

double total_value=0; // зануляем объем

for(int i=0; i<total; i++) // перебираем все инструменты

   total_value += closing[i] * ContractValue(SYMBOLS[i],limit_time,timeframe) * MathAbs(LOTS[i]); // считаем объем для i-ого инструмента, ContractValue - функция оценки контрактов

if(total_value==0) { Alert("Incorrect volume scaling!"); error=true; first_run=false; return; } // сообщаем об ошибке если ноль, мало ли

scale_volume=portfolio_value/total_value; // определяем множитель

for(int i=0; i<total; i++) // снова перебираем все инструменты

   LOTS[i]=NormalizeDouble(LOTS[i]*scale_volume,lots_digits); // рассчитываем лоты

 

transcendreamer:

But then it turns out that we are linearly bringing all the regression coefficients to the value of the portfolio through the scaled coefficient. But as I understand it, ideally we want the equity graph to be as close to the synthetic graph as possible, which is not the case with this approach.

In general terms, the equitability formula for 3 assets:

equity=Volume[1]*Price[1]*Cost of 1 lot+ Volume[2]*Price[2]*Cost of 1 lot+ Volume[2]*Price[2]*Cost of 1 lot

Whereas the synthetic graph in the case of simple linear regression

spread= a*Price[1]+b*Price[2]+c*Price[3]

I.e.

Volume[1]=a/(Cost of 1 lot of ticker 1)

Volume[2]=b/(Cost of 1 lot of ticker 2)

Volume[3]=c/(Cost of 1 lot of ticker 3)

But this is assuming that we have looked for the regression Price[1]=b/a*Price[2]+c/a*Price[3]

What if we do not take the pure price, but decompose it into a function basis, in its simplest form (basis {x;sinx}) Price[1]=A(Price[2]+a*sin(2*PI*b*Price[2]))+B(Price[3]+c*sin(2*PI*d*Price[3])

(It's not important now how to find optimal coefficients a,b,c,d for such a function, just the approach itself is interesting)

Now in order to balance tickers we need to bring coefficients non-linearly to go to lots:

Volume[2]=A(Price[2]+a*sin(2*PI*b*Price[2]))/(Cost of 1 ticker lot 2)

Volume[3]=B(Price[3]+c*sin(2*PI*d*Price[3]))/(Cost of 1 lot of ticker 3)

I.e. coefficients are not constant and it's necessary to rebalance volumes all the time when prices change.

Please tell me where I am wrong.

And how to find coefficients in lots to open a position for spreads, where different not always linear functional dependencies were searched?

Or do we not care about the functional dependence itself (it can be anything) and the regression coefficients A,B are linearly translated into the lot system via the portfolio value (and lot value) conversion?

 

kirill_K:

...


No, it's not true, I use a single scale multiplier for all regression ratios, so lot ratios correspond to the original ratios as much as possible, deviations only in error when rounding to 0.01 (minimum lot), while LOT[i] = ROOT[i] * scale_volume, where LOT[i] is yth lot, ROOT[i] is yth root, scale_volume does not violate the structure of ratios, Theoretically, of course, lots can be selected to "guess" the market phase and improve the portfolio, but in this case the regression model loses its meaning, it would be better to analyse the instruments separately, it would be a variant of multi-instrumental trading, which is also part of the portfolio approach, but of another branch.

 

transcendreamer,

You and I just have different perceptions of synthetics. In general, I have figured out how to work with dynamic coefficients.

I ran the code of Portfolio Optimizer (though I've never written in MQL). Your synthetic formula is identical to Equity (except for rounding) and regression is built using Equity data. And the synthetic formula already has a lot conversion viaContractValue forprofit[i].

But we can add stochastic dependences and various cycles etc. to the synthetic formula if we want, and these dependences are not always linear. And in general we need to find such characteristics of the synthetic that keep at the distance as long as possible. When building a simple linear regression, our channel (outlined by the variance) quickly falls apart, as it is influenced by unaccounted components of the synthetic formula, which causes the error to accumulate quickly. Therefore, you have an implementation of a particular case.

In any case, thank you for your feedback.

Reason: