Spread trading in Meta Trader - page 85

 
GEFEL >>:

Извини rid, не разглядел... Мартышка к старости.... Беру оптом.


I put it in my personal message with the condition that I get a detailed explanation of how to make a profit with (and I quote) - "Literally every day I have the honour to observe how the cross and spread can move in different directions - a great opportunity to make a profit".
 
Как тут мне устранить ZERO DIVIDE ?


https://forum.mql4.com/ru/25966 Article: "Error "zero divide".......... who is a fool????" Would it help?
 

Here's the address for the subject. I'll leave it here so it doesn't get lost.

"But! A market is a market, I'm bored without it, so I decided to look at arbitrage from the perspective of the sports betting market for a while. Strangely enough, it is also a market, and a fairly liquid one at that. Terminology of course is different, for example arbitrage is called a fork, traders are called pickers, brokers (bookmakers in this case) are called buks, etc. But the essence of it does not change - either there or there it is a distortion trading, i.e. arbitrage. A simple example of sports arbitrage: people are playing tennis. Players A and B. And there are two offices taking bets on this match - x and y. In office X, the odds on player A are 2.10, on player B 1.80. At the office Y, the odds on player A are 1.80, on player B 2.10. We bet 1,000 each, at X on A, at Y on B. We only bet 2,000, but we'll get 2,100 at any outcome of the match... 100p of 2,000 is 5%. This is called a 5 per cent fork. As you can see, it's a simple strategy... And since I went into someone else's monastery with its own charter, I immediately got it in the neck))) Some bookies don't pay winnings. Or they do, but with a squeak - people wait for months. I'm stuck with one of them now. And those who pay, give forks of lower profitability... But, nevertheless, even with all the hidden tricks, people who have been in this market for a long time, claim that a month from a deposit (here - the bank), you can get 10-30% profit. I cannot say for sure if this is true. We shall see. This is my way of taking a rest from Forex and funds...".


Arbitrage Forks - http://www.livelines.ru/index4.shtml



 
Forks on the books is bullshit, I explain, you need to be in about 20 companies, and always look through their lines, and the fact that you can set a fork, in short there are a lot of rocks that stand in the way, but the forks between futures, it's normal. ))))
 
rid >>:

Вот адресок в тему. . .



only the difference is obvious why forks are not acceptable in the market: in the example 50/50 (win-loss) on every trade, while in the market the outcome options are infinite

 
KiLL-ll >>:

помучав несколько пар инструментов и написав собственный индиратор, а точнее 2 пришел к выводу, что лучше всего использовать для индикатора - метод "Сглаженное скользящее среднее" по нему менее всего выражено отклонение на функцию экспоненты. Что показал опыт. Думаю понятно будет на рисунке

как видно при фактической математической абсолютной разности котировок - ночью у нас эта разность на интервале не меняется. При этом не должен меняться, естественно, и спред между двумя инструментами. НО! при использовании EMA спред у нас будет по-тихоньку убывать на графике относительных едениц, а фактически спред будет оставаться на одном и том же уровне, а значит индикатор будет показывать ложные сигналы.


ВЫВОД: Используя "Сглаженное скользящее среднее" мы максимально приближаем индикацию раздвижки к истинным результатам.


There's one thing I don't understand. Why should the arbitrage spread be smoothed at all? IMHO, it is completely unnecessary...
 
There is no other way around it. If you apply an indication from the moving averages given. There will always be an error. You may even notice it. If everything were perfect, the theory should be: If at the crossover of the given moving averages of 2 instruments we open opposite positions, then in any time interval at the opposite crossover we should actually have 0 minus spread, but this will never happen. So these indicators are rather inaccurate. They show how much slope there was relatively to the averaging period. And the averaging period is dynamic.
 

Friends!

Let's shift the discussion to the area of developing formal criteria for entering and exiting trades. Why all these pictures if any two instruments will always overlap? Maybe I'm being obtuse, and you are doing it more skillfully. Let me show you an example.

1. By indicators: Deviation - the gold line is deviation of gold as percentage of its average price; silver line - deviation of silver as percentage of its average price; histogram - difference of these percentage deviations (here I understand that hedgehogs and cats are deducted, and it bothers me)

Spread profit shows the profit on the trade, controlled by placing arrows on the chart.

2. Selection of lots. The profit curve is calculated for gold(XAU) lots 0.1 : 0.12 silver(XAG). Here I am based on the hypothesis that the prices of both instruments usually change by about the same percentage. So we calculate the value of 1% change in price for each instrument, and reducing it to a point value, etc., we get this ratio. However, it then seemed reasonable to me to base it still on the volatility of the instruments (e.g. based on ATR), but I haven't tested it yet.

