Logo Compose your trading system through a user friendly
graphical interface and see when to go long, short or liquidate.

Intraday and Intervals

Here we describe how the combined Tabs are composed together intradaily for the build of the whole trading system.

In this chapter we cover the concept of intraday sub-intervals and the signals given buy each of them. We also tackle the notion of lack of information inherent in historical data. Rules that Trading Conceiver applies in order to assign the final signal and trade level are listed, together with their realism. We linger on the benefits of intraday trading. Several examples of rules application are recounted.

Introduction

One Signal per Sub-Interval

A Range of Values
As explained in the Key Concepts section, at Open and Close the price is well defined, because it is unique, while at Threshold, we have the interval
  [low, high]    [1]
to consider. The build between the Tabs follows the rules introduced in the previous chapters. At Open and Close those rules are enough. At Threshold we must consider those rules for all the (infinite) values of [1].
Combined Tabs and Intervals
The possible outcomes for each combined Tab are the following:
  • It is true in all [1].
  • It is false in all [1].
  • It is true in some sub-intervals of [1] and false in the others.
Sub-Intervals
When combining all the Tabs together, we must consider all of their sub-intervals, together. This way, each candle (bar...) is divided into sub-intervals. Such sub-intervals are defined as the ranges of values within [1] where any of the combined Tab changes values.
One Signal per Sub-Interval
For each of such sub-intervals, Trading Conceiver evaluates which Tabs are true and determines the whole signal. The rules applied for determining such signal within each specific sub-interval are those described in the previous chapters, in particular in 'Combining the Tabs' and 'Disambiguate'. We end up with a candle being divided in sub-intervals, each with its own signal. That signal holds only for a specific sub-interval. For different sub-intervals, the signal could be different. The outcome is a subdivision of [1], where in each subdivision the signal might be different. The question is: which signal should we pick up?
Theoretical Example
Let's make a very general example for illustrative purposes only. Let's assume that, as a consequence of where the combined Tabs are true in [1], a candle, between low and high, ends up being divided into 5 sub-intervals.

  ┌─────────────────────────────────────────────┬────────┬──────────┐ 
  │              Combined Tabs                  │        │          │
  ├──────┬───────┬──────┬───────┬──────┬────────┤        │          │
  │ Long │ Short │  Liq │  Liq  │ Stop │  Take  │ Signal │    Sub   │
  │      │       │ long │ short │ loss │ profit │        │ interval │
  ├──────┼───────┼──────┼───────┼──────┼────────┼────────┼──────────┤       __
  │   1  │   1   │   0  │   0   │   1  │    0   │   s1   │ [x1, x2] │   │     high
  │   0  │   1   │   1  │   0   │   0  │    1   │   s2   │ [x2, x3] │ ┌─┴─┐
  │   0  │   0   │   0  │   0   │   1  │    0   │   s3   │ [x3, x4] │ │   │
  │   1  │   0   │   0  │   0   │   0  │    0   │   s4   │ [x4, x5] │ │   │
  │   0  │   1   │   0  │   0   │   0  │    0   │   s5   │ [x5, x6] │ └─┬─┘ __low
  └──────┴───────┴──────┴───────┴──────┴────────┴────────┴──────────┘
  
In the previous table there are the 6 combined Tabs, where, as usual, '1' means true and '0' false. The table shows also the 5 sub-intervals [xi, xi+1]. For instance, the Long Tab is true in sub-intervals [x1, x2] and [x4, x5], while the Short Tab in [x1, x2], [x2, x3] and [x5, x6]. The endpoints x1 ... x6 of the intervals are the 'Thresholds'. In each of the sub-intervals, the rules of the previous chapters must be applied to get the signal. Five signals are derived
  s1 ... s5
one for each sub-interval. For instance, signal s1 holds for the sub-interval [x1, x2] and signal s2 for [x2, x3]. In general these signals will be different from each other. Given the signals s1 ... s5, which signal should we consider for trading?

Lack of Information

