- Joined
- 24 October 2005
- Posts
- 1,302
- Reactions
- 834
Hi captain black
I'm not sure I understand your reply, a Buy signal is generated in my strategy when the close is greater than the Upper Donchian Channel Buy= C > DonchianUpper
Hi captain black
Are you saying I don't need Howard Bandy's code in my strategy as Backtesting will make that correction for me?
skate
To put it another way, you're going to put buy orders in today based on what stocks have closed above the donchian channel today. Can you tell me now what stocks are going to close above the donchian channel? No, you wont know that until after the close.
captain black is correct, it's looking at future data.
But one possibility is to use a limit order set above the Donchian Channel top. Although there is still no guarantee that the actual close will also be above it, at least it allows you to place the trade and test your system. In addition you will be able to compare the results, e.g. how many trades are different and by how much.
Your other question is very interesting. It would appear that you have discovered an extraordinarily effective entry signal. You might as well forget about he rest of your system, enter your trade just before the close and sell at next day's open. That's $ 41,000 per year right there.
Before you implement it, you should make absolutely sure that this is what you've got (an extraordinarily effective entry signal, that is). If it's based on a Donchian channel breakout or another popular indicator, or something that you have read in a book or a blog - I'll let you fill in the rest ...
On a more serious note, it's usually best to use explicit trade delay code, rather than just commenting out, i.e.
SetTradeDelays(1,1,1,1);
or
SetTradeDelays(0,0,0,0);
Try to get to the bottom of this discrepancy in your test results. Save the two versions of code if it's not already too late and find out exactly what you did wrong. You will learn a lot this way. Comparing a few individual trades might give you the solution.
OK, I accept that - but can you explain why the backtest are so different in Scenario (1) compared to Scenario (2)?
Backtest:
Scenario (1) - Buys on the day it gets the signal - GOOD result - Net Profit
Scenario (2) - Buys on the NEXT day it gets its signal - POOR result - Net LOSS
skate
Is there a clue in the BUY formula, I'll do as you suggested and check each entry and exits in Scenario (1) comparing it with scenario (2)
OK, I accept that - but can you explain why the backtest are so different in Scenario (1) compared to Scenario (2)?
Backtest:
Scenario (1) - Buys on the day it gets the signal - GOOD result - Net Profit
Scenario (2) - Buys on the NEXT day it gets its signal - POOR result - Net LOSS
skate
Same as Captain Black repeatedOK, I accept that - but can you explain why the backtest are so different in Scenario (1) compared to Scenario (2)?
Backtest:
Scenario (1) - Buys on the day it gets the signal - GOOD result - Net Profit
Scenario (2) - Buys on the NEXT day it gets its signal - POOR result - Net LOSS
skate
Hi Skate,
I'm not much of a programmer, so I can't see any obvious logic error apart from using "close". I would suggest that you got such different results because of your stock universe and the fact that you did this comparison with a single run for each scenario.Path dependence would be a significant factor. It's only a guess, but if you compare the trades, there will be different stocks picked at least some of the time to make up the difference in performance. It is unlikely to be just the price difference between today's close and tomorrows open. In other words, scenario 1 is just a "lucky" sequence.
I always say that I'm not qualified to give advice and then I do so anyway. Here is my (unqualified) opinion:
while it is quite interesting and even exciting to play around with backtests, I would suggest most of it is a waste of time. Consider this, masses of people use Metastock, Amibroker, Ninjatrader, Metatrader, etc. The sort of system you are testing has probably been tried thousands of times just this week, and it's only Tuesday. It would be discouraging to hear this. Luckily it's only my opinion, not proof of anything.
What you will need for a system is a concept that has an edge. Otherwise you rely on a bull market or luck.
It would be good to have an entry signal with an edge. Maybe you can also find an exit with an edge. If there are a lot of trading opportunities this way, then you are really getting somewhere.
Secondly, it should be a simple concept. I'm not a believer in a lot of AND and AND NOT in my Buy or Sell statements, but that's just me. I avoid using parameters as much as possible and always examine how the range affects the various results like CAR, DD, exposure, #Trades, Winrate %, ProfitFactor, Sharpe, etc. Just picking a "sweet spot" in a parameter is a big no-no. Of course there will be a different result for every parameter value, but there should be a range of profitable values.
Most indicators provide no edge. Don't trust me on this because technical analysts will disagree with me. Find out for yourself. An edge should be quantifiable. See if you can measure the edge of your Donchian Channel breakout.
Lastly, as you probably know, Howard Bandy has some good advice on in-sample and out-of-sample backtesting, some on posts here on ASF. It's hard to fault the logic. But there is an interesting consequence to consider. Unfortunately this post is getting too long to explain it. It would be almost good enough for its own thread.
The above is still only my opinion.
Same as Captain Black repeated
Scenario 1 you bought before the daily close is greater than the Richard Donchian Channel
You bought the open price for the same day before the close price revealed the close above DC
Scenario 2 you bought after the daily close is greater than the Richard Donchian Channel
You bought the open price for the next day after the close price revealed the close above DC
p.s. for EOD backtesting purposes --- before you type you bought the same day close price well impossible because the market has closed
Hi Skate,
I'm not much of a programmer, so I can't see any obvious logic error apart from using "close". I would suggest that you got such different results because of your stock universe and the fact that you did this comparison with a single run for each scenario.
Path dependence would be a significant factor. It's only a guess, but if you compare the trades, there will be different stocks picked at least some of the time to make up the difference in performance. It is unlikely to be just the price difference between today's close and tomorrows open. In other words, scenario 1 is just a "lucky" sequence.
I always say that I'm not qualified to give advice and then I do so anyway. Here is my (unqualified) opinion:
while it is quite interesting and even exciting to play around with backtests, I would suggest most of it is a waste of time. Consider this, masses of people use Metastock, Amibroker, Ninjatrader, Metatrader, etc. The sort of system you are testing has probably been tried thousands of times just this week, and it's only Tuesday.
It would be discouraging to hear this. Luckily it's only my opinion, not proof of anything.
What you will need for a system is a concept that has an edge. Otherwise you rely on a bull market or luck.
It would be good to have an entry signal with an edge. Maybe you can also find an exit with an edge. If there are a lot of trading opportunities this way, then you are really getting somewhere.
Secondly, it should be a simple concept. I'm not a believer in a lot of AND and AND NOT in my Buy or Sell statements, but that's just me. I avoid using parameters as much as possible and always examine how the range affects the various results like CAR, DD, exposure, #Trades, Winrate %, ProfitFactor, Sharpe, etc.
Just picking a "sweet spot" in a parameter is a big no-no. Of course there will be a different result for every parameter value, but there should be a range of profitable values.
Most indicators provide no edge. Don't trust me on this because technical analysts will disagree with me. Find out for yourself. An edge should be quantifiable. See if you can measure the edge of your Donchian Channel breakout.
Lastly, as you probably know, Howard Bandy has some good advice on in-sample and out-of-sample backtesting, some on posts here on ASF. It's hard to fault the logic. But there is an interesting consequence to consider. Unfortunately this post is getting too long to explain it. It would be almost good enough for its own thread.
The above is still only my opinion.
andTechtrader I believe has that edge
The Donchian Channel Breakout I thought was my edge
Amibroker by default should have a End Of Day Radio Button in the Settings under the tab "TRADES" that can be selected.
Hello skate
there are default Settings as in the screen shot attached. Set the defaults there and click OK and the defaults will always stay defaults until you change them again. With Amibroker it is the users knowledge of the software that people stumble on. The software will do what ever you have the skill and knowledge to create.Periodicity is in General section.
p.s. you have to delay entry/exit until next price is available because that is how real trading works
View attachment 61747
That's my point - if entry/exit can only be executed the next day what is the point of Amibroker having a NO TRADE DELAY feature - is it because not everyone is an EOD trader? (something I didn't consider)
skate
I've just noticed your second post while I was about to reply to the first. I'm not sure what you mean exactly with paper trading. Don't you get your signals from an Amibroker scan or exploration? Why don't they match exactly? There is no slippage or spread in papertrading.
All I can suggest is that you should use a procedure that you can actually execute in real-life. If you are running the exploration after trading hours and place your trades the next day, there is no need for "scenarios". Maybe I haven't understood properly.
By the way, I also disagree with much of the reply you gave to Wysiwyg, but I'll leave it up to him to respond.
This is in response to your previous post
Thanks for your reply, Skate. I'm also an ex-Metastock user.
I hope I'm not upsetting you with my next comment.
You said:
and
You "believe" and you "thought". How about measuring that edge instead?
It's only a suggestion, not particularly difficult to do unless you need to be really thorough like if it's for publication or peer-review.
You take that signal as a Buy order and then you measure the profit/loss 1, 2, 3, 4 ... 20 days after. 20 days is a month. If your signal needs more than 20 days to show a profit, ... anyway, it's up to you.
If you just want a quick indication, a few hundred trades should be enough. That's the quick-and-dirty method.
To do it scientifically, you would need to de-trend your data first and you would need a lot of it, 100,000 trades would be good. Then, having the results, you need to check them for statistical significance, that they are not just random, using t-score or similar.
I don't need that, because I "already know" from other people's research what works. But it's still nice to confirm stuff independently if possible.
I hope this helps and I would recommend trying it at least. You might get a big surprise.
Anyway, I hope I haven't offended you.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?