Any trading system has several specific parameters and rules according to which trading positions are opened and closed. It is impossible to create a high-quality system that would not have a single parameter and would not be more or less adapted to history. Even a simple choice of trading logic for building a system, whether trend-tracking or pattern-based, is already a kind of optimization. After all, we make a choice from several possible options based on our knowledge of the potential profitability and risk of various trading styles and methods. But the more parameters and conditions are used in the trading system, the easier it is to adjust the rules of transactions to a specific price chart. Therefore, in order to minimize the fit in my genetic algorithm, the coefficient of security of the parameters with transactions was used. According to it, each explicit parameter of the trading system should account for at least 30 transactions.
Since the article was devoted to the "cultivation" of explicit parameters, less attention was paid to hidden parameters. A hidden parameter can be called any variable in the strategy that the trader accepts "by default" and does not change during the development and optimization of the trading system. This may be, for example, a set of markets where trading is planned. Stock, currency or commodity markets have certain features that may not be repeated in other markets. If trends are more or less present in various markets, then patterns from the stock market will not necessarily work on the currency market. It is good when the patterns found are present in different markets - this increases the versatility and reliability of patterns. But it is likely and not critical if the trading pattern is stable on only one asset class. In this case, it is necessary to test it on a portfolio of assets from this market.
But there is another hidden parameter in almost all trading systems, which is very often not given due attention. This is the discreteness of time, the same timeframe on which trends or statistically significant patterns are being searched. At its core, the "Japanese candle" on the price chart is a concise representation of the dynamics of stock quotes for a specific period of time. Candles can be daily or minute, hourly or weekly. There is no one correct timeframe, there are more or less convenient ones. This is the catch, how to choose the right discreteness and whether it needs to be done at all. Choosing the timeframe of candles or bars, we choose the discreteness of continuous time. But here's a simple question, "what is time?" it can stump even an experienced trader. In this article, I want to talk about some of the most popular ways to convert a continuous stream of stock quotes into a convenient discrete form and about the simplest options for determining your own time of the exchange process.
Read more: What timeframe is the best to trade on
So what is time? The easiest answer is that it's hours, seconds or days. But this is not entirely true, because the listed concepts are units of measurement of time. People have been interested in philosophical questions of time for a long time, but the Newtonian concept of time has become the most complete and widespread. Without going into details, Newton's time is comprehensive and universal for all objects and processes. With one single time, you can measure anything and you can compare different changes along a single time scale. But time units were invented long before this concept. The main ones were the year, the solar day and the lunar month. It is noteworthy that they are all tied to the rotation of the planets. Historically, we do not explicitly link all the processes taking place to the rotation of the Earth and the Moon around its axis and in its orbits. Therefore, time can be designated as a continuous process of transition from one state to another. In this case, this process is cyclical and periodic. It is no wonder that the periods of the day and the calendar year not only did not coincide, but also are not expressed through each other as an integer. Therefore, we have to make an amendment every 4 years. And with the introduction of Einstein's concept and the binding of time to the speed of light or the period of fluctuations of radioactive radiation, it turned out that the duration of the day in winter and summer is slightly different. But this is if we express the duration of the day in "new seconds". And if you do the opposite and express "new seconds" with old days, it turns out that the duration of an atomic second differs in winter and summer. A natural question arises, what is the right way to express time? There is no answer to this question, because each process has its own time. Even a person, regardless of his daily routine, has his own biological time. At the same time, it differs even for physical, mental and psychological states.
Thus, taking classical timeframes, we mean some kind of relationship between the flow of quotes and the rotation of the planets. Not explicitly, of course, but by linking a person to an ordinary astronomical time. Of course, such a relationship is sometimes present on the stock exchange. So, at lunchtime or during the evening session, the exchange activity noticeably decreases. But this is not a reason to rely solely on the alarm clock dial in trading. In relation to the flow of stock quotes, such discreteness will be quite artificial and not always optimal. After all, transactions are mainly characterized by the price of commission, volume and orderliness. A new time scale can be linked to these characteristics.
Then a second reasonable question arises: "how can time be measured in dollars or contracts?". It is very simple - it is enough to recall the definition of time that this is a process of state change. For example, in astronomy, time can be measured in kilometers, and distance can be measured in time. Let's remember the "light year" is the distance that a photon travels in a calendar year at the speed of light. Or in geology, "denudation meter" is the time during which the riverbed deepens by one meter.
Read more: The main components of a Trading Strategy
It is clearly seen that both of these values are tied to the counter of certain events. In fact, a person very often uses a kind of event counter to measure time. We very often notice that at certain moments time seems to fly much faster, and sometimes it takes an unimaginably long time. It all depends on how many significant events take place during this period of time. A classic example would be waiting for something important to happen in the near future. At such moments, the brain simply filters out less significant events, not paying attention to them. Then it feels like time has stopped. One of Murphy's laws on relativity describes this phenomenon of time in the best possible way: "The length of a minute depends on which side of the toilet door you are on."
Thus, by tying the time to the change counter, two definitions can be given:
- The unit of proper time is the duration of the process between its two states, differing by a certain amount.
- In the absence of changes in the state of the process, its own time stops, ceasing its course.
I will rely on these assumptions when constructing a new time axis. With the theory more or less sorted out, you can proceed directly to practice.
First, you need to understand in more detail what Japanese candles are. As mentioned earlier, this is a concise representation of the dynamics of price fluctuations over a specific period of astronomical time. The unit of measurement (the very event to which the counter is linked) is a predetermined number of minutes. As soon as these minutes have expired, a candle is formed and the trader receives information about five values:
- the opening price of this time interval;
- the maximum price reached during this time interval;
- minimum price;
- the closing price or the end of this time interval;
- the total volume of all transactions that were made during this period of time.
Comparing the quotes packaged in this way, the system trader identifies stable patterns. Such a comparison is usually called candle analysis, which was actively popularized by Steve Nisson at the time. Various combinations of candles even got their own names from the Japanese. The dynamics behind a given discreteness comes to the fore in the trading logic of such candle patterns, but the duration of intervals for candles is usually determined by the trading terminal for traders. As a rule, this is 1, 5, 10, 15, 20, 30 minutes, hour, day, week. Why exactly such? Yes, no reason - just because it is familiar to ordinary people and easily scaled. And if the daily candles on the stock market are somehow tied to the schedule of traders, then in the Forex market with its round-the-clock trading, they are absolutely artificial. What can we say about intraday timeframes - there is complete irrationality.
Read more: Volatility: types, how to track and how to use
A little above I already mentioned that it is possible to find the relationship of exchange processes with normal time. For example, in the foreign exchange market, the time counter can be linked to the main sessions that observant traders take into account in their trading. Weekly candlesticks are more self-sufficient and logical, because two weekends are a noticeable event that can affect the exchange process. For futures, in turn, binding to expiration dates looks natural. Another thing is that for real trading, this time interval will turn out to be too large and impractical. But this will not prevent us from using "natural" discreteness for further work.
Choosing a candle timeframe, a trader usually focuses on the frequency of transactions that is convenient for him. Naturally, minute candles provide 60 times more discrete data for analysis than hourly candles. Both are very easy to calculate: minute - from the 6th minute to the 7th, hour - from 11 o'clock to 12. But why not from 11:15 to 12:15? After all, in fact, we will work with the same objective data in the form of already concluded transactions and the working intervals will have the same duration. It's just that the starting point of reference will be slightly shifted, but the own dynamics of quotations will not change at all from this. Because the flow of transactions is primary, and all other subjective timeframes are nothing but artificial compression of the series for a more convenient perception.
It cannot be said that classic timeframes are absolutely useless. Rather, they are not completely complete, because they simplify a complex process to 5 points. Of course, it is possible to find stable patterns in the analysis of ordinary candlesticks, but the patterns behind them will not be fully worked out. After all, this objective pattern will be traded only if it coincides with the next phase of our subjective "cutting". The smaller the intraday timeframe, the easier it is to express your own price movements through it. Therefore, if trading is carried out over relatively large intraday intervals, it is necessary to check whether the effectiveness of trading strongly depends on the artificial discreteness used. It is very easy to do this - it is enough to shift the candle formation time by half a period. That is, for an hourly timeframe - for 30 minutes, for a 10-minute timeframe - for 5 minutes. If the indicators of the system drop noticeably, then there is a good reason to think about retraining.
We turn to the time axis, which is not tied to the traditional astronomical clock. Mantegna and Stanley in their book "Introduction to Economophysics" consider the option of linking their own time of the exchange process to the number of transactions or trading volume. This approach is quite consistent with the idea of time as an event counter. A unit of time can be defined as a constant number of transactions made or candlesticks can be aligned according to the accumulated trading volume. Then, at the moments of exchange activity, when transactions are made more actively, time will accelerate its course.
Read more: The importance of volumes in the market
In my article on trading volumes and open interest, I looked at the chart of stock activity, where peaks at the beginning and end of the daily session were clearly visible. And using the trading volume to form candles will get rid of such unevenness.
Having determined the number of shares issued on the exchange, it is possible to deduce the unit of own time of the exchange instrument as the period for which the trading volume equal to this very amount takes place on the exchange. Depending on the trader's trading preferences, you can use any fractional units - your own "minutes" or "seconds". The main thing is that the trading volume for the formation of candles is constant. For futures, a fixed number of contracts or a percentage change in open interest can be used as a counter. But using a ruble/ dollar counter will no longer be entirely correct, because it will greatly depend on the absolute price of the instrument.
But the trading volume is far from the only objective value to which time can be tied. The second popular method is the formation of candlesticks by the distance that the price should go. Renko charts are usually used for this, which are present in most technical analysis programs. But the classical Renko has a significant drawback - it does not define the starting point of reference from which it is necessary to postpone the distance. In the variant with the trading volume, I used one of the natural cuts of quotes for this - daily candles. And in this case it is more convenient to take a more senior timeframe - weekly. Then the starting point will be the beginning of trading every Monday. This method will sometimes wind up one extra candle every week, but it is much more convenient and practical.
The second important difference from the traditional Renko will be greater flexibility. Usually a new candle is drawn when the price passes a fixed absolute distance in points, without correction for long-term changes. It will be more correct to use adaptive Renko when the distance is determined by the percentage change in price. This approach will allow you to analyze long periods of time. To build a candle, a strictly directed price movement over a certain distance is required. It doesn't matter what fluctuations were inside the time interval. Therefore, such charts can be built both by ticks and by minute candles. The adaptive Renko option allows you to slow down time during periods of calm and accelerate at times of high volatility. This kind of candlesticks, based on the percentage movement of the price in one direction, will be called the "Renko direction".
The above option of linking time to directional movement essentially uses the cumulative sum of tick increments. That is, the total mass of transactions should gradually shift the price in one particular direction, no matter up or down. The deals themselves are not crucial. Therefore, even a stubborn struggle for the level, accompanied by a lot of transactions, will not be reflected on the time axis in any way. This issue can be solved by building time by volume or number of transactions, discussed earlier. But you can use not directional movement, but the entire path covered by the price. That is, use the cumulative sum of the price increment modules. Therefore, even the smallest price fluctuations will be reflected on the new time scale. To do this, you can bind the event counter to the difference module between two consecutive transactions. And as soon as the price "ticks" a certain way, the timeframe is closed and a candle is formed. This approach will allow you to speed up time during periods of increased activity.
Read more: How to become a trader from scratch
When using candles of the "Renko-path" type, a purely technical task comes to the fore. The common path is built in tick increments, so it is necessary to process huge amounts of data.
Now we can say a few words about why new time measurements are needed at all. Most system traders use candlesticks of classic timeframes in their trading systems. If the use of stop orders to enter a trade can give an "individual" time to open a position, then the use of market orders "after the candle closes" creates a crush of orders in the glass at this moment. This moment can be compared to a movie theater, when the whole crowd breaks into a session through one door. And using their own time allows the trader to use a spare "individual" input. It is impossible to say unequivocally which intraday timeframes are correct. You can only choose more convenient ones for yourself. Many of these or similar "times" are widely used in technical analysis programs. These can be "tic-tac-toe", Renko or Kagi, volume bars or candlesticks of the "three-bar breakout" type.
In this article, I talked about some of the most popular ways to determine your own time of the exchange process. Only the simplest methods of candle formation for understanding and practical use were considered. They are united by the fact that the closure of the next time interval is tied to a specific event counter. This can be the accumulation of the required volume, the distance traveled, or updating the maximum. The use of such candles will allow the trader to move away from the bulk of trading participants and make more individual decisions. Having received a better execution of an order or even a new space for analysis, you can even use some ready-made trading systems.