The Threshold phase, temporally, is a period from Open to Close. However, the only information present in the historical data is the interval [1]. We only know that at a certain time, the low price was reached and at another time, the high price was. We know nothing else. In particular we lack the following information.
Timing of the Event
We don't know if the low was hit before or after the high. We don't even know it they were hit multiple times. In general we don't know which levels within [1] are crossed first and which at a later time.
Swing
We don't know the price swing between the open, low, high and close. Price swings could be numerous. The same level, or Threshold, could be crossed multiple times.
Gaps
Usually not all the values within [1] are touched. There can be gaps. This is a very strong point. We don't know what prices the trade could be made at. Whatever price level we'd like to trade, we don't know if it had been possible in reality.
Unexpected Order
Gaps Another consequence of gaps is that thresholds could be crossed in unexpected orders. For instance, in the picture, we can't assume that threshold 1 is crossed before threshold 2 just because it is nearer to the open price; because they could be crossed simultaneously if a gap occurs, with the gap level above threshold 2.

Rules

Rules for the Signal

Trading Conceiver applies the following rules in order to decide the final signal.
Just One Signal per Threshold
The most important assumption is that just one signal is given for the Threshold phase. In general multiple trades are possible within this span of time. Due to the lack of information explained, Trading Conceiver determines only one signal for all the duration of the Threshold phase. We are 'summing up' what would happen at Threshold in just one trade. Consider that after the first trade at Threshold, all conditions change, and we can't use the current Tabs' values any more, because relative to the previous trade. So we try to make one best assumption.
Hold Signals Are Ignored
Hold signals are ignored. If there is a long position open, all intervals giving long signals are ignored. This is because in these intervals the signal is Hold, i.e. basically nothing happens.
Equal Signals
If all the signals in the sub-intervals are equal, that is the chosen signal.
Different Signals and the 'Different Signals' flag
If the signals in the sub-intervals differ, the chosen signal is always the one which results in no open trade. So, if there is no open position, the signal is hold. If there is an open position, the signal is liquidate. In reality, this isn't necessarily the signal you would trade, because you probably would trade the first occurring signal. But remember that we don't know the exact sequence of events and that gaps can complicate things further. So, this is the most 'neutral' and 'conservative' choice we can make. In this case, a
  Different signals
flag is set for the day.
Arbitrariness
All the previous rules, although sound, are, of course, arbitrary. Others rules could be devised; nonetheless any rule would be arbitrary. Different rules would lead to different trading outcomes, that is to different profit and loss results. Keep this in mind in your evaluation of the trading system you conceived.
Less Arbitrariness
When only one of the combined Tabs is true in [1], then the result is definitely more realistic, because only one signal is present. This could match more closely what would happen in the real world, if you trade only once intradaily and not multiple times.

Rules for the Trade Level

Once the trading signal has been decided based on the previous rules, the trading price must be set. We are dealing with intervals, but now we must define one price level at which the trade occurs. The trading price is computed according to the following rules.
Thresholds
For determining the trade level, the thresholds are considered. Thresholds are the intervals' endpoints. As explained in the previous paragraph, hold signals are ignored and so are their thresholds. So if a threshold is involved only with hold signals, it is dismissed. Usually the low and high values of the price are not factored in, unless significant.
Just One Threshold
If, after considering all the thresholds and dismissing the ones involved only in hold signals, just one threshold remains, then that's the trading level.
More than One Threshold and the 'Different Thresholds' flag
If, on the contrary, we end up with multiple thresholds, the average between the most extreme ones is taken. So we average the lowest and the highest thresholds. In this case a
  Different thresholds
flag is set for the day.
Arbitrariness
Again, it is clear that any choice we make regarding the trading threshold will be arbitrary. As stated previously, different rules would lead to different trading outcomes, that is to different profit and loss results. Keep this in mind in your evaluation of the trading system you conceived.
Less Arbitrariness
When only one threshold is present within the candle, the result is definitely more realistic.

Remarks

Benefits of Intraday Trading

Trading at Threshold Can Increase the Profit
Trading at Threshold Can Increase the Profit - stop loss Trading not only at close, but also at Threshold, might be beneficial to the profit and loss of the trading system. You are acting as soon as possible, as soon as you know that a trade must be accomplished, without waiting for the closing of the market. Think for instance of the stop loss. You define a level, a threshold, where to liquidate a position, because the market is going the opposite direction you were expecting. Probably, you want to act right away, as soon as that level is crossed, not to wait longer until the market closes, when things could get worse. Timing is crucial.

In the example you can see the difference, the Δ, you would loose by acting at close instead of Threshold. There is a short position open, but the market starts rising, a bad thing for the short position. The stop loss liquidates the position intradaily, while acting at close we would have a lower profit equal to the indicated Δ. Sometimes it could even be a difference of transforming a winning position to a loosing position.


Trading at Threshold Can Increase the Profit - Donchian In this other example is depicted the benefit of acting at Threshold without waiting for close. A Donchian channel upper line breakout is traded. A long position is opened intradaily, as soon as the price crosses the upper line. By waiting until close, we would decrease the profit by the indicated Δ.

Clearly, it could even be the other way around: in some cases, waiting for the close would generate better results. Experiment!
Trader Psychology
When you are trading a real market and get a signal, e.g. a stop loss, from your trading system indicating that the current trend is the opposite with respect to the currently open position, what would happen in reality? Would you endure to wait for the close price, or would you want to act immediately? That involves trader psychology. If you are emotional, probably you would liquidate the position as soon as possible.
Consider Trading at Threshold
Hence, despite the above-mentioned arbitrariness in the applied rules, consider using Trading Conceiver for composing trading systems acting intradaily, too. Don't simply rule out that possibility just because of some discretionary assumptions. Do try using intraday algorithms already defined in Trading Conceiver and do select the radio button, in the 'When to trade' pane:
  At open, threshold and close

Realism

Realism We highlighted the arbitrariness involved in trading at Threshold, and that's a fact. However, that doesn't mean that results are unrealistic or useless. With a well conceived trading system, trading at Threshold can be realistic, useful and, above all, profitable.
An Example with No Arbitrariness
Consider this example, built by composing all elementary algorithms trading intradaily:
  • Long Tab
    MA of Donchian channel upper line upside breakout
  • Short Tab
    MA of Donchian channel lower line downside breakout
  • Stop loss Tab
    ATR based stop loss
  • Take profit Tab
    Keltner channel width based take profit
We used multiple Tabs, all operating intradaily. In all resulting trades at Threshold, there is only one signal and one threshold involved. So arbitrariness is basically non-existent.

All the following signals happen at Threshold and are well defined. In [1] there is a downside breakout of the Donchian channel lower line, so a short signal is given at the value (threshold) given by the Donchian lower line. In [2] the stop loss is triggered, at the stop loss level (threshold). In [3] there is an upside breakout of the Donchian channel upper line, so a long signal is given at the value (threshold) given by the Donchian upper line. In [4] the take profit is triggered, at the take profit level (threshold). In [5] and [9] the take profit is triggered again, at the respective take profit level (threshold). In [6] and [7] the stop loss is triggered again, at the respective stop loss level (threshold). In [8] there is another upside breakout of the Donchian channel upper line, at the value (threshold) given by the Donchian upper line.

Examples of Rules Application

In the following examples, only the combined Tabs giving signals, i.e. at true, are shown. Those not shown are false.
Background Colors
Background Colors The colors of the background of each interval in the column 'Signals at intervals' match those of the buy and sell signals given by them, (long, short, liquidate, hold). The colors are selected in the table window. colors
Just One Interval

Just One Interval In this example, no position is currently open and only the Short Tab is true in the Threshold phase. The only interval to consider is that of the Short Tab. There is only one threshold, because we can dismiss the low price level.
    
    <─── short ───> 

  ─┼───────────────┼─────────┼───>
  low              t1       high
  
In the interval
  [low, t1] 
the Short Tab is true. The signal is clearly short. As there is only one signal, short, that's the signal chosen for the trade and the flag
  different signals
is not set. Moreover, there is only one threshold and that's the value chosen for the trade; consequently the flag
  different thresholds
is not set. The simulation of this case is very realistic, in the sense that could strictly match reality.
Variation
Just One Interval A similar example, where there is an open position. This time only the Stop loss Tab is true, giving a liquidate signal.
Just One Interval, Full Range

Just One Interval, Full Range In this example currently there are no open trades. Two Tabs are true in the Threshold phase. There are no 'standard' thresholds, but only the endpoints of the full interval
  [low, high]
The situation is:
    
    <───────── long ────────>  
    <─── liquidate short ───> 

  ─┼─────────────────────────┼───>
  low                       high
  
In the interval
  [low, high]
both the Long and the Liquidate short Tabs are true. This is not an ambiguous case, because with no open trades the Liquidate short doesn't apply and we are left with the long signal. The signal throughout the interval is long, and that's exactly the reported final signal. The flag
  different signals
is not set. The trading level is set to the average of low and high. The flag
  different thresholds
is set.
low = high
low = high It can happen that for a bar:
  low = high
This changes nothing to the reasoning. In this example is:
  Current trade: long
Only the Long Tab is true, confirming the signal, which becomes hold. To highlight that the low and high values are the same, the interval is written as:
  [low=high, low=high]
Hold Signals and Another Signal
Hold Signals and Another Signal Hold Signals and Another Signal In this example is:
  Current trade: short
There are two Tabs true in the Threshold phase:
    
                        <── long ──>  
    <── short ──> 

  ─┼─────────────┼─────────────────┼───>
  low            t1     t2        high 
In the interval
  [low, t1]
only the Short Tab is true, saying to go short. Being a short position already open, the signal is hold. In the interval
  [t1, t2]
no Tab is true, so the signal is hold. In the interval
  [t2, high]
only the Long Tab is true, saying to go long. So we have the following signals for the Threshold phase:
  • Hold in [low, t1]
  • Hold in [t1, t2]
  • Long in [t2, high]
Hold signals are ignored. So the final signal is long and the flag 'different signals' is not set. Moreover, thresholds involved only in hold signals are ignored, t1 in this case, and we can dismiss low and high levels, too. So only one threshold remains, t2, and that's the value chosen for the trade and the flag 'different thresholds' is not set.
Typical and Realistic Case
This is a typical case happening when trading channel breakouts, like the one exemplified in the paragraph 'Realism', when a candle engulfs both the lower and the upper lines. Even in this case the result is very realistic and non-arbitrary, because as long as there are hold signals, no trade is performed, and as soon as there is another signal, the new trade is accomplished at the expected level (threshold).
Hold Signal and Another Signal, Disambiguate

One Signal and Hold Signals In this example is:
  Current trade: long
so the take profit is referred to the current long position. Two Tabs are true in the Threshold phase. There is one threshold, because we can dismiss the low and high price levels:
    
    <───────── long ──────────>   
            <── take profit ──> 

  ─┼──────────────────────────┼───>
  low      t1                 high
  
In the interval
  [low, t1]
only the Long Tab is true. A long signal when the current position is long means a hold signal. In the interval
  [t1, high]
both the Long and the Take profit Tabs are true. A long signal together with a liquidate signal given by the take profit, when the current position is long, is settled by the disambiguate choice, a liquidate in this case. So we have the following signals for the Threshold phase:
  • Hold in [low, t1]
  • Liquidate in [t1, high]
Hold signals are ignored. So the final signal is liquidate and the flag 'different signals' is not set. Moreover, there is only one threshold and that's the value chosen for the trade and the flag 'different thresholds' is not set.
Hold Signal and Another Signal, Disambiguate, Degenerate

One Signal and Hold Signals, Degenerate In this example there are no currently open trades. Three Tabs are true in the Threshold phase. There is only one threshold:
    
    <───────────── long ────────────>
    <── liq long ──><── liq short ──>

  ─┼────────────────────────────────┼───>
  low               t1             high
  
In the interval
  [low, t1]
both the Long and the Liquidate long Tabs are true. This case is settled by the disambiguate choice, a hold in this case. In the degenerate interval
  [t1, t1]
all Tabs are true. Remember that intervals are always considered closed in Trading Conceiver. This case is settled by the same disambiguate choice as before, a hold in this case, because the Liquidate short is "don't care". Degenerate intervals like these happen mostly when two opposite algorithms are used for long and short; in this example we used (for didactical purposes only):
  • MA of SMA downside breakout
    For liquidate long.
  • MA of SMA upside breakout
    For liquidate short.
In the interval
  [t1, high]
both the Long and the Liquidate short Tabs are true. As explained in one of the previous examples, the signal in this interval is long. As before, as hold signals are ignored, the final trading signal is long. There is only one threshold, and that's the one used for the trading level. The flags
  different signals
  different thresholds 
