Discussion of article "How to Secure Your Expert Advisor While Trading on the Moscow Exchange"
Another great article. Congratulations, Vasily!
Notes:
- In the trading panel, under the buttons (or on the buttons, instead of the slippage) it would be convenient to see the price at which, presumably, the entry will be made.
And near the slippage parameter you could specify the volume at which the entry will be made. - Instead of "-1", it would be better to write "> xxx", where xxx is the maximum slippage, which could be calculated by orders from the stack.
- The spread filter looks doubtful. In general, spread is a synthetic concept, especially on a live exchange with a stack.
It seems to me that specifying maximal slippage and entry by limit is enough. - Instead of discretising the work by time (once a minute or in x ticks), it is more correct to smooth the tick stream taking into account volumes and analyse it.
But this is, of course, the topic of a separate article and is not necessary for everyone. Besides, it will not work in the tester. - And I do not agree with the statement "slippage = noise".
In clever books they write about big profits and rare trades, but in reality, in what I saw with my own eyes, the profit consists of many small trades, so even 0.5 points on each entry and exit is a change of results by an order of magnitude.
But this is probably too categorical. It would be enough to clarify that "slippage = noise" is only true for position trading with big targets ;)
Thank you!
Another great article. Congratulations, Vasily!
Comments:
- In the trading panel, under the buttons (or on the buttons, instead of the slippage) it would be convenient to see the price at which, presumably, the entry will be made.
And near the slippage parameter you could specify the volume at which the entry will be made. - Instead of "-1", it would be better to write "> xxx", where xxx is the maximum slippage, which could be calculated by orders from the stack.
- The spread filter looks doubtful. In general, spread is a synthetic concept, especially on a live exchange with a stack.
It seems to me that specifying maximal slippage and entry by limit is enough. - Instead of discretising the work by time (once a minute or in x ticks), it is more correct to smooth the tick stream taking into account volumes and analyse it.
But this is, of course, the topic of a separate article and is not necessary for everyone. Besides, it will not work in the tester. - And I do not agree with the statement "slippage = noise".
In clever books they write about big profits and rare trades, but in reality, in what I saw with my own eyes, the profit consists of many small trades, so even 0.5 points on each entry and exit is a change of results by an order of magnitude.
But this is probably too categorical. It would be enough to clarify that "slippage = noise" is only true for position trading with big targets ;)
Thank you!
I support. Great article! Clear, accessible, beautiful! Thank you very much for your labour!
Thank you all.
If we talk about the appearance of the panel, it is more convenient for everyone to use their own settings and information. But the main idea was not in the visualisation and the panel itself, but in the fact that with the help of limit orders and control over the stack, it is possible to achieve safe market entries with low slippage costs.
Disagree on the filter on Wednesday. Spread is often the only information about the market microstructure that is available to us on history and also in MetaTrader4. The spread is essentially a very short slice of the stack. Therefore, it is tightly correlated with the overall liquidity and can and should be used. Just download the Spread Record indicator and look at its readings at the moment of strong price movements - the spread usually widens at such moments. This means that liquidity becomes less and it becomes impossible to enter at the expected prices. Thanks to the spread, such moments can be tracked on the history.
- Instead of discretising the work by time (once a minute or in x ticks) it is more correct to smooth the tick stream taking into account the volumes and analyze it.
But this, of course, is the topic of a separate article and is not necessary for everyone. Besides, it will not work in the tester.
I strongly disagree with this. The price flow should never be distorted and transformed (e.g. smoothed). We do not trade on the moving average of the price stream, but only on those prices that the market offers us, or on those prices that we set ourselves (limit orders). The "smoothed price flow" is only in our imagination, it does not exist in reality, so it cannot be used. And in this regard, the Wednesday filter is perfect, because in fact it cuts off only price spikes without distorting the price flow itself.
- And I do not agree with the statement "slippage = noise".
In clever books they write about big profits and rare trades, but in reality, in what I have seen with my own eyes, the profit consists of many small trades, so even 0.5 points on each entry and exit is a change of results by an order of magnitude.
But this is probably too categorical. It would be enough to clarify that "slippage = noise" is only true for position trading with large targets ;)
The thing is, those strategies you saw are based on market microstructure. Their entries and exits are not subject to slippage. On the contrary, our slippage is their profit. For these strategies, slippage is not a noise component, but for manual trading and mid-term trading, it is a non-traded factor and therefore noise. The market, like any system, strives for maximum entropy. In its terms it means that the success of each trading situation tends to 50/50 ratio. Therefore, slippage is not always bad. Quite often there are moments when limit orders simply do not work, and stop orders enter the market with a large slippage, but still the directional volatility takes them to the sky giving extravagant positive returns. This means that our slippage is noise in general - it gives both positive and negative outcomes.
I understand correctly that if a stop-loss in the form of limits did not work, because it was not a hairpin, but a big gap, after which the price continued to move further without going back (closing the gap), then the next stop-loss will be in the form of a margin call and stopout instead of any closing of the position, albeit at a very bad price ?
And this
--
Let's use an example to see how to do this. Suppose we have a long position open at Si-6.15. Its stop loss level is the 56,960 level. We need to set the slippage limit at five points, then the "Stop Limit price" value will be equal to 56,960 - 5 = 56,955 points:
As you can see, in the exchange execution mode, this Sell Stop Limit order configuration becomes possible. When the current price reaches the level of 51650, our "Stop Loss" will be triggered, but if for some reason the price goes below 51647, we will not execute our Stop Loss level, considering this situation abnormal.
--
Where did the price 51xxx come from, if it started from 56xxx ?
And this.
--
Let's use an example to see how to do this. Let's assume that we have a long position open on Si-6.15. Its stop loss level is 56,960. We need to set the slippage limit at five points, then the "Stop Limit price" value will be equal to 56,960 - 5 = 56,955 points:
As you can see, in the exchange execution mode, this Sell Stop Limit order configuration becomes possible. When the current price reaches the level of 51650, our "Stop Loss" will be triggered, but if for some reason the price goes below 51647, we will not execute our Stop Loss level, considering this situation abnormal.
--
Where did the 51xxx price come from if it started at 56xxx ?
Thanks for the message. Corrected to the following:
As you can see, in the Exchange Execution mode, this Sell Stop Limit order configuration becomes possible. When the current price reaches the level of 56,960, a Sell Stop Limit order will be placed at 56,955. Since the current price of 56,960 is better than the limit order's stated price, it will immediately execute at 56,960. If there is not enough liquidity to buy at this level, it will be executed at the prices following it up to the level of 56,955. However, our stop-limit order will not be executed worse than this price, thus guaranteeing us a maximum slippage of five points: 56 960 - 56 955 = 5.
(Because of the wrong screenshot, this example had to be redone. The prices changed, but these changes were not made in the text of the article).
I understand correctly that if a stop-loss in the form of limits did not work, because it was not a hairpin, but a big gap, after which the price continued to move further without going back (closing the gap), then the next stop-loss will be in the form of a margin call and stopout instead of any closing of the position, albeit at a very bad price ?
I disagree on the filter on Wednesday. Spread is often the only information about market microstructure that is available to us on history and also in MetaTrader4. The spread is essentially a very short slice of the stack. Therefore, it is tightly correlated with the overall liquidity and can and should be used. Just download the Spread Record indicator and look at its readings at the moment of strong price movements - the spread usually widens at such moments. This means that liquidity becomes less and it becomes impossible to enter at the expected prices. Thanks to the spread, such moments can be tracked on the history.
There is a signal to enter. We are satisfied with the price X (it is a part of the signal, i.e. we are interested in this price).
We set the Limiter. It either triggers or it doesn't. What does it matter what the spread is at the moment of setting the Limit?
The price may come back and catch our order, and then everything will be ok, or it may not come back, and then the order will be cancelled after some time. What does the spread have to do with it?
And if at the moment of signal appearance (for example, when opening a bar) there was a wide spread (the beginning of the session, for example), and then after a minute it normalised, and the price did not go anywhere - why should we miss the signal?
I strongly disagree with this. The price flow should never be distorted and transformed (e.g. smoothed). We do not trade on the moving average of the price stream, but only on those prices that the market offers us, or on those prices that we set ourselves (limit orders). The "smoothed price flow" is only in our imagination, it does not exist in reality, so it cannot be used. And in this regard, the Wednesday filter is perfect, because in fact it cuts off only price spikes without distorting the price flow itself.
And analysing the price once a minute is not distortion? =)))
Smoothing avoids spikes, and in my opinion is much more effective than discretising the analysis to minutes.
And if there was a wide spread when the signal appeared (for example, at the opening of a bar), and then after a minute it normalised, and the price didn't go anywhere - why should we miss the signal?
I did not say that we should miss the signal. On the contrary, it is better to wait for the spread to close (on the next tick or a little bit further) and enter the market working on the signal.
Imagine, your robot receives an Ask stream, wanting to enter a long at 50: 43, 44, 47, 48, 80. It receives Ask 80 and enters the market. Then liquidity recovers and there are limiters offering to sell to you at 49, 50, 51.... But you already ate the bid for 80, only because there was no other more favourable offer at the time of purchase. When you ate the bid at 80, the best bid was still at the level of 48-50, i.e. at that moment the spread widened terribly. But if the robot analysed the difference between the best bid and ask prices, it would have understood that the liquidity for selling had suddenly gone away and buying at 80 was a blunder. The point of spread control is to analyse how much the "best" prices for selling and buying are actually the "best".
H.I. To put it simply: spread widening = empty glass. In an empty glass, you should never hit with marquees - otherwise you will get smashed. We do not analyse the spread to calculate our entry level, but to understand whether it is possible to work with the offer on the market at all.
There is a signal to enter. We are satisfied with the price X (it is a part of the signal, i.e. we are interested in this price).
We set the Limiter. It either triggers or it does not. What does it matter what the spread is at the moment of setting the Limit?
The price may come back and catch our order, and then everything will be ok, or it may not come back, and then the order will be cancelled after some time. What does that have to do with the spread?
By the way, look at what is being done now on RTS-6.15:
Moments of Creepy Spikes - just shows how those who used stop orders (like stop losses) in their trading were stripped. After all, someone managed to sell at 87,200 while the RTS was worth about 91,000. The conclusion is simple, if he was looking at the spread at the bottom, he would not have taken the "best" demand, knowing that in fact the stack is almost empty, and it is much easier, and more accessible, than analysing the full liquidity of the stack.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
New article How to Secure Your Expert Advisor While Trading on the Moscow Exchange has been published:
The article delves into the trading methods ensuring the security of trading operations at the stock and low-liquidity markets through the example of Moscow Exchange's Derivatives Market. It brings practical approach to the trading theory described in the article "Principles of Exchange Pricing through the Example of Moscow Exchange's Derivatives Market".
Anyone who trades on the financial markets is subject to the risks of financial losses. The nature of these risks is different but the outcome is still the same – lost money, wasted time and lasting sense of frustration. To avoid these unpleasant things, we should follow a few simple rules: manage our risks (Money Management), develop reliable trading algorithms and use profitable trading systems. These rules relate to different areas of trading and we should combine them, so that we may hope for reliable positive trading results.
Currently, you can find plenty of books and articles covering the issues of money management, as well as trading systems that can be used in everyday trading activity. Unfortunately, the same is not true for the works on basic safety rules of the market trading.
The article aims to change that by describing the mentioned safety rules that should be followed when trading on the markets. The rules consist of methods and trading practices allowing you to avoid considerable financial losses caused by price spikes, lack of liquidity and other force majeure. The article focuses on the technical risk leaving aside the topics of trading strategy development and risk management.
It brings practical approach to the trading theory described in the article "Principles of Exchange Pricing through the Example of Moscow Exchange's Derivatives Market". While the mentioned article dealt with the theory of exchange pricing, the present paper describes the mechanisms protecting you and your Expert Advisor from accidental financial collapse caused by some dangerous exchange pricing elements.
1.2. Price Spikes
Due to lack of liquidity, price gaps may reach very high values turning into price spikes (deals performed at the prices deviating too much from the market ones). They are very dangerous both for manual traders and automated trading systems. Such spikes trigger pending stop orders executing them at very unfavorable prices.
Let's consider a simple case: suppose that we trade a RUB/USD futures contract and place a Buy Stop order to buy at 64 200. The stop loss is placed at 64 100. We expect the price to move up, however if that does not happen our stop loss at 64 100 is to limit our loss by 100 point. Our risk is seemingly limited but actually that is not true. Let's observe the case when a price spike occurs activating our stop order at quite different prices:
Fig. 4. Tick representation of a spike and Buy Stop order execution
Author: Vasiliy Sokolov