|
|
Knowledge Base
|
|
NOTE: With the creation of the Thinking Stuff User Manual (available on the Download page), this Knowledge Base has become more of just an announcements area. So maybe not so interesting. Try the Blog instead.
|
|
When you fill in the details of a trading rule, such as a Long Entry Rule, there is the "I want this to NOT be true" option.
Moreover, generally there are always opposite rules available. E.g.:
- Close Above Simple Moving Average
- Close Below Simple Moving Average
So what's the difference between choosing:
- "Close Above Simple Moving Average" and using the "I want this to NOT be true" option; and
- "Close Below Simple Moving Average"
?
Well, there is a slight one.
When the Close is below the SMA, both option #1 and #2 are true.
When the Close is above the SMA, both option #1 and #2 are false.
When the Close is exactly the same as the SMA, option #1 is true, while option #2 is false.
Using "I want this to NOT be true", TS calculates the result of the rule as if you did not want to use this option, then it takes the opposite of that result.
So when the Close equals the SMA, no, it's not above the SMA so the normal result is false, then taking the reverse, the result is true.
In a lot of cases, you can use both methods interchangeably. E.g.:
- One Simple Moving Average Is Above Another
- One Simple Moving Average Is Below Another
In this case there will be no difference between simply choosing the other option, or instead using the "I want this to NOT be true" option.
So you will have to think about your particular situation.
But here's one to consider - the MACD Histogram cross from Oversold into Overbought.
For this one, you choose the following Long Entry Rules:
- "MACD Histogram In Oversold", and set the Bar Offset to 1, meaning you want this rule to have been true 1 bar ago; and
- "MACD Histogram In Overbought"
These two rules combine to allow Long orders to be placed only when the MACD Histogram crossed from Oversold into Overbought.
But what if the value of the MACD Histogram 1 bar ago was exactly zero? In this case the MACD Histogram is neither in Overbought, nor in Oversold. So while the MACD Histogram has legitimately crossed from Oversold into Overbought, TS will disallow the trade because it thinks the MACD Histogram was not in Oversold 1 bar ago.
(Remembering that TS is in fact doing exactly as you told it to do).
This situation is not going to happen very often. If it did, all that happens is you miss a trade. But, if you're worried about it, set the Long Entry Rules to this:
- "MACD Histogram In Overbought", use the "I want this to NOT be true" option, and set the Bar Offset to 1; and
- "MACD Histogram In Overbought"
Doing it this way effectively changes the entry rule from being "enter when the MACD Histogram crosses from Oversold into Overbought" to "enter when the MACD Histogram crosses from not in Overbought into Overbought".
Right now accounts are "attached" to trading systems, and when you do that you also specify the currency to trade in that account.
This is done on the "Accounts & Currencies" tab of the Trading Systems Update window.
In this way, one trading system can trade in multiple accounts and/or multiple currencies. E.g.:
- Account #1, EURUSD
- Account #1, GBPUSD
- Account #2, GBPUSD
In the next release, which will be v0.9.0, this is going to change. Instead of one trading system trading in potentially multiple accounts, one trading system will be able to trade in one account and one currency only.
The change made a lot of things in v0.9.0 a lot easier to do. When thinking about the impact of this change, I realised that:
- It's unlikely that most people are going to *have* more than one account, let alone trading the same system in more than one account; and
- Because of all the various settings, it's unlikely that people are going to be using the exactly the same trading system for more than one currency. Sure, you might use the same rules, but most likely you'd need to alter the periods used for moving averages, etc, in order to get that system to work with a different currency.
There are going to be exceptions to the above 2 points (I know one for sure - sorry Josh), and there is a workaround.
As of v0.9.0, the Accounts & Currencies details are now entered on the "Details" tab (which also doesn't exist until v0.9.0). And rather than attaching accounts and currencies, you just select one of each from a list. (These fields are optional, unless you want that trading system to auto-trade).
When v0.9.0 is released, your Accounts & Currencies setup is going to be wiped. You'll need to manually re-select your account and currency for each trading system you have auto-trading.
If you did have a trading system or two that has more than one account/currency attached, then use the "Copy" functionality to copy your trading system.
In the copied system, set the account and currency to something else. That's it. One trading system for each account/currency combination you had before.
The net effect on TS is nothing - it'll do the same trades as it would have done before, and it will take the same amount of time to do so.
When auto-trading, the trading systems work out automatically the number of bars to retrieve in order to perform the calculations.
The less bars, the better the speed, so TS works out the absolute minimum number of bars required.
For example, to calculate a simple moving average of period 20, you need 20 bars. Simple.
For the MACD Histogram, which calculates two exponential moving averages, then the MACD equals the difference of those two EMAs, then the signal line is the exponential moving average of the MACD, and then the MACD Histogram is the difference of the MACD and the signal line, it's a little trickier. Don't worry about it, TS works it out.
But here's the thing - some indicators have a memory. That is, their calculations work out differently depending on how many bars you retrieve. TS always retrieves the minimum required, but you can override this on the "No Trading" tab of the Trading Systems Update window.
Exponential moving averages (EMAs) are one example. With EMAs, the first value is worked out exactly the same as a simple moving average (SMA). The next value is then worked out taking the previous value into consideration. And so on.
So let's say you have 25 bars in total, and want to calculate the 20-bar EMA. Retrieving only the last 20 bars, the EMA at position 5 is going to be calculated the same as the SMA.
But retrieve 21 bars, and the EMA for the bar now at position 6 will be calculated taking the previous value into account. It is not going to equal the SMA. And that's the whole point of this article - to make you aware of this kind of thing.
So if you look at a chart with an EMA plotted, it might be slightly different to the EMA that your trading system is using. Because when you chart, normally you chart a lot of bars. But TS is only going to retrieve the bare minimum.
The way to stop that difference from happening is to override the number of bars that the system uses, although I can't give you a generic number to use because it all depends on your other settings.
If you put the setting too few, TS will revert back to its own calculations.
As well as the Exponential Moving Average, the other indicators that have this memory are the MACD Histogram, which uses EMAs for its calculations. Also Parabolic SAR.
There could be more, please let me know if you know.
And if in doubt, just contact us.
I've added a couple more Educational Examples, and one more Real-life Example trading system.
The two new educational examples are under the headings:
- Using Pip Offset; and
- Trailing Stops.
And the new real-life example is under the heading:
- %b System #1 With Chandelier Stop
An alarming number of people ask me how do they ensure that a new order will not be placed while a trade is open.
The "Different Stages of a Trade" section of the " Setting Up Trading Systems In Thinking Stuff" page has more information, but I thought I'd clear it up here as well.
A new Long order will be placed only if there is no existing Long order and no existing Long trade. It's the Long Entry Rules that determine if an order is placed or not.
If a Long order is in place, it will be modified if necessary. If the Long Entry Rules say that no order should be there, it will be cancelled.
If a Long trade is in place, the trade management rules and values take over. The Long Entry Rules are not needed anymore until it's closed. As I said, a new Long order will not be set while a Long trade is open.
But here's the thing - Long and Short are separate to each other. Just because a Long order or trade is open, it's not going to prevent a Short order being set. In fact quite often people want to have a Short order in place at the same spot as the Long stop loss. As the Long trade is exited, the Short trade is opened.
This creates the possibility that your Short trades will interfere with your Long, and vice-versa. Please read the "How to hedge?" section of the page mentioned above, even if you don't want to hedge.
The easiest way to get around this is to have one account for all Long trades, and a different, or sub-account, for all your Shorts.
On the Command Centre you can specify how often you want Auto-trading and/or Alerts to kick off.
Plus, on each individual Trading System and Alert, you can specify how often you want it to do auto-trading or alerting.
This article hopes to explain the relationship between the two settings. For brevity, I will just talk about Trading Systems, but it applies to Alerts also. The Command Centre window "Auto-trading" tab will be abbreviated to CCAT, and the Trading System window "Accounts & Currencies" tab will be abbreviated to TSAC.
Let's assume your system uses 1-Minute bars. 1-Minute bars is a very short time-frame, so I think you need to kick things off quite often.
If you imagine the scenario where on the TSAC you set your Trading System to run every 1 minute, and on the CCAT also set Auto-trading to kick off every 1 minute.
The first time Auto-trading kicks off at 12:00, a fraction of a second later it starts off your Trading System. So your Trading System is started at 12:00:00.001.
At 12:01, the next time Auto-trading starts, it is not going to start your Trading System. Because it is not 1 minute since it was last kicked off. It is 59.999 seconds.
At 12:02, the next time Auto-trading starts, it will start your Trading System. That's effectively 2 minutes since the last time.
Now let's change the CCAT setting to 5 seconds. The result is:
Auto-trading starts at 12:00. System is kicked off at 12:00:00.001.
Auto-trading starts at 12:00:05. Nothing to do.
Auto-trading starts at 12:00:10. Nothing to do.
Auto-trading starts at 12:00:15. Nothing to do.
And so on...
Auto-trading starts at 12:01. Nothing to do. It is "only" 59.999 seconds since it was last done.
Auto-trading starts at 12:01:05. System is kicked off at 12:01:05.001, effectively 1 minute and 5 seconds since the last time.
Most likely the next time through, that trading system will also be kicked off 1 minute and 5 seconds since the last time.
So, there is a creep forward effect. Your trading system is not trading every 1 minute as you specified, it is trading every 1 minute and 5 seconds. To get around it, maybe on the TSAC use the setting of 55 seconds instead of 1 minute.
This time at 12:00:55 there is nothing to do because it is 54.999 seconds since it was last done. But at 12:01, it is now 59.999 seconds (effectively 1 Minute) since the last time, our setting is 55 seconds, so the trading system is processed.
Now, I came to the value of 55 seconds by this formula:
How often I actually wanted the trading system to run minus How often auto-trading is kicked off.
That is, my wanted setting on the TSAC minus the setting on the CCAT.
And I thought about doing this automatically in the code, but that formula really only works if those two values fit nicely into each other. If you use a CCAT setting of 9 seconds, for example, then the formula would tell me to set the TSAC setting to 51 seconds. But actually that would result in the trading system doing auto-trading every 54 seconds. Not every 1 minute, and that instead would cause a "creep backward" effect.
In the end, armed with this knowledge about the possible creep forward or backward, you are just going to have make the best judgement about which TSAC setting is best based on your own CCAT setting.
For this particular example of using 1-Minute bars, I would do the following:
- On the TSAC, have your system do auto-trading every 55 seconds.
- On the CCAT, have it start Auto-trading every 5 seconds.
There is no harm in having a system which uses 1-Minute bars to do auto-trading more than once a minute. In fact this scenario is most likely unavoidable as you use longer and longer intervals such as Hourly or Daily.
Previous Page | Next Page
|
|
|

|
|
|
Categories
|
|
|
|
|

|
|
Archives
|
|
|
|
|

|
|
Quotes
|
|
"I do love what you did with your site, and I do admire your work. I am very impressed on your approach, and your methodology."
- T.L. (United States)
|
|
|


|