are not set.
Same Signal More than Once

Same Signal More than Once It is perfectly normal to have more than one interval with the same signal. In this example is:
  Current trade: long
so the stop loss is referred to the current long position. Two Tabs are true in the Threshold phase. There are two thresholds:
    
    <─────── short ──────> 
    <─ stop loss ─> 

  ─┼───────────────┼──────┼──────────┼───>
  low              t1     t2        high
  
In the interval
  [low, t1]
both the Short and the Stop loss Tabs are true. The Stop loss wants to liquidate the long position, and the Short wants to open a short position. They are giving consistent signals, namely a stop and reverse. So the signal is short. In the interval
  [t1, t2]
only the Short Tab is true. The signal is clearly short. So we have the following signals for the Threshold phase:
  • Short in [low, t1]
  • Short in [t1, t2]
They match. Obviously the whole trade signal is short. The flag
  different signals
is not set. The trade level is set to the average between the two thresholds. The flag
  different thresholds
is set.
Different Signals

Different Signals In this example is:
  Current trade: long
so the stop loss is referred to the current long position. Two Tabs are true in the Threshold phase. There are two thresholds:
    
    <── short ─>  
    <─────── stop loss ──────> 

  ─┼─────────────────────────┼──────────┼───>
  low           t1            t2        high
  
In the interval
  [low, t1]
both the Short and the Stop loss Tabs are true. The Stop loss wants to liquidate the long position, and the Short wants to open a short position. They are giving consistent signals, namely a stop and reverse. So the signal is short. In the interval
  [t1, t2]
only the Stop loss Tab is true. The Stop loss wants to liquidate the long position, so the signal is liquidate. In the interval
  [t2, high]
no Tab is true. So we have the following signals for the Threshold phase:
  • Short in [low, t1]
  • Liquidate in [t1, t2]
They are different signals, so the final signal is liquidate. The different signals flag is set. Now we have two thresholds. The final trading price is chosen as the average between the two. The different thresholds flag is set, too.
Remarks
These signals might look coherent: liquidate the current long position and enter a new short position. However, in one interval the signal is just liquidate, while in the other is go short. The signals are not simultaneous. In general, we don't know which one would occur first. Remember: we are 'summing up' what would happen at Threshold in just one trade. So the final signal is liquidate.
Potpourri

Potpourri In this example is:
  Current trade: long
We have 5 Tabs true, different signals, different thresholds and a degenerate interval.

                                                <── long ─>
    <───────── short ─────>
    <────────── liq long ───────────> 
                                      <──── liq short ────>
    <─ stop l. ─> 
  ─┼─────────────┼───────────────────────────┼───────────┼──>
  low          3174.3    3182.2    3197.8    3206.2     high 
  
We have the following sub-intervals:
  • [low, 3,174.3]
    The long position should be liquidated because of the Liquidate long and Stop loss Tabs. Moreover, the Short Tab says to go short. So the signal in this sub-interval is short (stop & reverse).
  • [3,174.3, 3,182.2]
    Potpourri The long position should be liquidated because of the Liquidate long Tab. The Short Tab says to go short. So the signal in this sub-interval is short.
  • [3,182.2, 3,197.8]
    The Liquidate long Tab says to liquidate the long position. So the signal in this sub-interval is liquidate.
  • [3,197.8, 3,197.8]
    In this degenerate interval, the Liquidate long Tab says to liquidate the long position, while the Liquidate short Tab is uninfluential when a long position is open. So the signal in this sub-interval is liquidate.
  • [3,197.8, 3,206.2]
    The Liquidate short Tab is uninfluential when a long position is open. So the signal in this sub-interval is hold.
  • [3,206.2, high]
    The Long Tab says to go long and we are already long, which means to hold the position. The Liquidate short Tab is uninfluential when a long position is open. So the signal in this sub-interval is hold.
We have different signals, so the overall signal for the combination of all Tabs is liquidate, and the different signals flag is set. After dismissing the thresholds involved only in hold signals (3206.2), we are left with more than one threshold, so the different thresholds flag is set, too. The final threshold at which we assume the trade is accomplished is the average between the most extreme remaining thresholds, excluding low and high:
  3174.3 + 3197.8
  ─────────────── = 3186.0
         2