3. The "currency spread trading = cross trading" hypothesis. Plus here that the cross walks unrelated to the underlying currencies (this seems nonsense to me, the difference here is sometimes 2-3 pts which will kill the slippage). Well, this hypothesis is valid only when the number of lots for an instrument corresponds to an exact lot (for example for EUR and CHF - 1 to 1.36 [or whatever the EUR is worth]). Then we really trade cross on the basis of one moving average (with all of the resulting losses). But if the ratio of lots will be different (in this case the variant based on volatility makes more sense to me), then it will not be called a pure cross trading.

4. And finally to the most interesting part. Concerning the intersection and divergence of the indicator lines. They will ALWAYS be crossed for ANY two instruments, because each of them is constructed relative to its average price. (I think rid wrote here about some weighting of curves relative to each other - please explain) That's where my biggest misunderstanding lies - can you tell me. Entry rules? - divergence of lines by a "sufficient" distance? exit rules?? - crossing of lines? or their divergence in the other direction by a "sufficient" distance. A reversal system? Any thoughts? Yes, the arrows on the chart show the entry points. If in the second, you can earn.

PS I am digging the topic and have not dug it yet. The results are not impressive even with optimisation. (That said, testing is complicated).

PPS I have been asked here about the deal profit indicator. It is controlled by arrows on the chart: up arrow - buy first instrument, down arrow - sell. (at opening price) cross - closing of positions (also at opening price). Parameter same_direction=1 - trades are opened in one direction, same_direction=-1 - in different directions. Does not like successive opening of new trades without prior closing of the previous ones. Sometimes it disappears from the chart - it is necessary to enter properties and exit (reload).

Files:
 
Costy >>:

Друзья!

Давайте сместим дискуссию в область выработки формальных критериев входа и выхода из сделок. К чему все эти картинки, если на них любые два инструмента всегда будут пересекаться? Может я туплю и вы поступаете более грамотно. Покажу на примере.

1. По индикаторам: Deviation - золотая линия - это отклонение золота в процентах от своей средней цены; серебряная линия - отклонение серебра в процентах от своей средней цены; гистограмма - это разность этих процентных отклонений (тут я понимаю, что вычитаются ежики с кошками, и это меня беспокоит)

Spread profit показывает прибыль по сделке, управляется путем установки стрелок на график.

2. Выбор лотов. Кривая прибыли рассчитана для лотов золото(XAU) 0,1 : 0,12 серебро(XAG). Здесь я базируюсь на гипотезе, что цены обоих инструментов обычно изменяются примерно на один и тот же процент. Поэтому мы рассчитываем стоимость 1% изменения цены по каждому инструменту, и приводя к стоимости пункта и т.д., получаем это соотношение. Однако, потом мне показалось разумным основываться все же на волатильности инструментов (например на основе ATR), но пока не проверял.

3. Гипотеза "торговля валютными спредами = торговля кроссом". Плюс сюда, что кросс ходит несвязанно с базовыми валютами (это мне представляется чушью, разница здесь иногда 2-3 пунта, которые убъет проскальзывание). Так вот, эта гипотеза справедлива лишь тогда, когда количество лотов по инструментам соответсвует точному локу (например для EUR и CHF - 1 к 1.36[или сколько там щас евро стоит]). Тогда действительно мы торгуем кроссом на основе системы на одной скользящей средней (со всеми вытекающими сливами). Но если соотношение лотов будет иным (здесь мне кажется наиболее разумен вариант, основанный на волатильности), то чистой торговлей кроссом это уже не назовешь.

4. Наконец к самому интересному. По поводу пересечения и расхождения линий индикатора. Они ВСЕГДА будут пересекаться для ЛЮБЫХ двух инструментов, т.к. каждая из них построена относительно своей средней цены. (тут rid по-моему писал про какие-то взвешивания кривых относительно друг друга - поясните пожалуйста) Здесь кроется самое большое мое непонимание - подскажите. Правила входа?? - расхождение линий на "достаточное" расстояние? Правила выхода?? - пересечение линий? или их расхождение в другую сторону на "достаточное" расстояние. Переворотная система? Какие у кого мысли? Да, стрелками на графике показаны точки входа. если войти в первой то можно попасть. Если во второй- заработать.

PS Копаю тему и пока не накопал. Результаты тестора не впечатляют даже с оптимизацией. (при этом тестирование осложнено)

PPS тут спрашивали про индикатор прибыли сделки.- выкладываю свой. Управляется стрелками на графике: стрелка вверх покупка первого инструмента, вниз - продажа. (по цене открытия) крестик - закрытие позиций (тоже по цене открытия). Параметр same_direction=1 - сделки открываются в одну сторону, same_direction=-1 - в разные. Не любит последовательных открытий новых сделок без предварительных закрытий предыдущих. Иногда исчезает с графика - надо зайти в свойства и выйти (перезагрузить).

For some reason it's not showing up in MT((

 
ress писал(а) >>

For some reason it's not showing up in MT((

No, it's working. Checked it now. Maybe the history is not loaded for both instances or the arrow and cross on the chart have not been placed (see above picture).

Reason: